mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-29 11:36:16 +01:00
60 lines
1.6 KiB
Bash
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
|