Minimal i3 setup

This commit is contained in:
Fabio Scotto di Santolo
2026-03-15 22:00:35 +01:00
parent 6e0f5eb83b
commit 34276c2de1
33 changed files with 1034 additions and 52 deletions

View File

@@ -0,0 +1,14 @@
#!/bin/sh
cur="$(brightnessctl g 2>/dev/null)"
max="$(brightnessctl m 2>/dev/null)"
[ -n "$cur" ] || exit 0
[ -n "$max" ] || exit 0
[ "$max" -gt 0 ] || exit 0
pct=$((100 * cur / max))
echo "BL ${pct}%"
echo "BL ${pct}%"
echo "#6daeea"

View File

@@ -0,0 +1,47 @@
#!/bin/sh
total_now=0
total_full=0
status=""
for bat in /sys/class/power_supply/BAT*; do
[ -d "$bat" ] || continue
if [ -r "$bat/energy_now" ] && [ -r "$bat/energy_full" ]; then
now=$(cat "$bat/energy_now")
full=$(cat "$bat/energy_full")
elif [ -r "$bat/charge_now" ] && [ -r "$bat/charge_full" ]; then
now=$(cat "$bat/charge_now")
full=$(cat "$bat/charge_full")
else
continue
fi
st=$(cat "$bat/status" 2>/dev/null)
total_now=$((total_now + now))
total_full=$((total_full + full))
case "$st" in
Charging) status="⚡" ;;
Discharging) [ -z "$status" ] && status="🔋" ;;
Full) [ -z "$status" ] && status="✔" ;;
esac
done
[ "$total_full" -gt 0 ] || exit 0
pct=$((100 * total_now / total_full))
[ -n "$status" ] || status="BAT"
text="$status $pct%"
if [ "$pct" -le 15 ]; then
color="#ff5555"
elif [ "$pct" -le 30 ]; then
color="#f1fa8c"
else
color="#9ece6a"
fi
printf '%s\n%s\n%s\n' "$text" "$text" "$color"

View File

@@ -0,0 +1,17 @@
#!/bin/sh
state="$(xset q 2>/dev/null)"
caps="$(printf '%s\n' "$state" | grep 'Caps Lock:' | awk '{print $4}')"
num="$(printf '%s\n' "$state" | grep 'Num Lock:' | awk '{print $8}')"
out=""
[ "$caps" = "on" ] && out="${out} CAPS"
[ "$num" = "on" ] && out="${out} NUM"
[ -n "$out" ] || exit 0
echo "$out"
echo "$out"
echo "#9a9a9a"

View File

@@ -0,0 +1,19 @@
#!/bin/sh
mem=$(free | awk '/^Mem:/ {print $3/$2 * 100.0}')
mem=${mem%.*}
if [ "$mem" -ge 90 ]; then
color="#c7162b"
elif [ "$mem" -ge 70 ]; then
color="#e95420"
else
color="#d0d0d0"
fi
used=$(free -h | awk '/^Mem:/ {print $3}')
total=$(free -h | awk '/^Mem:/ {print $2}')
echo "RAM $used/$total"
echo "RAM $used/$total"
echo "$color"

View File

@@ -0,0 +1,18 @@
#!/bin/sh
t=$(cat /sys/class/thermal/thermal_zone0/temp 2>/dev/null)
[ -n "$t" ] || exit 0
temp=$((t / 1000))
if [ "$temp" -ge 85 ]; then
color="#c7162b"
elif [ "$temp" -ge 70 ]; then
color="#e95420"
else
color="#d0d0d0"
fi
echo "CPU ${temp}°C"
echo "CPU ${temp}°C"
echo "$color"

View File

@@ -0,0 +1,16 @@
#!/bin/sh
mute=$(pactl get-sink-mute @DEFAULT_SINK@ 2>/dev/null | awk '{print $2}')
vol=$(pactl get-sink-volume @DEFAULT_SINK@ 2>/dev/null | awk '/Volume:/ {print $5; exit}')
[ -n "$vol" ] || exit 0
if [ "$mute" = "yes" ]; then
text="VOL mute"
color="#7aa2f7"
else
text="VOL $vol"
color="#c0caf5"
fi
printf '%s\n%s\n%s\n' "$text" "$text" "$color"

View File

@@ -0,0 +1,9 @@
#!/bin/sh
ssid=$(nmcli -t -f active,ssid dev wifi | awk -F: '$1=="yes"{print $2}')
[ -n "$ssid" ] || exit 0
echo "WIFI $ssid"
echo "WIFI $ssid"
echo "#4a90d9"