add a couple scripts to bin

This commit is contained in:
Mark Riedesel 2019-07-19 16:20:03 -05:00
parent 28673aac9c
commit 2af44fe39f
2 changed files with 43 additions and 0 deletions

35
_bin/i3exit Executable file
View file

@ -0,0 +1,35 @@
#!/bin/sh
lock() {
if [ -e "$(which i3lock)" ]; then
i3lock
fi
}
case "$1" in
lock)
~/bin/lockscreen
;;
logout)
i3-msg exit
;;
suspend)
lock && systemctl suspend
;;
hibernate)
lock && systemctl hibernate
;;
blank)
sleep 1; xset dpms force off
;;
reboot)
systemctl reboot
;;
shutdown)
systemctl poweroff
;;
*)
echo "Usage: $0 {lock|logout|suspend|hibernate|blank|reboot|shutdown}"
exit 2
esac
exit 0

8
_bin/screengrab Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
mkdir -p ${HOME}/screenshot
TARGET="${HOME}/screenshot/grab-$(date +'%Y%m%d%H%M%S').png"
maim -s -n -p 1 -f png -m 10 -u | tee $TARGET | xclip -selection clipboard -t image/png
[ -s ${TARGET} ] || rm ${TARGET}