mirror of
https://github.com/Manoj-HV30/i3wm-ubuntu-dotfiles.git
synced 2026-05-16 19:35:23 +00:00
Initial Ubuntu i3wm dotfiles
This commit is contained in:
Executable
+26
@@ -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"
|
||||
|
||||
Executable
+27
@@ -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
|
||||
|
||||
Executable
+10
@@ -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
|
||||
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
systemctl poweroff
|
||||
|
||||
Executable
+37
@@ -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.00–1.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%"
|
||||
|
||||
Reference in New Issue
Block a user