Closed alex3kov closed 3 years ago
It's a dock; bspwm
won't manage it by default; since it is not managed, even if it's hidden, it won't matter.
You can make bspwm
manage it with a manage=on
rule (then the hidden flag would work on it), but I bet you don't want it to behave like this (using polybar
as example):
Just use the api provided by your dock to hide it (in polybar
, it is polybar-msg -pid PID_OF_THE_BAR cmd (toggle|hide|show)
).
If stalonetray
(I have never heard of it so I don't know if it has it) doesn't have an api to do so, just use the hide
and show
subcommands of xdo
to unmap and map the dock; example:
# use this command to hide it
xdo hide -Nstalonetray -nstalonetray
# use this command to show it
xdo show -Nstalonetray -nstalonetray
If I add manage=on
and hidden=on
to bspwmrc then bspwm hides stalonetray on startup (and hits #1147 issue right away - empty space at the top), but then xdo show -Nstalonetray
command can't bring it back. Looks like there's no way to toggle hidden
flag at runtime with bspc
either - matching by class is available only in rules unless I'm missing something in man page.\
I do have a workaround script here, just thought doing it all with bspc
would be more "proper".
just thought doing it all with bspc would be more "proper".
I don't think so: it's a dock, not a Window; bspWm is a Window manager. (Also bspwm
doesn't manage docks by default intentionally.)
I don't understand why you tried using a manage=on hidden=on
rule. I thought I made clear why you wouldn't want to make bspwm
manage it. Welp.
but then
xdo show -Nstalonetray
command can't bring it back
Obviously. The window was never unmapped (xdo hide
), it was just being hidden by bspwm
; xdo show -Nstalonetray
doesn't do anything because the stalonetray
"window" is already mapped, you can't see it only because bspwm
doesn't show it.
If you want to hidelunhide it using bspwm
(again, I don't understand why you even tried doing it; it's nonsensical), you need to use bspc
to change the hidden
flag of the managed window; e.g. like so:
# hide
bspc node "$(xdo id -Nstalonetray -nstalonetray)" -g hidden=on
# unhide
bspc node "$(xdo id -Nstalonetray -nstalonetray)" -g hidden=off
# toggle hidden
bspc node "$(xdo id -Nstalonetray -nstalonetray)" -g hidden
Your script is fine in my opinion.
Chill it with the condescension @emanuele6 , not everyone is a bspwm wizard, having domain-specific knowledge doesn't make you smart.\
xdo
I recorded two videos showing you what will happen if you make bspwm
manage a dock; I told you how you can approach the problem; I explained to you why xdo show
wasn't unhiding the window; and I even showed you how you can use bspwm
to hide your bar (which, again, it's nonsensical) just because you tried doing it.
That was indeed not very smart of me; I should use my time better.
bspc rule -a Zathura hidden=on
->zathura
starts hidden.\bspc rule -a stalonetray hidden=on
->stalonetray
starts visible.\ xprop of stalonetray: