summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2023-01-13 12:30:55 +0200
committerSyndamia <kamen@syndamia.com>2023-01-13 12:30:55 +0200
commit9020beac90c6779d831f0d73639c95a2dabacdb1 (patch)
treef1ebda9bfba763438a42960fe82449d88ee48b9b
parent38c3e54db4ab3bad1553b5a238275f531f8a058a (diff)
downloaddotfiles-9020beac90c6779d831f0d73639c95a2dabacdb1.tar
dotfiles-9020beac90c6779d831f0d73639c95a2dabacdb1.tar.gz
dotfiles-9020beac90c6779d831f0d73639c95a2dabacdb1.zip
[plumb] Added more options and configurability
-rwxr-xr-x.a/plumb.sh36
1 files changed, 30 insertions, 6 deletions
diff --git a/.a/plumb.sh b/.a/plumb.sh
index 5b3534a..6f42d7c 100755
--- a/.a/plumb.sh
+++ b/.a/plumb.sh
@@ -29,7 +29,19 @@ if [ -z "$1" ]; then
echo "$selection" | grep "$1" >/dev/null 2>&1
}
- menu+="Send,echo 2\n"
+ # Settings, 1 for include in menu, 0 for don't include
+ plan9=0
+ runInTerminal=1
+
+ # -= Plan 9 functions =-
+ [ $plan9 -eq 1 ] && menu+="Send,echo 2\nResize,echo 3\nMove,echo 4\n"
+
+ # -= Run =-
+ if [ $runInTerminal -eq 1 ]; then
+ [ $wname == "terminator" ] && [ $plan9 -ne 1 ] && menu+="Send,echo 2\n"
+ [ $wname == "terminator" ] && menu+="Exec,echo 5\n" \
+ || menu+="Exec,echo 6\n"
+ fi
#matches "[[:alnum:]]*" && menu+="Run,echo 2\n"
#matches ".*\.cpp" && menu+="Build and run,echo 2\n"
fi
@@ -45,13 +57,25 @@ else
fi
case "$action" in
- 1)
- xdg-open "$selection"
+ 1) xdg-open "$selection"
+ ;;
+ 2) xdotool type --delay 0 "$selection"
+ ;;
+ 3) xdotool keydown Alt
+ xdotool mousedown 3
+ xdotool keyup Alt
+ ;;
+ 4) xdotool keydown Alt
+ xdotool mousedown 1
+ xdotool keyup Alt
+ ;;
+ 5) terminator --new-tab --command="zsh $selection" &
+ disown
;;
- 2)
- xdotool type --delay 0 "$selection"
+ 6) terminator --command="$selection" &
+ disown
;;
- *)
+ *)
notify-send "Bad action!"
;;
esac