From dec85ad80a0e7b0b49c354280e1ee3ff4157b9a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Tue, 28 Sep 2021 18:58:29 +0300 Subject: workspace script A quick script to quickly open several terminal windows, in a layout that I often use, all in the specified directory. --- dotfiles/.local/bin/workspace | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 dotfiles/.local/bin/workspace 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" -- cgit v1.2.3