diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2021-04-07 20:25:18 +0200 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2021-04-07 20:25:18 +0200 |
commit | da7beecdd98f24aa7e5edbebdb8276750c09be4f (patch) | |
tree | 03af0166690a3d59d34c41afd304c13678bc0cc5 | |
parent | d8a50709a8dfb0f498367ef80c192138333aa08f (diff) | |
download | scripts-da7beecdd98f24aa7e5edbebdb8276750c09be4f.tar.gz scripts-da7beecdd98f24aa7e5edbebdb8276750c09be4f.zip |
Cleaned initialLayout.sh script.
-rwxr-xr-x | initialLayout.sh | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/initialLayout.sh b/initialLayout.sh index 2408911..54d3a98 100755 --- a/initialLayout.sh +++ b/initialLayout.sh @@ -1,15 +1,29 @@ #!/bin/sh -if pgrep -x i3 && xrandr | grep 'HDMI.* connected'; then - i3-msg focus left - i3-msg workspace 3:👾 - i3-msg focus right +hdmiConnected="" +xrandr | grep 'HDMI.* connected' && hdmiConnected="y" + +if [ -n "$hdmiConnected" ]; then + + "$HOME/.screenlayout/hdmi1080p.sh" + + if pgrep -x bspwm; then + bspc monitor -f HDMI-1-1 + fi + + if pgrep -x i3; then + i3-msg focus left + i3-msg workspace 3:👾 + i3-msg focus right + fi + fi +pgrep -x bspwm && bspc desktop -l monocle urxvt -e tmux new -s main & -sleep 1 -if pgrep -x i3 && xrandr | grep 'HDMI.* connected'; then +if pgrep -x i3 && [ -n "$hdmiConnected" ]; then + sleep 1 i3-msg move workspace number 1:💻 i3-msg workspace number 1:💻 fi |