feat: added powermenu
This commit is contained in:
+2
-1
@@ -4,7 +4,7 @@ configuration {
|
|||||||
scroll-method: 1;
|
scroll-method: 1;
|
||||||
show-icons: true;
|
show-icons: true;
|
||||||
sidebar-mode: true;
|
sidebar-mode: true;
|
||||||
modi: "drun,internet:~/.config/rofi/rofi-filter internet,dev:~/.config/rofi/rofi-filter dev,games:~/.config/rofi/rofi-filter games,system:~/.config/rofi/rofi-filter system,media:~/.config/rofi/rofi-filter media,notifications:~/.config/rofi/rofi-filter notifications,clipboard:~/.config/rofi/rofi-filter clipboard";
|
modi: "drun,internet:~/.config/rofi/rofi-filter internet,dev:~/.config/rofi/rofi-filter dev,games:~/.config/rofi/rofi-filter games,system:~/.config/rofi/rofi-filter system,media:~/.config/rofi/rofi-filter media,notifications:~/.config/rofi/rofi-filter notifications,clipboard:~/.config/rofi/rofi-filter clipboard,powermenu:~/.config/rofi/rofi-filter powermenu";
|
||||||
display-drun: "ALL";
|
display-drun: "ALL";
|
||||||
display-internet: "NET";
|
display-internet: "NET";
|
||||||
display-dev: "DEV";
|
display-dev: "DEV";
|
||||||
@@ -13,6 +13,7 @@ configuration {
|
|||||||
display-media: "MED";
|
display-media: "MED";
|
||||||
display-notifications: "NTF";
|
display-notifications: "NTF";
|
||||||
display-clipboard: "CLP";
|
display-clipboard: "CLP";
|
||||||
|
display-powermenu: "PWR";
|
||||||
kb-remove-to-eol: "";
|
kb-remove-to-eol: "";
|
||||||
kb-mode-complete: "";
|
kb-mode-complete: "";
|
||||||
kb-remove-char-back: "BackSpace,Shift+BackSpace";
|
kb-remove-char-back: "BackSpace,Shift+BackSpace";
|
||||||
|
|||||||
@@ -12,6 +12,14 @@ if [[ -n "$selection" ]]; then
|
|||||||
elif [[ "$mode" == "notifications" ]]; then
|
elif [[ "$mode" == "notifications" ]]; then
|
||||||
body="${selection#*— }"
|
body="${selection#*— }"
|
||||||
printf '%s' "$body" | wl-copy
|
printf '%s' "$body" | wl-copy
|
||||||
|
elif [[ "$mode" == "powermenu" ]]; then
|
||||||
|
case "$selection" in
|
||||||
|
"lock") swaylock ;;
|
||||||
|
"suspend") systemctl suspend ;;
|
||||||
|
"reboot") systemctl reboot ;;
|
||||||
|
"shutdown") systemctl poweroff ;;
|
||||||
|
"logout") loginctl terminate-session "${XDG_SESSION_ID-}" ;;
|
||||||
|
esac
|
||||||
else
|
else
|
||||||
target_app=$(grep -rl "^Name=${selection}\$" /usr/share/applications/*.desktop 2>/dev/null | head -n1)
|
target_app=$(grep -rl "^Name=${selection}\$" /usr/share/applications/*.desktop 2>/dev/null | head -n1)
|
||||||
if [[ -n "$target_app" ]]; then
|
if [[ -n "$target_app" ]]; then
|
||||||
@@ -72,4 +80,12 @@ case "$mode" in
|
|||||||
}
|
}
|
||||||
' /usr/share/applications/*.desktop 2>/dev/null
|
' /usr/share/applications/*.desktop 2>/dev/null
|
||||||
;;
|
;;
|
||||||
|
powermenu)
|
||||||
|
echo -e "\0markup-rows\x1ftrue"
|
||||||
|
printf '%s\n' "<span foreground=\"#88c0d0\"></span> lock"
|
||||||
|
printf '%s\n' "<span foreground=\"#5e81ac\"></span> suspend"
|
||||||
|
printf '%s\n' "<span foreground=\"#ebcb8b\"></span> reboot"
|
||||||
|
printf '%s\n' "<span foreground=\"#bf616a\">⏻</span> shutdown"
|
||||||
|
printf '%s\n' "<span foreground=\"#b48ead\"></span> logout"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user