# 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 "killall swaybar" and $mod+Shift+c to reload the configuration. # Produces "21 days", for example uptime_formatted=$(uptime | cut -d ',' -f1 | cut -d ' ' -f4,5) # The abbreviated weekday (e.g., "Sat"), followed by the ISO-formatted date # like 2018-10-06 and the time (e.g., 14:01) #date_formatted=$(date "+%d-%m-%Y %I:%M:%S %p") date_formatted=$(date "+%Y-%m-%d %H:%M %p") # Returns the battery status: "Full", "Discharging", or "Charging". battery_status=$(cat /sys/class/power_supply/BAT0/status) # Returns the battery capacity: n% battery_capacity="$(cat /sys/class/power_supply/BAT0/capacity)%" # Volume vol="$(pamixer --get-volume)" unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)" echo $uptime vol-"$vol%" \| $date_formatted \| mail-$unread