-
-
Notifications
You must be signed in to change notification settings - Fork 261
dnf_updates: new module from scratch #2291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
0d74fe9
to
acbcdc9
Compare
thanks for pinging me. module works a treat (tested on fc41)! i have to
admit, i'm not a fan of the non-colored 'DNF' text and preferred the
previous everything-the-same-color. the latter better matches the other
(both py3status and upstream/i3status) modules.
|
additional note: --json was only introduced with dnf5 (at least it isn't
present in my fc38 vm). keeping the old module might be a good idea for
rhel/rocky/etc, who also use (old) dnf in versions 8 and 9. that said,
who knows how few people use these OSes on their desktops, and i3/sway
on top of that.
|
acbcdc9
to
b20430d
Compare
Made a tweak to give default
I heard you. I hadn't used py3status for while now. When I did, I was exposing modules with new color defaults because py3status used to not be able to display them.... and to keep modules in unity with each others. Also, some modules works better with sensible theme/colors such as I just made the consistency tweaks. Modules like
Idk if those old fc are over the new version requirement added not long ago. EDIT: Users changing global default/good/degraded/bad colors... which would change almost all modules that have this configured correctly (hopefully by default or via custom)... is a welcoming change, imho. |
b20430d
to
0f2c466
Compare
(Testers) Do we need to change |
0f2c466
to
7a0c044
Compare
7a0c044
to
41e35d0
Compare
On Tue, Aug 26, 2025 at 03:47:08AM -0700, Ultrabug wrote:
ultrabug left a comment (ultrabug/py3status#2291)
@girst need you to validate this module, I dont have a fedora box,
cheers
the module works, but i'll reiterate my gripe about the colorization.
https://imgur.com/Qii8S9A.png
modules: 3x imap, old fedora_updates, new dnf_updates, wifi, ethernet.
note how all of them color the whole module, but dnf_updates only colors
the number. this is IMO worse, as especialy with single-digit updates it
is easy to miss that something is available.
|
module breaks every time after resuming from standby:
2025-09-03 11:59:49 WARNING Instance `dnf_updates`, user method `dnf_updates` failed (CommandError) py3.py line 1021.
2025-09-03 11:59:49 INFO Traceback
CommandError: Command `dnf updateinfo list --json` returned non-zero exit status 1
File "/home/t/projects/py3status/py3status/module.py", line 952, in run
response = method()
File "/home/t/projects/py3status/py3status/modules/dnf_updates.py", line 70, in dnf_updates
dnf_data = self._get_dnf_data()
File "/home/t/projects/py3status/py3status/modules/dnf_updates.py", line 61, in _get_dnf_data
updates = loads(self.py3.command_output("dnf updateinfo list --json"))
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/t/projects/py3status/py3status/py3.py", line 1021, in command_output
raise exceptions.CommandError(
msg, error_code=retcode, error=error, output=output
)
|
argh! it seems, github swallows some of my emails sent to this discussion. one from earlier that did not make it:
just now:
|
This is what you want. # i3status theme
format = "[\?if=security&color=bad DNF: {available}"
format += "|\?color=available DNF: {available}]"
# i3status theme - hide module when no available updates
format = "[\?if=available [\?if=security&color=bad DNF: {available}"
format += "|\?color=available DNF: {available}]]" This is what I was trying to support in py3status formats. general {
# These will be used if not supplied by a module
color = '#FFFFFF'
color_good = '#00FF00'
color_bad = '#FF0000'
color_degraded = '#FFFF00'
} Imho, py3status formats should include headers. Also, i3status can't colorize. This is customization issue. Py3status could benefit from having theme support... such as users specifying
I can add i3status theme (what you want above) in |
6b9ea2a
to
a8a9ca8
Compare
a8a9ca8
to
fb03ef8
Compare
fb03ef8
to
f8a3398
Compare
Just updating this module from scratch. I dunno. Untested.
color
in the response in favor of more colors viaself.py3.safe_format
format
should mimiccheck_security = True
behaviorcheck_security = True
behavior by usingformat = "DNF [\?color=available {available}]
format = "[\?if=security&color=bad DNF: {available}|\?color=available DNF: {available}]"
Closes #2290. /cc @girst for testing.