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 #!/bin/sh
while : PROGRAM_NAME="wayland-idle-inhibitor.py"
do
wtype -d 1000 caffeine help() {
wtype -d 1000 -k return echo "use to toggle inhibiting idle on wayland"
sleep 60 echo ""
done 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 autotiling
cli-visualizer cli-visualizer
wob wob
wayland-idle-inhibitor-git

View File

@ -36,9 +36,6 @@ help() {
if [ "$1" = "-r" ]; then if [ "$1" = "-r" ]; then
ARGS="$2" ARGS="$2"
IP="$TRNS_IP" IP="$TRNS_IP"
echo "============================="
echo "$ARGS"
echo "============================="
if [ "$3" ]; then if [ "$3" ]; then
DIR="$DIR/$3" DIR="$DIR/$3"
fi fi
@ -49,7 +46,8 @@ else
if [ "$2" ]; then if [ "$2" ]; then
DIR="$DIR/$2" DIR="$DIR/$2"
fi fi
IP="localhost"
fi fi
RSP="$(transmission-remote "$IP":9091 -a "$ARGS" -w "$DIR" )" 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"