Regenerated

This commit is contained in:
2026-04-29 10:02:21 +02:00
parent f8bf8f54f1
commit bca90e6f34
84 changed files with 5507 additions and 423 deletions
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
# --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
capacity=$(cat /sys/class/power_supply/BAT*/capacity)
status=$(cat /sys/class/power_supply/BAT*/status)
if [ "$status" != "Charging" ] && [ "$capacity" -lt 15 ]; then
echo " $capacity%"
else
echo ""
fi
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
bt_connected=""
while read -r _ mac name_rest; do
if [ "$(bluetoothctl info "$mac" | awk '/Connected:/ {print $2}')" = "yes" ]; then
bt_connected+="$name_rest\n"
fi
done < <(bluetoothctl devices)
# icon
if [ -n "$bt_connected" ]; then
icon=""
tooltip=$(printf "%b" "$bt_connected")
else
icon=""
tooltip="No devices connected"
fi
# ALWAYS produce valid JSON
printf '{"text": "%s", "tooltip": "%s"}\n' "$icon" "$tooltip"
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
# --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
# Get focused monitor name
focused_monitor=$(hyprctl monitors -j | jq -r '.[] | select(.focused==true) | .name')
monitor="${WAYBAR_OUTPUT_NAME:-$focused_monitor}"
# Hide if not focused monitor
if [ "$monitor" != "$focused_monitor" ]; then
jq -c -n '{text:"", class:"hidden"}'
exit 0
fi
# Get active workspace on this monitor
active_ws=$(hyprctl monitors -j | jq -r \
".[] | select(.name==\"$monitor\") | .activeWorkspace.id")
# Get clients
clients=$(hyprctl clients -j | jq -r \
".[] | select(.workspace.id==$active_ws) | \"\(.title)\"")
count=$(echo "$clients" | grep -c '\S')
# Hide if 0 or 1 clients — no point showing window switcher
if [ "$count" -le 1 ]; then
jq -c -n '{text:"", class:"hidden"}'
exit 0
fi
tooltip=$(echo "$clients" | sed 's/^/• /' | paste -sd '\n' -)
jq -c -n \
--arg text "$count" \
--arg tooltip "$tooltip" \
--arg class "active" \
'{text:$text, tooltip:$tooltip, class:$class}'
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
active_ws=$(hyprctl activeworkspace -j | jq -r '.id')
clients=$(hyprctl clients -j | jq -r \
".[] | select(.workspace.id==$active_ws) | \"\(.address)|\(.title)\"")
choice=$(echo "$clients" | cut -d'|' -f2 \
| wofi --dmenu \
--style ~/.config/wofi/style.css \
--allow-images=false \
--prompt "Active windows ...")
[ -z "$choice" ] && exit 0
addr=$(echo "$clients" | grep "|$choice" | head -n1 | cut -d'|' -f1)
hyprctl dispatch focuswindow address:"$addr"
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
DEVICE=$(kdeconnect-cli --list-devices | grep -oP '(?<=\().*?(?=\))' | head -n 1)
if [ -z "$DEVICE" ]; then
echo "No phone"
exit 0
fi
NAME=$(kdeconnect-cli -d "$DEVICE" --name 2>/dev/null)
BATTERY=$(kdeconnect-cli -d "$DEVICE" --battery 2>/dev/null | grep -o '[0-9]\+' | head -n 1)
if [ -z "$BATTERY" ]; then
echo "$NAME"
else
echo "$NAME $BATTERY%"
fi
+92
View File
@@ -0,0 +1,92 @@
#!/usr/bin/env bash
# --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
# Player selection — prefer actively playing player
player=$(playerctl -l 2>/dev/null | while read -r p; do
st=$(playerctl --player="$p" status 2>/dev/null)
[ "$st" = "Playing" ] && echo "$p" && break
done)
[ -z "$player" ] && player=$(playerctl -l 2>/dev/null | head -n1)
if [ -z "$player" ]; then
jq -c -n '{text: "", tooltip: "", class: "inactive"}'
exit 0
fi
status=$(playerctl --player="$player" status 2>/dev/null)
if [ "$status" != "Playing" ] && [ "$status" != "Paused" ]; then
jq -c -n '{text: "", tooltip: "", class: "inactive"}'
exit 0
fi
artist=$(playerctl --player="$player" metadata artist 2>/dev/null)
title=$(playerctl --player="$player" metadata title 2>/dev/null)
album=$(playerctl --player="$player" metadata album 2>/dev/null)
art=$(playerctl --player="$player" metadata mpris:artUrl 2>/dev/null)
length=$(playerctl --player="$player" metadata mpris:length 2>/dev/null)
position=$(playerctl --player="$player" position 2>/dev/null)
# Progress percentage — pure bash, no bc needed
if [ -n "$length" ] && [ -n "$position" ] && [ "$length" -gt 0 ] 2>/dev/null; then
pos_us=$(echo "$position" | awk '{printf "%d", $1 * 1000000}')
progress=$(( pos_us * 100 / length ))
else
progress=0
fi
# Spotify device
device=""
if [[ "$player" == *"spotify"* ]]; then
device=$(playerctl --player="$player" metadata xesam:url 2>/dev/null | grep -o 'device=[^&]*' | cut -d= -f2)
fi
# Icon
if [ "$status" = "Paused" ]; then
icon="⏸ "
else
icon="▶ "
fi
# Scrolling ticker
CACHE_FILE="/tmp/waybar_media_scroll_${player//\//_}"
full_text="${artist}${title}"
text_len=${#full_text}
display_len=30
# Reset scroll offset when track changes
TRACK_FILE="/tmp/waybar_media_track_${player//\//_}"
last_track=""
[ -f "$TRACK_FILE" ] && last_track=$(cat "$TRACK_FILE")
if [ "$full_text" != "$last_track" ]; then
echo "0" > "$CACHE_FILE"
echo "$full_text" > "$TRACK_FILE"
fi
if [ "$text_len" -le "$display_len" ]; then
text="$full_text"
else
offset=0
[ -f "$CACHE_FILE" ] && offset=$(cat "$CACHE_FILE")
padded="${full_text} ${full_text}"
text="${padded:$offset:$display_len}"
next_offset=$(( (offset + 1) % (text_len + 4) ))
echo "$next_offset" > "$CACHE_FILE"
fi
# Build tooltip
tooltip="Artist: ${artist}
Title: ${title}
Album: ${album}"
if [ -n "$device" ]; then
tooltip="${tooltip}
󰓻 ${device}"
fi
tooltip="${tooltip}"
jq -c -n \
--arg text "${icon}${text}" \
--arg tooltip "$tooltip" \
--arg class "$player" \
--arg art "$art" \
'{text: $text, tooltip: $tooltip, class: $class, alt: $art}'