diff options
Diffstat (limited to 'dockd.sh')
-rwxr-xr-x | dockd.sh | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1,5 +1,5 @@ #!/bin/sh -#set -x +set -x # To dock: # - set DP-2 (external monitor) to primary output @@ -8,6 +8,7 @@ # - disable laptop lid close sleep # - disable auto locking and sleeping dock() { + xrandr --output DP-3 --off --output DP-2 --auto --primary nvidia-settings --assign CurrentMetaMode="DP-2:nvidia-auto-select +0+0 { ForceCompositionPipeline = On }" themer.sh -r sysctl hw.snd.default_unit=1 @@ -23,6 +24,7 @@ dock() { # - enable laptop lid close sleep # - enable auto locking and sleeping undock() { + xrandr --output DP-3 --auto --primary --output DP-2 --off nvidia-settings --assign CurrentMetaMode="DP-3:nvidia-auto-select +0+0 { ForceCompositionPipeline = On }" themer.sh -r sysctl hw.snd.default_unit=4 @@ -40,12 +42,13 @@ undock() { while sleep 5 do - case "$(xrandr)" in - "DP-2 disconnected primary") + xrandr=$(xrandr) + case "$xrandr" in + *"DP-2 disconnected primary"*) # if DP-2 is disconnected and primary then undock undock ;; - "DP-2 connected (") + *"DP-2 connected ("*) # if DP-2 is connected but isn't primary then dock dock ;; |