mirror of https://gitlab.com/dabruh/dotfiles.git
Replace external i3exit.
This commit is contained in:
parent
6155811b5f
commit
894b653cd1
|
@ -1,4 +1,4 @@
|
||||||
pacman-any:feh,i3exit,i3status,network-manager-applet,pasystray,xautolock,inotify-tools,xss-lock,noto-fonts-emoji
|
pacman-any:feh,i3status,network-manager-applet,pasystray,xautolock,inotify-tools,xss-lock,noto-fonts-emoji
|
||||||
pacman-any:gst-libav,phonon-qt5-gstreamer,gst-plugins-good,qt5-quickcontrols,qt5-graphicaleffects,qt5-multimedia
|
pacman-any:gst-libav,phonon-qt5-gstreamer,gst-plugins-good,qt5-quickcontrols,qt5-graphicaleffects,qt5-multimedia
|
||||||
pacman-any:code,vim,ufw
|
pacman-any:code,vim,ufw
|
||||||
pacman-laptop:brightnessctl
|
pacman-laptop:brightnessctl
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# /usr/bin/i3exit
|
||||||
|
|
||||||
|
# with openrc use loginctl
|
||||||
|
[[ $(cat /proc/1/comm) == "systemd" ]] && logind=systemctl || logind=loginctl
|
||||||
|
|
||||||
|
LOCK_SCREEN_COLOR=${LOCK_SCREEN_COLOR:-29414f}
|
||||||
|
|
||||||
|
lock() {
|
||||||
|
if command -v blurlock >/dev/null; then
|
||||||
|
blurlock
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
i3lock --color="$LOCK_SCREEN_COLOR"
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
lock)
|
||||||
|
lock
|
||||||
|
;;
|
||||||
|
logout)
|
||||||
|
i3-msg exit
|
||||||
|
;;
|
||||||
|
switch_user)
|
||||||
|
dm-tool switch-to-greeter
|
||||||
|
;;
|
||||||
|
suspend)
|
||||||
|
lock && $logind suspend
|
||||||
|
;;
|
||||||
|
hibernate)
|
||||||
|
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 New Issue