summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/rename_workspace12
-rwxr-xr-xbin/tmux_attach9
2 files changed, 21 insertions, 0 deletions
diff --git a/bin/rename_workspace b/bin/rename_workspace
new file mode 100755
index 0000000..7636fd2
--- /dev/null
+++ b/bin/rename_workspace
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+workspace=$(i3-msg -t get_outputs | grep -Po '"current_workspace":"[^\"]*"' | sed 's/"current_workspace":"\([^"]\+\)"/\1/g')
+number=$(echo "${workspace//[!0-9]}")
+
+new_name=$(zenity --entry --title="Rename workspace" --entry-text "$workspace")
+if [[ "$new_name" != *:* ]]; then
+ new_name="$number:$new_name"
+fi
+
+echo $new_name
+exec i3-msg rename workspace to "$new_name"
diff --git a/bin/tmux_attach b/bin/tmux_attach
new file mode 100755
index 0000000..564e3bb
--- /dev/null
+++ b/bin/tmux_attach
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+SESSIONS=$(tmux list-sessions | cut -d':' -f1)
+
+SESSION=$(echo "$SESSIONS" | dmenu -i -p "Session:" | tr -d '[[:space:]]')
+
+[[ -n $SESSION ]] || exit
+
+urxvt -e zsh -c "tmux new-session -A -s $SESSION"