sway: prefix scripts with sway_

This commit is contained in:
Konstantin Koslowski 2021-01-04 18:46:33 +01:00
parent 9a4b96932a
commit f895cb3ee9
6 changed files with 16 additions and 9 deletions

View file

@ -1,68 +0,0 @@
#!/bin/bash
source $HOME/.config/sway/bin/helpers
IMAGE=$HOME/.lockscreen.jpg
SCROT_APP=grim
SCROT_ARGS=" -t jpeg"
LOCK_APP=swaylock
LOCK_ARGS=" -f -c 000000 -i $IMAGE"
INHIBIT_FILE=$HOME/.inhibit_lock
function _clean() {
rm -vf $IMAGE
}
function _lock() {
_check_inhibit $INHIBIT_FILE
$LOCK_APP $LOCK_ARGS
}
function _off() {
swaymsg "output * dpms off"
}
function _on() {
swaymsg "output * dpms on"
}
function _screenshot() {
$SCROT_APP $SCROT_ARGS $IMAGE
convert -blur 4x4 $IMAGE $IMAGE
}
## main
_log LOCK INFO args: $*
_check_app $LOCK_APP
_check_app $SCROT_APP
case "$1" in
inhibit)
_set_inhibit $INHIBIT_FILE $2
;;
lock)
_on
_screenshot
_lock
# _clean
;;
lockonly)
_lock
# _clean
;;
off)
_screenshot
_off
;;
on)
_on
# _clean
;;
screenshot)
_on
_screenshot
;;
*)
echo "invalid argument \"$1\""
echo "arguments: [inhibit [on|off]|lock|lockonly|off|on|screenshot]"
esac