make caffeine.sh work again

add wayland-inhibit-idle-git to aur.list
some changes to trans-add
master
alex 2022-09-26 21:15:28 -05:00
parent 4996192f43
commit d923645158
3 changed files with 34 additions and 10 deletions

View File

@ -1,8 +1,33 @@
#!/bin/sh
while :
do
wtype -d 1000 caffeine
wtype -d 1000 -k return
sleep 60
done
PROGRAM_NAME="wayland-idle-inhibitor.py"
help() {
echo "use to toggle inhibiting idle on wayland"
echo ""
echo "usage: caffeine.sh [OPTIONS]"
echo ""
echo " -i - initialize and begin inhibiting idle, which will stop the computer from sleeping."
echo " -s - get status of program, return ON if idle is inhibited, or OFF if idle is not inhibited"
echo " -k - kill program inhibiting idle, allowing the computer to sleep"
echo ""
exit
}
if [ "$1" = "-i" ]; then
$PROGRAM_NAME
elif [ "$1" = "-s" ]; then
if [ "$(pgrep -f $PROGRAM_NAME)" ]; then
echo "ON"
else
echo "OFF"
fi
elif [ "$1" = "-k" ]; then
pkill -f "$PROGRAM_NAME"
else
help
fi
wait

View File

@ -24,3 +24,4 @@ nerd-fonts-mononoki
autotiling
cli-visualizer
wob
wayland-idle-inhibitor-git

View File

@ -36,9 +36,6 @@ help() {
if [ "$1" = "-r" ]; then
ARGS="$2"
IP="$TRNS_IP"
echo "============================="
echo "$ARGS"
echo "============================="
if [ "$3" ]; then
DIR="$DIR/$3"
fi
@ -49,7 +46,8 @@ else
if [ "$2" ]; then
DIR="$DIR/$2"
fi
IP="localhost"
fi
RSP="$(transmission-remote "$IP":9091 -a "$ARGS" -w "$DIR" )"
notify-send "trans-add remote:" "adding: $RSP"
notify-send "trans-add remote:" "adding: $RSP to dir: $DIR"