summaryrefslogtreecommitdiff
path: root/.a
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2023-01-03 23:29:18 +0200
committerSyndamia <kamen@syndamia.com>2023-01-03 23:29:18 +0200
commit62883f591a6879ddc7b4afd5acec62db53d7cc0b (patch)
treedf7e31ac3f69fc5d4937170fbd26239259a67741 /.a
parent77bd44842e79a4c8f06add6917cdec4ebd6ee5eb (diff)
downloaddotfiles-62883f591a6879ddc7b4afd5acec62db53d7cc0b.tar
dotfiles-62883f591a6879ddc7b4afd5acec62db53d7cc0b.tar.gz
dotfiles-62883f591a6879ddc7b4afd5acec62db53d7cc0b.zip
[plumb] With middle mouse button, xdg-open is always execute, but with left there are other options listed
Diffstat (limited to '.a')
-rwxr-xr-x.a/plumb.sh24
1 files changed, 15 insertions, 9 deletions
diff --git a/.a/plumb.sh b/.a/plumb.sh
index 817cf7e..5b3534a 100755
--- a/.a/plumb.sh
+++ b/.a/plumb.sh
@@ -24,28 +24,34 @@ fi
#
menu=""
-function matches() {
- echo "$selectoin" | grep "$1" >/dev/null 2>&1
-}
-
-#matches "[[:alnum:]]*" && menu+="Run,echo 2\n"
+if [ -z "$1" ]; then
+ function matches() {
+ echo "$selection" | grep "$1" >/dev/null 2>&1
+ }
+
+ menu+="Send,echo 2\n"
+ #matches "[[:alnum:]]*" && menu+="Run,echo 2\n"
+ #matches ".*\.cpp" && menu+="Build and run,echo 2\n"
+fi
#
# Execution menu option
#
-if [ -z $menu ]; then
- action="1"
+if [ -z "$1" ]; then
+ action=$(echo -ne "$menu" | jgmenu --at-pointer --simple --config-file="$HOME/.config/jgmenu/jgmenusimplerc")
else
- action=$(echo -ne "Open,echo 1\n$menu" | jgmenu --vsimple --at-pointer)
+ action="1"
fi
case "$action" in
1)
xdg-open "$selection"
;;
+ 2)
+ xdotool type --delay 0 "$selection"
+ ;;
*)
notify-send "Bad action!"
;;
esac
-