From 738876420465d59c671c80fc13d5e6f963da2c38 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sun, 5 Jun 2022 17:27:54 +0200 Subject: [PATCH] Added volume function --- config/zshrc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/config/zshrc b/config/zshrc index ed6b0b0..afad9ba 100644 --- a/config/zshrc +++ b/config/zshrc @@ -100,6 +100,26 @@ alias resblue='systemctl restart bluetooth' alias Personal='cd ~/Documents/synchronisatie/Personal/_PERSOONLIJK/' alias UGent='cd ~/Documents/synchronisatie/UGent/Informatica\ J1\ 2021-2022/' +vol () { + + if [[ $# == 0 ]] ; then + echo "Volume: $(pamixer --get-volume-human)" + elif [[ "$1" =~ ^[0-9]*$ ]] ; then + pamixer --set-volume "${1}" + vol + elif [[ "$1" =~ ^[+] ]] ; then + pamixer -i "${1#\+}" + vol + elif [[ "$1" =~ ^- ]] ; then + pamixer -d "${1#-}" + vol + elif [[ "$1" =~ m ]] ; then + pamixer --toggle + vol + fi + +} + cpdir () { # Check arguments