aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpw-battery2
-rwxr-xr-xpw-cputemp2
-rwxr-xr-xpw-date33
-rwxr-xr-xpw-music2
-rwxr-xr-xpw-systemstats36
-rwxr-xr-xpw-update-fingerprint2
6 files changed, 56 insertions, 21 deletions
diff --git a/pw-battery b/pw-battery
index bce03cc..275ef28 100755
--- a/pw-battery
+++ b/pw-battery
@@ -54,5 +54,5 @@ for battery in /sys/class/power_supply/BAT?*; do
;;
esac
- echo -e "┊ $status $capacity%"
+ echo -e " $status $capacity% ┊"
done
diff --git a/pw-cputemp b/pw-cputemp
index eda3871..d2757bb 100755
--- a/pw-cputemp
+++ b/pw-cputemp
@@ -22,5 +22,5 @@ fi
[ -z "$CPU_TEMP" ] && CPU_TEMP="N/A"
# Send to bar
-echo -e " 🌡️ $CPU_TEMP°C ┊"
+echo -e "🌡️ $CPU_TEMP°C ┊"
diff --git a/pw-date b/pw-date
index 05b2998..9cbdbde 100755
--- a/pw-date
+++ b/pw-date
@@ -7,35 +7,34 @@
# pkill -RTMIN+1 dwmblocks
-echo -e "┊ $(date '+%a %d %b %T')"
+echo -e " $(date '+%a %d %b %T')"
case $BLOCK_BUTTON in
- 1)
- TODAY=$(date '+%-d')
- HEAD=$(cal | head -n1)
- BODY=$(cal | tail -n7 | sed -z "s|$TODAY|<u><b>$TODAY</b></u>|1")
-
- dunstify "$HEAD" "$BODY" \
- -i office-calendar-symbolic \
- -h string:x-canonical-private-synchronous:calendar \
- -u normal
- ;;
+ #1)
+ # TODAY=$(date '+%-d')
+ # HEAD=$(cal | head -n1)
+ # BODY=$(cal | tail -n7 | sed -z "s|$TODAY|<u><b>$TODAY</b></u>|1")
+ #
+ # dunstify "$HEAD" "$BODY" \
+ # -i office-calendar-symbolic \
+ # -h string:x-canonical-private-synchronous:calendar \
+ # -u normal
+ #;;
- 3)
+ 1)
# X220 screen is 1366x768
- width=300
- height=180
- X=$((1366-width))
- Y=24 # bar height
# toggle Orage on/off
pid=$(wmctrl -lp | awk '/Orage/{print $3}')
if (( pid > 0 )) ; then
kill -9 "$pid"
else
+ # this works but is slow, sleep + wmctrl is faster
+ #xdotool search --onlyvisible --sync --name "Orage" windowmove 1064 23 &
{ orage > /dev/null 2>&1; } &
- wmctrl -r "orage" -e "0,$X,$Y,$width,$height"
+ sleep 0.2
+ wmctrl -r "Orage" -e 0,1064,23,300,180
fi
;;
diff --git a/pw-music b/pw-music
index f0f9112..ea7a770 100755
--- a/pw-music
+++ b/pw-music
@@ -17,7 +17,7 @@ case $STATUS in
;;
*)
- curstatus=" Player Off ┊"
+ curstatus=" No Player ┊"
;;
esac
diff --git a/pw-systemstats b/pw-systemstats
new file mode 100755
index 0000000..0f5119d
--- /dev/null
+++ b/pw-systemstats
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+# requires joypixels font in dwm config.def.h
+
+CPU_TEMP=$(sensors | awk '
+ /^Tdie|^Package id|^Core 0|^CPU|^temp1/ {
+ gsub(/[+°C]/, "");
+ for (i=1; i<=NF; i++) {
+ if ($i ~ /^[0-9]+(\.[0-9]+)?$/) {
+ gsub(/\..*/, "", $i);
+ print $i;
+ exit;
+ }
+ }
+ }')
+
+# Debug CPU temperature detection, if not found, return N/A
+if [ -z "$CPU_TEMP" ]; then
+ # Try simpler pattern as fallback
+ CPU_TEMP=$(sensors | grep -E '^(Core 0|Package id 0|CPU)' | awk '{print $3}' | tr -d '+°C' | head -n1)
+fi
+
+[ -z "$CPU_TEMP" ] && CPU_TEMP="N/A"
+
+
+# Try different fan sensors
+FAN_SPEED=$(sensors | awk '/^fan|^cpu_fan/ {print $2}')
+[ -z "$FAN_SPEED" ] && FAN_SPEED="N/A"
+
+
+# Send to bar
+echo -e " 🌀 $FAN_SPEED ┊ 🌡️ $CPU_TEMP󰔄"
+
+# Clicking on bar
+case $BLOCK_BUTTONZ in
+ 1) notify-send "$(sensors)";;
+esac
diff --git a/pw-update-fingerprint b/pw-update-fingerprint
index 60239fb..29da793 100755
--- a/pw-update-fingerprint
+++ b/pw-update-fingerprint
@@ -13,4 +13,4 @@ KEY=$(msmtp --serverinfo --tls --tls-certcheck=off --host="$MAILSERVER" --port="
# replace tls_fingerprint line in .msmtprc
sed -i "s/^tls_fingerprint.*/tls_fingerprint $KEY/g" .msmtprc
-echo ".msmtprc has been updated with the latest mail.nagatha.fr fingerprint."
+echo ".msmtprc has been updated with the latest fingerprint."