Initial Ubuntu i3wm dotfiles

This commit is contained in:
2026-01-29 23:19:44 +05:30
commit 75a6027f67
40 changed files with 2261 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Suppress locale-related float warnings
LC_NUMERIC=C
# Get default sink volume info safely
VOL_LINE=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ 2>/dev/null)
if [ -z "$VOL_LINE" ]; then
echo "🔇 No Sink"
exit 0
fi
# Extract volume (0.001.50 range) and convert to integer percent
VOL=$(echo "$VOL_LINE" | awk '{printf "%d", $2 * 100}')
# Check mute status
MUTE=$(echo "$VOL_LINE" | grep -q "MUTED" && echo yes || echo no)
# Sanitize volume
if [ -z "$VOL" ]; then VOL=0; fi
if [ "$VOL" -gt 150 ]; then VOL=150; fi
if [ "$MUTE" = "yes" ]; then VOL=0; fi
# Choose icon
if [ "$VOL" -eq 0 ]; then
EMOJI="🔇"
elif [ "$VOL" -le 30 ]; then
EMOJI="🔈"
elif [ "$VOL" -le 70 ]; then
EMOJI="🔉"
else
EMOJI="🔊"
fi
# Output
echo "$EMOJI $VOL%"