лучше не лезьте

This commit is contained in:
2024-09-22 19:29:25 +04:00
parent 94e0023367
commit de3262e579
27 changed files with 1305 additions and 421 deletions

54
rofi/volume/launch.sh Executable file
View File

@@ -0,0 +1,54 @@
#!/usr/bin/env bash
theme_path="$HOME/.config/rofi/volume/volume_menu.rasi"
volume=''
microphone=''
pavucontrol=''
rofi_cmd() {
rofi -theme "$theme_path" -dmenu -markup-rows
}
# Microphone Info
amixer get Capture | grep '\[on\]' &>/dev/null
if [[ "$?" == 0 ]]; then
microphone=''
else
microphone=''
fi
# Microphone Info
amixer get Master | grep '\[on\]' &>/dev/null
if [[ "$?" == 0 ]]; then
volume=''
else
volume=''
fi
run_cmd() {
if [[ "$1" == '--opt1' ]]; then
amixer set Master toggle
elif [[ "$1" == '--opt2' ]]; then
amixer set Capture toggle
elif [[ "$1" == '--opt3' ]]; then
exec pavucontrol
fi
}
run() {
echo -e "$volume\n$microphone\n$pavucontrol" | rofi_cmd
}
chosen="$(run)"
case ${chosen} in
$volume)
run_cmd --opt1
;;
$microphone)
run_cmd --opt2
;;
$pavucontrol)
run_cmd --opt3
;;
esac