Add more details to the status bar
This commit is contained in:
parent
c917476f21
commit
67a552bd04
1 changed files with 27 additions and 3 deletions
|
|
@ -1,6 +1,30 @@
|
|||
#! /usr/bin/sh
|
||||
|
||||
battery=$(cat /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0/capacity)
|
||||
now=$(date +'%Y-%m-%d %H:%M:%S')
|
||||
today=$(date +'%Y-%m-%d')
|
||||
now=$(date +'%H:%M:%S')
|
||||
|
||||
echo ${now} 🔋${battery}%
|
||||
audio_mute=$(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}')
|
||||
audio_volume=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -o '[0-9]\+%' | head -n 1 | tr -d %)
|
||||
audio_symbol="❔"
|
||||
if [ "${audio_mute}" = "yes" ]; then
|
||||
audio_symbol="🔇"
|
||||
elif [ "${audio_mute}" = "no" ]; then
|
||||
if [ "${audio_volume}" = "0" ]; then
|
||||
audio_symbol="🔈"
|
||||
elif [ "${audio_volume}" -lt 50 ]; then
|
||||
audio_symbol="🔉"
|
||||
else
|
||||
audio_symbol="🔊"
|
||||
fi
|
||||
fi
|
||||
|
||||
battery=$(cat /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0/capacity)
|
||||
battery_state=$(cat /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0/status)
|
||||
battery_symbol="❔"
|
||||
if [ "${battery_state}" = "Charging" ]; then
|
||||
battery_symbol="🗲"
|
||||
elif [ "${battery_state}" = "Discharging" ]; then
|
||||
battery_symbol="🔋"
|
||||
fi
|
||||
|
||||
echo 📆${today} ⏲${now} ${audio_symbol}${audio_volume}% ${battery_symbol}${battery}%
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue