directorio ~/bin
This commit is contained in:
parent
944c9af788
commit
98ebb096a7
3
bin/clean.sh
Normal file
3
bin/clean.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
rm -rf ~/bin/power
|
5
bin/install.sh
Normal file
5
bin/install.sh
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
rm -rf ~/bin/power
|
||||||
|
|
||||||
|
ln -s $HOME/dotfiles/bin/power $HOME/bin/power
|
36
bin/power
Executable file
36
bin/power
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
COMMANDS="Lock\nToggle Screensaver\nExit\nSuspend\nHibernate\nShutdown\nReboot"
|
||||||
|
|
||||||
|
[ "$(cat /proc/1/comm)" = "systemd" ] && logind=systemctl || logind=loginctl
|
||||||
|
|
||||||
|
COMMAND=`echo -e $COMMANDS | dmenu -fn 'Noto Sans Mono:size=15' -i -p "Power:" "$@"`
|
||||||
|
echo $COMMAND
|
||||||
|
case $COMMAND in
|
||||||
|
Lock)
|
||||||
|
exec xautolock -locknow
|
||||||
|
;;
|
||||||
|
"Toggle Screensaver")
|
||||||
|
exec xautolock -toggle
|
||||||
|
;;
|
||||||
|
Suspend)
|
||||||
|
xautolock -locknow
|
||||||
|
exec $logind suspend
|
||||||
|
;;
|
||||||
|
Hibernate)
|
||||||
|
xautolock -locknow
|
||||||
|
exec $logind hibernate
|
||||||
|
;;
|
||||||
|
Exit)
|
||||||
|
#exec i3-msg exit
|
||||||
|
#killall dwm
|
||||||
|
kill $PPID
|
||||||
|
;;
|
||||||
|
Shutdown)
|
||||||
|
#exec systemctl poweroff
|
||||||
|
exec poweroff
|
||||||
|
;;
|
||||||
|
Reboot)
|
||||||
|
#exec systemctl reboot
|
||||||
|
exec reboot
|
||||||
|
;;
|
||||||
|
esac
|
Loading…
Reference in New Issue
Block a user