#!/bin/sh tmpf=$(mktemp) printf "monitor-suspend.sh\n" >> $tmpf case $XDG_SESSION_TYPE in "wayland") printf "swaymsg reload\n" >> $tmpf #printf "kill -s USR1 %s\n" >> $tmpf printf "swaylock -e -F -c 000000 --indicator-idle-visible\n" >> $tmpf printf "swaymsg exit # Quit sway\n" >> $tmpf ;; "x11") printf "bspc wm -r\n" >> $tmpf printf "slock /usr/bin/xset dpms force suspend\n" >> $tmpf printf "slock\n" >> $tmpf printf "slock /usr/bin/systemctl suspend -i # lock, suspend\n" >> $tmpf printf "i3-msg exit # Quit i3\n" >> $tmpf ;; esac printf "doas /usr/bin/reboot\n" >> $tmpf printf "systemctl suspend\n" >> $tmpf #printf "systemctl poweroff -i\n" >> $tmpf printf "doas /usr/bin/poweroff\n" >> $tmpf choice="$(cat $tmpf|$PICKER -I0 -p 'Power ops:')" echo "$choice" rm $tmpf notify-send "$(sh -c "$choice 2>&1")"