From: Christian Heller Date: Tue, 18 Mar 2025 00:08:09 +0000 (+0100) Subject: Improve status script; X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/%7B%7Bdb.prefix%7D%7D/add_task?a=commitdiff_plain;p=config Improve status script; --- diff --git a/testing/home/t490s/.nonpath_bins/status.sh b/testing/home/t490s/.nonpath_bins/status.sh index a1b965e..ee2e226 100755 --- a/testing/home/t490s/.nonpath_bins/status.sh +++ b/testing/home/t490s/.nonpath_bins/status.sh @@ -54,7 +54,7 @@ print_battery() { elif [ "${CHARGE}" -lt 65 ]; then COLOR="${COL_YELLOW}" fi - print_bar_block "${CHARGE}" "${COLOR}" 0 + print_bar_block "${CHARGE}%" "${COLOR}" 0 COLOR="${COL_WHITE}" STATUS=$(cat "${BAT_DIR}/status") @@ -70,7 +70,7 @@ print_battery() { fi print_bar_block "${CHARGING}" "${COLOR}" 0 - print_bar_block "$(calc_percent full full_design)" + print_bar_block "$(calc_percent full full_design)%" } print_temperature() { @@ -95,6 +95,15 @@ print_datetime() { print_bar_block "${TZ}" "" } +print_volume() { + MUTE=M + if [ "$(pactl get-sink-mute 0)" = "Mute: no" ]; then + MUTE= + COLOR="${COL_WHITE}" + fi + print_bar_block "v:${MUTE}$(pactl get-sink-volume 0 | head -1 | cut -d' ' -f5)" "${COLOR}" +} + print_keyboard() { LAYOUT=$(swaymsg -t get_inputs | grep 'xkb_active_layout_name' | sed -E 's/[ ,"]+//g' | cut -d':' -f2 | head -1) if [ "${LAYOUT}" = "English(US)" ]; then @@ -114,6 +123,7 @@ while true; do print_battery print_temperature print_datetime + print_volume print_keyboard printf '],' sleep 0.1