YAD window manager logout function

If you use window managers (not DEs) perhaps the following might be of value. I created the following for systemd based systems (although it is easy to tweak for non-systemd distros). Thisseems to work on dwm, bspwm, openbox… so I assume it will work elsewhere.

Here’s what the item looks like:

EDIT: be advised on borderless desktops, the bar is missing the top window decoration…

Here’s the script:

#! /bin/bash
yad --center --borders=1 --on-top --sticky --single-click --title='Logout Options' \
	--buttons-layout=center \
	--window-icon="gtk-quit: exit" \
	--button="Logout!system-log-out:kill -9 -1" \
	--button="Reboot!system-reboot:systemctl reboot" \
	--button="Shutdown!system-shutdown:systemctl poweroff" \
	--button="Suspend!system-suspend:systemctl suspend" \
	--button=Cancel:0 \

Here’s the polybar module I use to make the logout work from my bar (I also run it via keybinding).

 type  = custom/script
 format-foreground = ${colors.accent}
 exec = echo " "
 click-left = "/home/mark/.local/share/scripts/logout.sh"

I use ‘yad’ on openbox with tint2, may have to play with this a little bit.

Hard at work gain on this confinment time @manyroads !


1 Like

Thanks for sharing.

1 Like

Had time to play a little and it works great Tint2.
Thanks @manyroads