diff options
-rwxr-xr-x | dockd.sh | 11 | ||||
-rwxr-xr-x | i3blocks-cpuload.sh | 7 | ||||
-rwxr-xr-x | i3blocks-up.sh | 4 |
3 files changed, 12 insertions, 10 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 ;; diff --git a/i3blocks-cpuload.sh b/i3blocks-cpuload.sh index acd6eb0..226e224 100755 --- a/i3blocks-cpuload.sh +++ b/i3blocks-cpuload.sh @@ -9,10 +9,11 @@ cpu_count=$(sysctl -n hw.ncpu) avg_load=$(sysctl vm.loadavg | cut -w -f3) percent=$(echo "result = $avg_load / $cpu_count * 100; scale=0; result / 1" | bc -l) -mhz=$(sysctl -n dev.cpu.0.freq) -ghz=$(echo "result = $mhz / 1000; scale=1; result / 1" | bc -l) +#mhz=$(sysctl -n dev.cpu.0.freq) +#ghz=$(echo "result = $mhz / 1000; scale=1; result / 1" | bc -l) [ $percent -lt $low ] && printf $icon_low [ $percent -ge $low ] && [ $percent -lt $high ] && printf $icon_mid [ $percent -ge $high ] && printf $icon_high -printf "%s%% %s GHz\n" $percent $ghz +#printf "%s%% %s GHz\n" $percent $ghz +printf "%s%%\n" $percent diff --git a/i3blocks-up.sh b/i3blocks-up.sh index 52791a1..24db497 100755 --- a/i3blocks-up.sh +++ b/i3blocks-up.sh @@ -1,5 +1,3 @@ #!/bin/sh -icon= - doas freebsd-update updatesready > /dev/null -[ $? -eq 2 ] && printf "$icon%s\n" "$(uptime | grep -o 'up[^,]*')" || printf "%sUpdates are available" $icon +[ $? -ne 2 ] && printf "Updates are available" $icon |