summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-02-02 22:41:54 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-02-03 12:14:37 -0700
commit481b0199660668067d87e7e39375837c6561eb52 (patch)
tree9c77fa85eb82aa74404c477b33bf0f310760f11f /scripts
parent4e75e8515c4a8937f246e39b2a24b08b387d879b (diff)
downloaddotfiles-481b0199660668067d87e7e39375837c6561eb52.tar.gz
move dmenu_* scripts bin/ -> scripts/desktop/
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/desktop/dmenu_ssh7
-rwxr-xr-xscripts/desktop/dmenu_window8
2 files changed, 15 insertions, 0 deletions
diff --git a/scripts/desktop/dmenu_ssh b/scripts/desktop/dmenu_ssh
new file mode 100755
index 00000000..c833166b
--- /dev/null
+++ b/scripts/desktop/dmenu_ssh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+host=$(perl -wlne'/^Host\s+(\S+)/ and !/\*/ and print $1' $HOME/.ssh/config \
+ | dmenu -p "ssh to tmux on host" "$@")
+if [ -n "$host" ]; then
+ ssh-and-tmux-term "$host"
+fi
diff --git a/scripts/desktop/dmenu_window b/scripts/desktop/dmenu_window
new file mode 100755
index 00000000..8dc33fde
--- /dev/null
+++ b/scripts/desktop/dmenu_window
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+window=$(i3-msg -t get_tree \
+ | jq -r "recurse(.nodes[]) | select(.window) | .name" \
+ | dmenu -i -p "select window" "$@")
+if [ -n "$window" ]; then
+ i3-msg '[title="'$window'"] focus'
+fi