Back (Current repo: dotfiles)

my dotfiles to make it easy to transfer my settings
To clone this repository:
git clone https://git.viktor1993.net/dotfiles.git
Log | Download | Files | Refs

volume (384B)


#!/bin/bash

#technically, this is the volume for the left speaker, but if the left and right speaker are toggled together
#then this is OK.

IS_TOGGLED_OFF=$(amixer -D pulse get Master | grep -Ec '\[off\]')

if [[ "$IS_TOGGLED_OFF" -eq 0 ]]; then
    MASTER_VOLUME=$(amixer -D pulse get Master | grep -Eo -m1  '[0-9]{1,3}%')
else
    MASTER_VOLUME="muted"
fi   

echo $MASTER_VOLUME