chore(scripts): restore i3exit
This partially reverts commit e80aeb96be
.
This commit is contained in:
parent
319151ee02
commit
a4a0d5e805
1 changed files with 35 additions and 0 deletions
35
dot_local/bin/executable_i3exit
Normal file
35
dot_local/bin/executable_i3exit
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# with openrc use loginctl
|
||||||
|
[ "$(cat /proc/1/comm)" = "systemd" ] && logind=systemctl || logind=loginctl
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
lock)
|
||||||
|
xscreensaver-command -lock
|
||||||
|
;;
|
||||||
|
logout)
|
||||||
|
i3-msg exit
|
||||||
|
;;
|
||||||
|
switch_user)
|
||||||
|
dm-tool switch-to-greeter
|
||||||
|
;;
|
||||||
|
suspend)
|
||||||
|
xscreensaver-command -lock && $logind suspend
|
||||||
|
;;
|
||||||
|
hibernate)
|
||||||
|
xscreensaver-command -lock && $logind hibernate
|
||||||
|
;;
|
||||||
|
reboot)
|
||||||
|
$logind reboot
|
||||||
|
;;
|
||||||
|
shutdown)
|
||||||
|
$logind poweroff
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "== ! i3exit: missing or invalid argument ! =="
|
||||||
|
echo "Try again with: lock | logout | switch_user | suspend | hibernate | reboot | shutdown"
|
||||||
|
exit 2
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
Loading…
Reference in a new issue