Sway-config/.config/sway/status.sh

32 lines
765 B
Bash
Raw Permalink Normal View History

2023-03-23 21:02:11 +01:00
# The Sway configuration file in ~/.config/sway/config calls this script.
# You should see changes to the status bar after saving this script.
# If not, do $mod+Shift+c to reload the configuration.
date_formatted=$(date "+%a %d.%m.%Y %H:%M")
2023-12-08 13:08:47 +01:00
audio=$(
2023-11-20 13:33:50 +01:00
wpctl get-volume @DEFAULT_SINK@ |
2023-12-08 13:08:47 +01:00
awk '{
print $2
print $3=="[MUTED]" ? "🔇":"🔉" }')
2023-03-25 19:19:50 +01:00
is_wayland=$(
swaymsg -t get_tree |
awk '
/focused": true/,/shell/ {
if($1 == "\"shell\":") print $2=="\"xdg_shell\"," ? "wayland ✔":"✘wayland"
}
')
2023-09-24 21:41:34 +02:00
battery=$(
acpi -b |
awk '{
print $4+0 "%"
if($3=="Charging,") print "🔌";
print ($4+0>25) ? "🔋" : "🪫";
}')
output=""
if [[ $is_wayland != "" ]]; then output="$is_wayland | "; fi
2023-12-08 13:08:47 +01:00
echo $output $battery "|" $audio "|" $date_formatted