Re-Organize Dotfiles into Separate Stow Packages
This commit is contained in:
60
pactl/.scripts/pactl.sh
Executable file
60
pactl/.scripts/pactl.sh
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env bash
|
||||
help_menu() {
|
||||
echo "Script to interact with pactl. Use only one argument at a time."
|
||||
# echo " - Play / Pause: playerctl.sh --play-pause"
|
||||
# echo " - Next: playerctl.sh --next"
|
||||
# echo " - Previous: playerctl.sh --prev"
|
||||
# echo " - Change Player: playerctl.sh --change"
|
||||
# echo " - Rofi Menu: playerctl.sh --rofi"
|
||||
# echo " - Help: playerctl.sh --help OR playerctl.sh -h"
|
||||
}
|
||||
|
||||
rofi_menu() {
|
||||
declare -a options=(
|
||||
" Raise Volume - raise"
|
||||
" Lower Volume - lower"
|
||||
" Mute - mute"
|
||||
" Mixer - mixer"
|
||||
" Back - back"
|
||||
" Quit - quit"
|
||||
)
|
||||
|
||||
choice=$(printf '%s\n' "${options[@]}" | rofi -dmenu -i)
|
||||
option=$(printf '%s\n' "${choice}" | awk '{print $NF}')
|
||||
|
||||
if [[ "$option" == "quit" ]]; then
|
||||
pkill rofi
|
||||
elif [[ "$option" != "back" ]]; then
|
||||
main "--$option" && main "--rofi"
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
if [ $# -eq 0 ]; then
|
||||
# No arguments
|
||||
help_menu
|
||||
else
|
||||
case $1 in
|
||||
--help | -h)
|
||||
help_menu
|
||||
;;
|
||||
--raise)
|
||||
pactl set-sink-volume @DEFAULT_SINK@ +5%
|
||||
;;
|
||||
--lower)
|
||||
pactl set-sink-volume @DEFAULT_SINK@ -5%
|
||||
;;
|
||||
--mute)
|
||||
pactl set-sink-mute @DEFAULT_SINK@ toggle
|
||||
;;
|
||||
--mixer)
|
||||
pavucontrol
|
||||
;;
|
||||
--rofi)
|
||||
rofi_menu
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
main $@
|
Reference in New Issue
Block a user