summaryrefslogtreecommitdiff
path: root/toggle-docked.sh
diff options
context:
space:
mode:
Diffstat (limited to 'toggle-docked.sh')
-rwxr-xr-xtoggle-docked.sh57
1 files changed, 18 insertions, 39 deletions
diff --git a/toggle-docked.sh b/toggle-docked.sh
index 54551a1..6a97907 100755
--- a/toggle-docked.sh
+++ b/toggle-docked.sh
@@ -1,47 +1,26 @@
#!/bin/sh
-hasVGA=$(xrandr | grep VGA-0 | cut -w -f2)
+big=2560x1440
+little=1920x1080
+is_docked=$(xrandr | grep DP-2 | cut -w -f2)
-if [ "$hasVGA" = "connected" ]; then
+if [ "$is_docked" = "connected" ]; then
xrandr \
- --output VGA-0 \
- --mode 1024x768 \
- --pos 1920x0 \
- --rotate normal \
- --dpi 82 \
- --output DP-0 \
- --off \
- --output DP-1 \
- --off \
- --output DP-2 \
- --off \
- --output DP-3 \
- --primary \
- --mode 1920x1080 \
- --pos 0x0 \
- --rotate normal \
- --dpi 96 \
- --output DP-4 \
- --off
- killall xautolock
+ --output DP-0 --off \
+ --output DP-1 --off \
+ --output DP-2 --primary --mode $big --pos 0x0 --rotate normal --dpi 96 \
+ --output DP-3 --scale-from $big --same-as DP-2 --rotate normal \
+ --output DP-4 --off \
+ --output VGA-0 --off \
+ && killall xautolock
autolocker.sh -d &
else
xrandr \
- --output VGA-0 \
- --off \
- --output DP-0 \
- --off \
- --output DP-1 \
- --off \
- --output DP-2 \
- --off \
- --output DP-3 \
- --primary \
- --mode 1920x1080 \
- --pos 0x0 \
- --rotate normal \
- --dpi 96 \
- --output DP-4 \
- --off
- killall xautolock
+ --output DP-0 --off \
+ --output DP-1 --off \
+ --output DP-2 --off \
+ --output DP-3 --primary --mode $little --pos 0x0 --rotate normal --dpi 96 \
+ --output DP-4 --off \
+ --output VGA-0 --off \
+ && killall xautolock
autolocker.sh &
fi