summaryrefslogtreecommitdiff
path: root/dockd.sh
diff options
context:
space:
mode:
author53hornet <atc@53hor.net>2021-10-26 08:30:58 -0400
committer53hornet <atc@53hor.net>2021-10-26 08:30:58 -0400
commit88784a46b3f0faf3c85010cbc3e2fe3c26939879 (patch)
treeab2183bdb87f325f377a9caf6e0bc7e867c23af2 /dockd.sh
parent7f1adf1900081409214e83a59369967ceaac441f (diff)
downloadscripts-88784a46b3f0faf3c85010cbc3e2fe3c26939879.tar.xz
scripts-88784a46b3f0faf3c85010cbc3e2fe3c26939879.zip
add wallpaper script with display from imagemagick, update dockd
Diffstat (limited to 'dockd.sh')
-rwxr-xr-xdockd.sh37
1 files changed, 15 insertions, 22 deletions
diff --git a/dockd.sh b/dockd.sh
index 6c5831e..4b67bc5 100755
--- a/dockd.sh
+++ b/dockd.sh
@@ -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