aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/workspace
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2021-10-07 14:43:37 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2021-10-07 14:43:37 +0300
commit7ac60e4a99344d96239f2f4da63b6c9e190045f1 (patch)
tree3aa920bff8c0c18e79c420a630c5bd177b8d8cec /dotfiles/.local/bin/workspace
parent653da507074730db446bc54e8a1165c8f919d4bd (diff)
parent4213b8745e62801b9926c699edf7ad3ffd94f0b4 (diff)
downloadswayrice-7ac60e4a99344d96239f2f4da63b6c9e190045f1.tar.gz
swayrice-7ac60e4a99344d96239f2f4da63b6c9e190045f1.zip
Merge branch 'back-to-qute'
Diffstat (limited to 'dotfiles/.local/bin/workspace')
-rwxr-xr-xdotfiles/.local/bin/workspace40
1 files changed, 40 insertions, 0 deletions
diff --git a/dotfiles/.local/bin/workspace b/dotfiles/.local/bin/workspace
new file mode 100755
index 0000000..bfc2357
--- /dev/null
+++ b/dotfiles/.local/bin/workspace
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+# Yaroslav de la Peña Smirnov 2021
+#
+# A quick script to quickly open several terminal windows, in a layout that I
+# often use, all in the specified directory. The layout looks something like
+# this:
+#
+# ┌──────────────────┬──────────────────────────────────────────────┐
+# │ │ │
+# │ │ │
+# │ lf │ │
+# │ │ │
+# │ │ │
+# ├──────────────────┤ │
+# │ │ shell │
+# │ │ │
+# │ │ │
+# │ shell │ │
+# │ │ │
+# │ │ │
+# │ │ │
+# └──────────────────┴──────────────────────────────────────────────┘
+
+if [ -z "$1" ]; then
+ echo "Specify working directory"
+ exit 1
+fi
+
+swaymsg "gaps inner current set 0; gaps outer current set 0"
+
+cd "$1"
+setsid $TERMINAL -a "$TERMINAL lf:$1" "lf" >/dev/null 2>&1 & sleep 0.1
+setsid $TERMINAL -a "$TERMINAL edit:$1" >/dev/null 2>&1 & sleep 0.1
+
+sleep 0.2
+swaymsg "[app_id=\"$TERMINAL lf:$1\"] focus; resize set width 27ppt; split v"
+setsid $TERMINAL >/dev/null 2>&1 & sleep 0.2
+swaymsg "resize set height 60ppt" && sleep 0.1
+swaymsg "[app_id=\"$TERMINAL edit:$1\"] focus"