diff options
| -rwxr-xr-x | .scripts/i3wifi | 14 | ||||
| -rwxr-xr-x | .scripts/lmc | 47 |
2 files changed, 42 insertions, 19 deletions
diff --git a/.scripts/i3wifi b/.scripts/i3wifi index 3fe5fb0..b9f79ec 100755 --- a/.scripts/i3wifi +++ b/.scripts/i3wifi @@ -8,18 +8,18 @@ INTERFACE="${BLOCK_INSTANCE:-wlan0}" [[ "$(cat /sys/class/net/$INTERFACE/operstate)" = 'down' ]] && echo 📡 && exit -QUALITY=$(grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70) }') +QUALITY=$(grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70 - 1) }') echo 📶 $QUALITY% echo 📶 $QUALITY% # color if [[ $QUALITY -ge 80 ]]; then - echo "#00FF00" -elif [[ $QUALITY -lt 80 ]]; then - echo "#FFF600" -elif [[ $QUALITY -lt 60 ]]; then - echo "#FFAE00" + echo "#00FF00" elif [[ $QUALITY -lt 40 ]]; then - echo "#FF0000" + echo "#FF0000" +elif [[ $QUALITY -lt 60 ]]; then + echo "#FF8000" +elif [[ $QUALITY -lt 80 ]]; then + echo "#FFF600" fi diff --git a/.scripts/lmc b/.scripts/lmc index f506e9a..9c92f3f 100755 --- a/.scripts/lmc +++ b/.scripts/lmc @@ -3,18 +3,41 @@ # A general audio interface for LARBS. newvol="pkill -RTMIN+10 i3blocks" -# Uncomment if i3mpdupdate isn't running: + +[ -z "$2" ] && num="2" || num="$2" case "$1" in - "up") pulsemixer --change-volume +"$2" ; $newvol ;; - "down") pulsemixer --change-volume -"$2" ; $newvol ;; - "mute") pulsemixer --toggle-mute ; $newvol ;; - "truemute") pulsemixer --mute ; $newvol ;; - "toggle") mpc toggle ;; - "pause") mpc pause ; pauseallmpv ;; - "forward") mpc seek +"$2" ;; - "back") mpc seek -"$2" ;; - "next") mpc next ;; - "prev") mpc prev ;; - "replay") mpc seek 0% ;; + u*) pulsemixer --change-volume +"$num" ; $newvol ;; + d*) pulsemixer --change-volume -"$num" ; $newvol ;; + m*) pulsemixer --toggle-mute ; $newvol ;; + truemute) pulsemixer --mute ; $newvol ;; + play) mpc play ;; + n*) mpc next ;; + prev) mpc prev ;; + t*) mpc toggle ;; + p*) mpc pause ; pauseallmpv ;; + f*) mpc seek +"$num" ;; + b*) mpc seek -"$num" ;; + r*) mpc seek 0\% ;; + *) cat << EOF +lmc: cli music interface for mpd and pulse for those with divine intellect too +grand to remember the mpc/pamixer commands. + +Allowed options: + up NUM Increase volume (2 secs default) + down NUM Decrease volume (2 secs default) + mute Toggle mute + truemute Mute + next Next track + prev Previous track + toggle Toggle pause + truepause Pause + foward NUM Seek foward in song (2 secs default) + back NUM Seek back in song (2 secs default) + restart Restart current song + all else Print this message + +All of these commands, except for \`truemute\`, \`prev\` and \`play\` can be truncated, +i.e. \`lmc r\` for \`lmc restart\`. +EOF esac |
