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

[Feature]: XWorkspaces does not get urgent flag from XMonad #3118

Open
5 tasks done
lockie opened this issue Apr 22, 2024 · 2 comments
Open
5 tasks done

[Feature]: XWorkspaces does not get urgent flag from XMonad #3118

lockie opened this issue Apr 22, 2024 · 2 comments

Comments

@lockie
Copy link

lockie commented Apr 22, 2024

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. polybar -c config
  2. wmctrl -r "qutebrowser" -b add,demands_attention

Minimal config

[bar/mybar]
modules-left = ewmh
bottom=true
background = #3f3f3f
foreground = #dcdccc
font-0 = fontawesome:pixelsize=12;3

[module/ewmh]
type = internal/xworkspaces
format = <label-state>
icon-0 = default;
icon-1 = chat;
icon-2 = coding;
icon-3 = internets;
icon-4 = todo;

label-active = %icon%
label-active-foreground = #5f7f5f
label-active-background = #3f3f3f

label-occupied = %icon%
label-occupied-foreground = #f5deb3

label-urgent = %icon%
label-urgent-foreground = #ff0000

label-empty = %icon%
label-monitor = %icon%

Polybar log

notice: Parsing config file: config
notice: Loading module 'ewmh' of type 'internal/xworkspaces'
notice: Loaded 1 modules
notice: Loaded font "fontawesome:pixelsize=12" (name=FontAwesome, offset=3, file=/usr/share/fonts/fontawesome/FontAwesome.otf)

Expected behavior

The icon for the workspace containing qutebrowser becomes red.

Actual behavior

The icon for the workspace containing qutebrowser keeps having "occupied" color.

Window Manager and Version

XMonad 0.17.0

Linux Distribution

Gentoo

Polybar version

polybar 3.7.1

Features: +alsa +curl +i3 -mpd -network(libnl) +pulseaudio +xkeyboard

X extensions: +randr (+monitors) +composite +xkb +xrm +xcursor

Build type: RelWithDebInfo
Compiler: /usr/bin/x86_64-pc-linux-gnu-g++
Compiler flags: -march=native -mtune=native -O2 -fomit-frame-pointer -pipe -ggdb  -Wall -Wextra -Wpedantic -Wdeprecated-copy-dtor -Wsuggest-override
Linker flags: -Wl,-O1 -Wl,--as-needed -Wall -Wextra -Wpedantic -Wdeprecated-copy-dtor -Wsuggest-override  -Wall -Wextra -Wpedantic -Wdeprecated-copy-dtor -Wsuggest-override

Additional Context / Screenshots

The window in question does get the red frame as per XMonad config, so this appears to be unrelated to XMonad itself:

$ xprop -spy | grep -i demand
_NET_WM_STATE(ATOM) = _NET_WM_STATE_DEMANDS_ATTENTION
@patrick96
Copy link
Member

The xworkspaces module does not look at _NET_WM_STATE at all. It only uses the urgency bit (in WM_HINTS).

My WM (herbstluftwm) seems to set the urgency bit when _NET_WM_STATE_DEMANDS_ATTENTION is set, and yours probably doesn't you can confirm with the following command:

xprop -spy | grep -i urgency

If this is just about setting the urgency hint properly, you can try this:

xdotool search --name firefox set_window --urgency 1 %@

I wouldn't really consider this a bug, but more of a missing feature. PRs are of course welcome :)

@patrick96 patrick96 changed the title [Bug]: XWorkspaces does not get urgent flag from XMonad [Feature]: XWorkspaces does not get urgent flag from XMonad Apr 23, 2024
@lockie
Copy link
Author

lockie commented Apr 23, 2024

Thanks a lot for thorough explanation Patrick! Your hunch was indeed right, XMonad does not set WM_HINTS when it comes to urgency. I'm too unfamiliar with polybar codebase, so I guess I'll just dance around getWMHints in XMonad config.

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