This repository has been archived on 2025-12-28. You can view files and clone it, but cannot push or open issues or pull requests.
inks-scripts/scripts/xmobar-status-vol

47 lines
705 B
Bash
Executable File

#!/bin/sh
base03=#002b36
base02=#073642
base01=#586e75
base00=#657b83
base0=#839496
base1=#93a1a1
base2=#eee8d5
base3=#fdf6e3
yellow=#b58900
orange=#cb4b16
red=#dc322f
magenta=#d33682
violet=#6c71c4
blue=#268bd2
cyan=#2aa198
green=#859900
color=$cyan
vol="$(pamixer --get-volume)"
if [ $(pamixer --get-mute) = true ]; then
vol=MUTE
color=$red
icon="" # fa-volume-off f026
echo "<fc=$color><fn=1>$icon </fn>$vol</fc>"
fi
if [ "$vol" -gt "100" ]; then
icon=""
color=$orange
elif [ "$vol" -gt "70" ]; then
icon=""
elif [ "$vol" -gt "30" ]; then
icon=""
elif [ "$vol" -gt "0" ]; then
icon=""
else
vol=MUTE
color=$red
icon=""
fi
echo "<fc=$color><fn=1>$icon </fn>$vol</fc>"