Upgrade system menu features
This commit is contained in:
parent
cf73e8a8ed
commit
a502b72299
@ -22,7 +22,7 @@ if (( "${?}" != 0 )); then
|
|||||||
fi
|
fi
|
||||||
local selected_id="$(echo "${choice}" | grep -Eo '^[0-9]+')"
|
local selected_id="$(echo "${choice}" | grep -Eo '^[0-9]+')"
|
||||||
pactl set-default-sink "${selected_id}"
|
pactl set-default-sink "${selected_id}"
|
||||||
local selected_name=$(echo "${choice}" \
|
local selected_name="$(echo "${choice}" \
|
||||||
| cut -c "$(("${#selected_id}" + 3))-" \
|
| cut -c "$(("${#selected_id}" + 3))-" \
|
||||||
| grep -Po '^.+(?= \()')
|
| grep -Po '^.+(?= \()')"
|
||||||
notify-send 'Output Device' "${selected_name} (${selected_id})"
|
notify-send 'Output Device' "${selected_name} (${selected_id})"
|
20
system-menu/system-menu.sh
Executable file
20
system-menu/system-menu.sh
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
local scripts_dir="$(dirname "$(realpath "${0}")")"
|
||||||
|
choice="$(fuzzel --index -d <<'EOF'
|
||||||
|
Select system sound output
|
||||||
|
Power settings (restart and shutdown)
|
||||||
|
EOF
|
||||||
|
)"
|
||||||
|
|
||||||
|
(( ${?} != 0 )) && exit
|
||||||
|
|
||||||
|
echo $choice
|
||||||
|
case "${choice}" in
|
||||||
|
0)
|
||||||
|
"${scripts_dir}/select-sound-output.sh"
|
||||||
|
;;
|
||||||
|
1)
|
||||||
|
"${scripts_dir}/system-power-menu.sh"
|
||||||
|
;;
|
||||||
|
esac
|
17
system-menu/system-power-menu.sh
Executable file
17
system-menu/system-power-menu.sh
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
choice="$(fuzzel --index -d <<'EOF'
|
||||||
|
Shutdown
|
||||||
|
Restart
|
||||||
|
EOF
|
||||||
|
)"
|
||||||
|
|
||||||
|
(( ${?} != 0 )) && exit
|
||||||
|
case "${choice}" in
|
||||||
|
0)
|
||||||
|
poweroff
|
||||||
|
;;
|
||||||
|
1)
|
||||||
|
restart
|
||||||
|
;;
|
||||||
|
esac
|
Loading…
Reference in New Issue
Block a user