summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-01-11 17:26:56 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2024-01-11 17:26:56 -0500
commit7838c38253bb1a311c8fa96848802402fbf6b9eb (patch)
tree0d2a91833a48dcbcaa9637dcfb9f454e5cc57359
parent2daec1dbf625fe706cf45687d6852349ecfe5ad0 (diff)
Add quick monitor config script
-rwxr-xr-x.screenlayout/quick-presentation.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/.screenlayout/quick-presentation.sh b/.screenlayout/quick-presentation.sh
new file mode 100755
index 0000000..8a8123b
--- /dev/null
+++ b/.screenlayout/quick-presentation.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+mainmon="eDP"
+
+# List monitors with xrandr
+# Keep all linues that contain " connected"
+# Remove the main monitor from the list
+# Remove all disconnected monitors
+# Delete empty lines
+# Get the first non-main monitor
+# Sanitize the output (keep only the monitor name)
+othermon="$(xrandr | grep " connected" |
+ sed "s/.*$mainmon\s.*//g;
+ /^$/d;
+ s/\([A-Z0-9]\+\) .*/\1/g" |
+ head -n 1)"
+
+xrandr --output "$mainmon" --auto --output "$othermon" --auto --above "$mainmon"
+
+makewall