diff options
Diffstat (limited to 'dockd.sh')
-rwxr-xr-x | dockd.sh | 37 |
1 files changed, 15 insertions, 22 deletions
@@ -9,8 +9,7 @@ set -x # - 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 + #nvidia-settings --assign CurrentMetaMode="DP-2:nvidia-auto-select +0+0 { ForceCompositionPipeline = On }" sysctl hw.snd.default_unit=1 doas sysctl hw.acpi.lid_switch_state=NONE killall xautolock @@ -25,8 +24,7 @@ dock() { # - 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 + #nvidia-settings --assign CurrentMetaMode="DP-3:nvidia-auto-select +0+0 { ForceCompositionPipeline = On }" sysctl hw.snd.default_unit=4 doas sysctl hw.acpi.lid_switch_state=S3 killall xautolock @@ -35,26 +33,21 @@ undock() { -killer "sleep 0.5; doas acpiconf -s3" \ -notify 10 \ -time 10 \ - -locker "i3lock -n -f -c 000000 -i ~/.local/share/wallpapers/lock.png; sleep 0.2" \ + -locker "i3lock -n -f -c 002b36 ; sleep 0.2" \ -notifier "notify-send -t=10000 '10 seconds to lock...'" & notify-send Undocked } -[ "$1" = "dock" ] && dock && return 0 -[ "$1" = "undock" ] && undock && return 0 - -while sleep 5 -do - xrandr=$(xrandr) - case "$xrandr" in - *"DP-2 disconnected primary"*) - # if DP-2 is disconnected and primary then undock - undock - ;; - *"DP-2 connected ("*) - # if DP-2 is connected but isn't primary then dock - dock - ;; - esac -done +sleep 1 +xrandr=$(xrandr) +case "$xrandr" in + *"DP-2 disconnected primary"*) + # if DP-2 is disconnected and primary then undock + undock + ;; + *"DP-2 connected ("*) + # if DP-2 is connected but isn't primary then dock + dock + ;; +esac |