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
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
# Get first CPU core temperature
TEMP=$(sensors | awk '/Core 0/ {print $3}' | tr -d '+°C')
# If temperature cannot be read
if [ -z "$TEMP" ]; then
echo "🌡 N/A"
exit 0
fi
# Convert to integer (truncate decimal)
TEMP_INT=${TEMP%.*}
# Color-coded emojis for cyberpunk style
if [ "$TEMP_INT" -lt 50 ]; then
EMOJI="🟢"
elif [ "$TEMP_INT" -lt 70 ]; then
EMOJI="🟡"
else
EMOJI="🔴"
fi
# Output with some flair
echo "$EMOJI $TEMP°C"
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
MAXLEN=25
STATUS=$(playerctl status 2>/dev/null) # playing, paused, stopped
TITLE=$(playerctl metadata title 2>/dev/null)
# Decide emoji based on status
if [ "$STATUS" = "Playing" ]; then
EMOJI="▶"
elif [ "$STATUS" = "Paused" ]; then
EMOJI="⏸"
else
EMOJI="⏹"
fi
# If no song
if [ -z "$TITLE" ]; then
echo "🕊️ Chillin'"
else
# Truncate if too long
if [ ${#TITLE} -gt $MAXLEN ]; then
TITLE="${TITLE:0:MAXLEN}"
fi
# Underline with Polybar formatting and show emoji
echo "%{+u}%{F#8be9fd}$EMOJI $TITLE%{-u}%{F-}"
fi
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
if iwgetid -r >/dev/null; then
SSID=$(iwgetid -r)
IP=$(hostname -I | awk '{print $1}')
echo "$SSID"
else
echo "❌ Disconnected"
fi
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
systemctl poweroff
+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%"