#! /usr/bin/sh recordings=$(pgrep wf-recorder | wc -l) if [ "${recordings}" = "0" ]; then recs="" else recs="đŸ“Ŋ${recordings}" fi touchpad=$(swaymsg -t get_inputs | jq -r '[.[] | select(.type == "touchpad")][0] | .libinput.send_events') if [ "${touchpad}" = "enabled" ]; then touchpad_active="✅" else touchpad_active="❎" fi today=$(date +'%Y-%m-%d') now=$(date +'%H:%M:%S') hour=$(echo "${now}" | cut -d: -f1 -) minute=$(echo "${now}" | cut -d: -f2 -) if [ "${minute}" \< "30" ]; then case "${hour}" in "00"|"12") clock_face="🕛";; "01"|"13") clock_face="🕐";; "02"|"14") clock_face="🕑";; "03"|"15") clock_face="🕒";; "04"|"16") clock_face="🕓";; "05"|"17") clock_face="🕔";; "06"|"18") clock_face="🕕";; "07"|"19") clock_face="🕖";; "08"|"20") clock_face="🕗";; "09"|"21") clock_face="🕘";; "10"|"22") clock_face="🕙";; "11"|"23") clock_face="🕚";; esac else case "${hour}" in "00"|"12") clock_face="🕧";; "01"|"13") clock_face="🕜";; "02"|"14") clock_face="🕝";; "03"|"15") clock_face="🕞";; "04"|"16") clock_face="🕟";; "05"|"17") clock_face="🕠";; "06"|"18") clock_face="🕡";; "07"|"19") clock_face="đŸ•ĸ";; "08"|"20") clock_face="đŸ•Ŗ";; "09"|"21") clock_face="🕤";; "10"|"22") clock_face="đŸ•Ĩ";; "11"|"23") clock_face="đŸ•Ļ";; esac fi 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/class/power_supply/BAT0/capacity) battery_state=$(cat /sys/class/power_supply/BAT0/status) case "${battery_state}" in "Charging"|"Full"|"Not charging") battery_symbol="🔌" ;; "Discharging") if [ "${battery}" -lt 20 ]; then battery_symbol="đŸĒĢ" else battery_symbol="🔋" fi ;; *) battery_symbol="❔" ;; esac echo ${recs} đŸ•šī¸${touchpad_active} 📆${today} ${clock_face}${now} ${audio_symbol}${audio_volume}% ${battery_symbol}${battery}%