diff --git a/caffeine.sh b/caffeine.sh index 8a5743c..c8e08e1 100755 --- a/caffeine.sh +++ b/caffeine.sh @@ -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 diff --git a/installers/arch/pkgs/aur.list b/installers/arch/pkgs/aur.list index d16bc80..d7e8b9a 100644 --- a/installers/arch/pkgs/aur.list +++ b/installers/arch/pkgs/aur.list @@ -24,3 +24,4 @@ nerd-fonts-mononoki autotiling cli-visualizer wob +wayland-idle-inhibitor-git diff --git a/trans-add b/trans-add index 663997d..38a40eb 100755 --- a/trans-add +++ b/trans-add @@ -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"