WillPower3309 / swayfx

SwayFX: Sway, but with eye candy!
MIT License
1.29k stars 48 forks source link

Get Layer Name #175

Closed patrickaldis closed 1 year ago

patrickaldis commented 1 year ago

Is there currently a way to get the names of all active layers?

I'm trying to get the layer name for thedunst notification daemon

famfo commented 1 year ago

The layer name for the notification dameon is notifications iirc, you can use swaymsg -t get_tree to get all active layers.

WillPower3309 commented 1 year ago

The layer name for the notification dameon is notifications iirc, you can use swaymsg -t get_tree to get all active layers.

I think I'll add this to the README to prevent any more confusion, I know it isn't at all clear :)

ErikReider commented 1 year ago

I think I'll add this to the README to prevent any more confusion, I know it isn't at all clear :)

Just copy/paste the content from the Man page?

WillPower3309 commented 1 year ago

I think I'll add this to the README to prevent any more confusion, I know it isn't at all clear :)

Just copy/paste the content from the Man page?

Figure getting layer names could use a section

patrickaldis commented 1 year ago

Maybe I'm missing something. But my tree doesn't contain waybar or dunst, I just assumed it didn't show layers

ErikReider commented 1 year ago

Maybe I'm missing something. But my tree doesn't contain waybar or dunst, I just assumed it didn't show layers

Try using get_outputs instead

patrickaldis commented 1 year ago

Try using get_outputs instead

This shows the connected video outputs and their specs

ErikReider commented 1 year ago

Try using get_outputs instead

This shows the connected video outputs and their specs

Yeah, swaymsg -r -t get_outputs also includes the layer information for each display

patrickaldis commented 1 year ago

Ah yeah, that seems to work great. I don't think it's trivial though.

This is the full command I ended up using:

swaymsg -r -t get_outputs | jq '.[0].layer_shell_surfaces | .[] | .namespace'

Which gives a nice output of:

"wallpaper"
"waybar"
"notifications"

So @famfo remembers correctly :)

If I get time I'll add it to the docs

WillPower3309 commented 1 year ago

Added to the README, thanks!