summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2021-01-01 11:03:23 -0500
committerAdam T. Carpenter <atc@53hor.net>2021-01-01 11:03:23 -0500
commit6aa3f3db5e3226f3b2774ff19c2fcc00185a3615 (patch)
treef64b096302ea9729f8fc3109e59674b3699184ad
parent8584c55f197b70ce66e8e214ad720a6b623ebfdb (diff)
downloadscripts-6aa3f3db5e3226f3b2774ff19c2fcc00185a3615.tar.xz
scripts-6aa3f3db5e3226f3b2774ff19c2fcc00185a3615.zip
added nvidia-settings to dockd for composition pipeline
-rwxr-xr-xdockd.sh11
-rwxr-xr-xi3blocks-cpuload.sh7
-rwxr-xr-xi3blocks-up.sh4
3 files changed, 12 insertions, 10 deletions
diff --git a/dockd.sh b/dockd.sh
index 62167f2..d74e6b3 100755
--- a/dockd.sh
+++ b/dockd.sh
@@ -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