Commit Diff


commit - adccbc637928f68349330b395a2c4247c56c049f
commit + 1932ff552d3a2663ecd2d7af0eb91f87a70d116a
blob - d383d2f518c4b5de0091ebc74d372abb1497c2f9
blob + fd4763d6296f06ed1ecaee40c58ffaa2c47dc11d
--- scripts/dmenu_power
+++ scripts/dmenu_power
@@ -2,11 +2,21 @@
 
 case "$(printf 'Lock\nSuspend\nShutdown\nReboot\nHibernate\n' | dmenu -l 5 "$@")" in
 Lock)
-	slock
+	if pgrep xidle > /dev/null; then
+		pkill -USR1 xidle
+	else
+		slock
+	fi
 	;;
 Suspend)
-	doas zzz
-	;;
+	case "$(uname)" in
+	OpenBSD|FreeBSD)
+		doas zzz
+		;;
+	Linux)
+		systemctl suspend
+		;;
+	esac
 Shutdown)
 	doas shutdown -p now
 	;;
@@ -14,6 +24,13 @@ Reboot)
 	doas reboot
 	;;
 Hibernate)
-	ZZZ
+	case "$(uname)" in
+	OpenBSD)
+		ZZZ
+		;;
+	Linux)
+		systemctl hibernate
+		;;
+	esac
 	;;
 esac