summaryrefslogtreecommitdiffstats
path: root/connect-screen
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2022-05-11 09:58:19 +0200
committerFlorian Pritz <bluewind@xinu.at>2022-05-11 09:59:33 +0200
commit50545403257391d59a7d5ba2ca53a09c5e839e78 (patch)
tree763c17f608383056964ca43a822cd61edf7b3cee /connect-screen
parent09bb95709965abd24092331a1bc02914f48d79c8 (diff)
downloadbin-50545403257391d59a7d5ba2ca53a09c5e839e78.tar.gz
bin-50545403257391d59a7d5ba2ca53a09c5e839e78.tar.xz
connect-screen: Add new configs and move i3 workspaces
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'connect-screen')
-rwxr-xr-xconnect-screen50
1 files changed, 48 insertions, 2 deletions
diff --git a/connect-screen b/connect-screen
index 8c65078..4f4403e 100755
--- a/connect-screen
+++ b/connect-screen
@@ -4,16 +4,46 @@ xrandr --output VIRTUAL1 --off
xrandr --output HDMI2 --off
xrandr --output DP1 --off
xrandr --output DP2 --off
+xrandr --output DP1-1 --off
+xrandr --output DP1-2 --off
+xrandr --output DP2-1 --off
+xrandr --output DP2-2 --off
xset r rate 250 50
has_hdmi2=$(xrandr | grep '^HDMI2 connected')
has_dp1=$(xrandr | grep '^DP1 connected')
+has_dp1_1=$(xrandr | grep '^DP1-1 connected')
+has_dp1_2=$(xrandr | grep '^DP1-2 connected')
has_dp2=$(xrandr | grep '^DP2 connected')
+has_dp2_2=$(xrandr | grep '^DP2-2 connected')
-if [[ $has_hdmi2 && $has_dp1 ]]; then
- xrandr --output DP1 --right-of eDP1 --auto
+output_left=""
+output_right=""
+
+if [[ $has_dp1_1 && $has_dp1_2 ]]; then
+ xrandr --output DP1-2 --right-of eDP1 --mode 640x480 -r 60
+ xrandr --output DP1-1 --right-of DP1-2 --mode 2560x1440 -r 60
+ xrandr --output DP1-1 --primary
+ output_left=DP1-2
+ output_right=DP1-1
+elif [[ $has_hdmi2 && $has_dp1_2 ]]; then
+ xrandr --output DP1-2 --right-of eDP1 --auto
+ xrandr --output HDMI2 --right-of DP1-2 --auto
+ xrandr --output DP1-2 --primary
+ output_left=DP1-2
+ output_right=HDMI2
+elif [[ $has_hdmi2 && $has_dp1 ]]; then
+ xrandr --output DP1-1 --right-of eDP1 --auto
xrandr --output HDMI2 --right-of DP1 --auto
xrandr --output DP1 --primary
+ output_left=DP1-1
+ output_right=HDMI2
+elif [[ $has_dp1 && $has_dp2_2 ]]; then
+ xrandr --output DP2-2 --right-of eDP1 --auto
+ xrandr --output DP1 --right-of DP2-2 --auto
+ xrandr --output DP2-2 --primary
+ output_left=DP2-2
+ output_right=DP1
else
if [[ $has_hdmi2 ]]; then
xrandr --output HDMI2 --right-of eDP1 --auto
@@ -31,3 +61,19 @@ else
fi
xkbcomp .xkbmap "$DISPLAY"
+
+# Reorganize workspaces across displays
+if [[ $output_left != "" ]] && [[ $output_right != "" ]]; then
+ workspaces_left=(3 4)
+ workspaces_right=(1 2 5 6 7 8 9 10 11 12 13 14 15)
+ for workspace in "${workspaces_left[@]}"; do
+ i3-msg "[workspace=\"$workspace\"]" move workspace to output $output_left
+ done
+
+ for workspace in "${workspaces_right[@]}"; do
+ i3-msg "[workspace=\"$workspace\"]" move workspace to output $output_right
+ done
+
+ i3-msg "workspace 3"
+ i3-msg "workspace 1"
+fi