Major Update: created v5 (switching from x11 to wayland). Changed polybar to waybar in this commit.

This commit is contained in:
Keyitdev
2026-05-31 11:55:07 +02:00
parent b018c5edd3
commit 91723206b1
9 changed files with 689 additions and 695 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/bin/sh
LOG_FILE="$HOME/.system_stats.json"
today=$(date +%Y-%m-%d)
if [ ! -f "$LOG_FILE" ]; then
echo "0s"
exit 0
fi
total_seconds=$(jq -r ".\"$today\".screen.turned_on_s // 0" "$LOG_FILE")
if [ "$total_seconds" -eq 0 ]; then
echo "0s"
exit 0
fi
h=$(( total_seconds / 3600 ))
m=$(( (total_seconds % 3600) / 60 ))
s=$(( total_seconds % 60 ))
output=""
[ "$h" -gt 0 ] && output="${h}h "
[ "$m" -ge 0 ] && output="${output}${m}m "
# [ "$s" -gt 0 ] || [ -z "$output" ] && output="${output}${s}s"
echo "$output" | sed 's/ $//'