From 9020beac90c6779d831f0d73639c95a2dabacdb1 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 13 Jan 2023 12:30:55 +0200 Subject: [plumb] Added more options and configurability --- .a/plumb.sh | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) (limited to '.a') 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 -- cgit v1.2.3