Skip to content
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

[Bug]: Network module does not update ramp-signal when disconnected #2805

Open
5 tasks done
CameronAsselin opened this issue Aug 31, 2022 · 2 comments
Open
5 tasks done

Comments

@CameronAsselin
Copy link

CameronAsselin commented Aug 31, 2022

Checklist

  • I have read the appropriate section in the contributing guidelines
  • I believe this issue is a problem with polybar itself and not a misconfiguration on my part
  • I have searched for other open and closed issues that may have already reported this problem
  • I have checked the known issues page for this problem.
  • I have followed the debugging guide to narrow down the problem to a minimal config.

Steps to reproduce

  1. format-disconnected = <ramp-signal> <label-disconnected>
  2. Turn off wifi so you're offline.
  3. <ramp-signal> does not update to ramp-signal-0, instead staying as the last <ramp-signal> icon it had before going offline. It WILL update to the proper icon when the wifi is switched back on however.
  4. Re-launching polybar from the terminal WILL display the proper <ramp-signal> icon (ramp-signal-0).

Minimal config

[bar/main]
font-0 = EPSON 太丸ゴシック体B:style=Regular;2
font-1 = Hack Nerd Font:style=Regular:size=17;2
modules-right = network

[module/network]
type = internal/network
interface = wlp2s0
interval = 1
format-connected = <ramp-signal> <label-connected>
format-disconnected = <ramp-signal> <label-disconnected>
label-connected = %downspeed% | %upspeed%
label-disconnected = offline

ramp-signal-0 = ﮙ
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 
ramp-signal-5 = 

Polybar log

notice: Parsing config file: /home/cameron/.config/polybar/config.ini
notice: Loading module 'network' of type 'internal/network'
notice: Loaded 1 modules
notice: Loaded font "EPSON 太丸ゴシック体B:style=Regular" (name=EPSON 太丸ゴシック体B, offset=2, file=/usr/share/fonts/EPSON/EPMGOBLD.ttf)
notice: Loaded font "Hack Nerd Font:style=Regular:size=17" (name=Hack Nerd Font, offset=2, file=/usr/share/fonts/TTF/Hack Regular Nerd Font Complete.ttf)

Expected behavior

When I use Fn + PrtScr my laptop disconnects the wifi. I should see the emoticon representative of my connection switch to one with x's for eyes, indicating there is no connection.

Actual behavior

The icon stays as whatever my last signal strength was before going offline.

Opening the terminal and launching a 2nd polybar on top of the first shows the proper signal icon. In either case, hitting Fn + PrtScr again to go back online WILL update the icon to reflect my online signal strength. It's only switching to offline that I get this issue.

Images attatched

Window Manager and Version

KWin 5.25.4

Linux Distribution

Arch 5.19.5

Polybar version

polybar 3.6.3

Additional Context / Screenshots

Intended output:
intended_output
Actual output:
actual_output

@patrick96
Copy link
Member

Hmm, from a quick look at the code, it seems like the code updating the signal values may not run at all, leaving the signal value at the old value.

Just as a sanity check, what polybar command are you using? Are you by chance using the -q flag? Or maybe have set the log level to errors only (with -l error)? This would cause a potentially crucial warning message to be swallowed.

Also, can you add the %signal% token to label-connectedand label-disconnected to see whether that value also doesn't update in offline mode.

@CameronAsselin
Copy link
Author

CameronAsselin commented Aug 31, 2022

I have only been running "polybar" with no flags on both startup, and when I run it from the terminal.

When I add %signal% to label-connected and label-disconnected it also doesn't update when switched offline, and also updates when switched back online. When re-launched from the terminal with the wifi already switched off it shows the correct icon and %signal% value.

Before:
before
After:
after
Re-launched from terminal:
refresh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants