diff options
Diffstat (limited to 'dotfiles/.local/bin/workspace')
-rwxr-xr-x | dotfiles/.local/bin/workspace | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/dotfiles/.local/bin/workspace b/dotfiles/.local/bin/workspace index 5183c72..749d77f 100755 --- a/dotfiles/.local/bin/workspace +++ b/dotfiles/.local/bin/workspace @@ -27,14 +27,21 @@ if [ -z "$1" ]; then exit 1 fi -swaymsg "gaps inner current set 0; gaps outer current set 0" +displayw=$(swaymsg -rt get_outputs |\ + jq --raw-output '.[] | select(.focused == true) | .rect.width') +sidebarw=30 + +if [ $displayw -lt 2560 ]; then + swaymsg "gaps inner current set 0; gaps outer current set 0" + sidebarw=27 +fi cd "$1" setsid $TERMINAL -a "$TERMINAL lf:$1" zsh -ic "lfcd" >/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" +swaymsg "[app_id=\"$TERMINAL lf:$1\"] focus; resize set width ${sidebarw}ppt; 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" |