all repos

dotfiles @ 7601429

my dotfiles
1 files changed, 25 insertions(+), 0 deletions(-)
add power menu for hyprland using wofi
Author: Smirnov Oleksandr ss2316544@gmail.com
Committed at: 2023-11-08 15:16:56 +0200
Parent: e815923
A bin/wofi-power-menu

@@ -0,0 +1,25 @@

+#!/bin/env bash + +entries="⇠ logout\n⏾ suspend\n⭮ reboot\n⏻ poweroff" +selected=$(echo -e "$entries" | + wofi --dmenu --cache-file /dev/null | + awk '{print tolower($2)}') + +shall_continue() { + entries="Yes\nNo" + selected=$(echo -e "$entries" | + wofi --dmenu --cache-file /dev/null | + awk '{print tolower($1)}') + + case $selected in + yes) exec "$@" ;; + no) exit 0 ;; + esac +} + +case $selected in +logout) shall_continue hyprctl dispatch exit ;; +suspend) shall_continue systemctl suspend ;; +rebbot) shall_continue systemctl reboot ;; +poweroff) shall_continue systemctl poweroff ;; +esac