updated monocle bar and added wayshell framework with some modules.

This commit is contained in:
2026-06-27 17:35:39 +02:00
parent 79b45ab123
commit 66065960cf
43 changed files with 2163 additions and 97 deletions
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
BAR_WIDTH=20
get_brightness() {
brightnessctl -m 2>/dev/null | cut -d, -f4 | tr -d '%'
}
render_bar() {
local pct=$1
local filled=$(( pct * BAR_WIDTH / 100 ))
local empty=$(( BAR_WIDTH - filled ))
local text="▲"
for ((i=0; i<filled; i++)); do text+=$'\n'"█"; done
for ((i=0; i<empty; i++)); do text+=$'\n'"░"; done
text+=$'\n'"▼"
echo "$text"
}
pct=$(get_brightness)
[[ -z "$pct" ]] && pct=0
bar=$(render_bar "$pct")
# Escape newlines for JSON
escaped=$(printf '%s' "$bar" | awk '{if(NR>1)printf "\\n"; printf "%s", $0}')
printf '{"text":"%s","class":"brightness","percentage":%d,"alt":"%d%%"}\n' "$escaped" "$pct" "$pct"