dotfiles/home-manager/modules/xmonad/scripts/auxmenu.sh
MagicRB 05d186d304
Redo xmonad config, allows for new packages and LSP
Signed-off-by: MagicRB <richard@brezak.sk>
2023-10-03 16:54:07 +02:00

60 lines
1.6 KiB
Bash

export SUDO_ASKPASS=/home/main/.xmonad/runenv/libexec/x11-ssh-askpass
_options="toggle-mic\ntoggle-wifi\ntoggle-bluetooth\nscreenshot-all\nscreenshot-select\nscreenshot-focused\nsuspend\nreboot\nkexec\npoweroff\nlogout\nnmtui"
_option="$(echo -e $_options | emacs-rofi "command: " 90 30 | awk '{print $1}' | tr -d '\r\n')"
if [ ''${#_option} -gt 0 ]
then
case $_option in
toggle-mic)
wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
;;
toggle-wifi)
if [ "$(nmcli radio wifi)" = "enabled" ]
then
nmcli radio wifi off
else
nmcli radio wifi on
fi
;;
toggle-bluetooth)
if [ "$(nmcli radio wifi)" = "enabled" ]
then
nmcli radio wifi off
else
nmcli radio wifi on
fi
;;
screenshot-all)
screenshot screen
;;
screenshot-select)
screenshot select
;;
screenshot-focused)
screenshot focused
;;
suspend)
systemctl suspend
;;
reboot)
systemctl reboot
;;
poweroff)
systemctl poweroff
;;
kexec)
sudo -A kexec -l /run/current-system/kernel --initrd=/run/current-system/initrd --reuse-cmdline
systemctl kexec
;;
logout)
loginctl terminate-session $XDG_SESSION_ID
;;
nmtui)
alacritty -e nmtui
;;
*)
;;
esac
fi