How do i add an icon to show desktop in polybar (minimize all pages)


#1

heya guys id like to add a show desktop icon near the clock, how can i do that?


#2

Well - If you are using either OpenBox or I3 - there isnt a reason for such a beast as you have the ability to use the mod+1-0 keys to switch desktops. Above and beyond that, that is something you will either have to code yourself or do a search with polybar + other criteria for that.


#3

You would need to create a custom module for jgmenu - like these user contributed modules.

polybar doesn’t accept window manager commands though, so you would have to script something - maybe with xdotool or wmctrl.


#4

If you’re using Openbox, super+d will display the desktop.


#5

‘wmctrl’ is good for this? Can’t remember the exact command, but should be googlable.

Or picking up on the point that @Dobbie03 made, run the command ‘xdotool key super+d’


#6

In your polybar config file, try the following:

[module/foo]
type = custom/text
content = show desktop
click-left = "xdotool key super+d >/dev/null 2>&1 &"