all repos

dotfiles @ 76014299e8bb689d708c1d868b613a485c54bc59

i use rach linux btw
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
···
                
                1
                +#!/bin/env bash

              
                
                2
                +

              
                
                3
                +entries="⇠ logout\n⏾ suspend\n⭮ reboot\n⏻ poweroff"

              
                
                4
                +selected=$(echo -e "$entries" |

              
                
                5
                +	wofi --dmenu --cache-file /dev/null |

              
                
                6
                +	awk '{print tolower($2)}')

              
                
                7
                +

              
                
                8
                +shall_continue() {

              
                
                9
                +	entries="Yes\nNo"

              
                
                10
                +	selected=$(echo -e "$entries" |

              
                
                11
                +		wofi --dmenu --cache-file /dev/null |

              
                
                12
                +		awk '{print tolower($1)}')

              
                
                13
                +

              
                
                14
                +	case $selected in

              
                
                15
                +	yes) exec "$@" ;;

              
                
                16
                +	no) exit 0 ;;

              
                
                17
                +	esac

              
                
                18
                +}

              
                
                19
                +

              
                
                20
                +case $selected in

              
                
                21
                +logout) shall_continue hyprctl dispatch exit ;;

              
                
                22
                +suspend) shall_continue systemctl suspend ;;

              
                
                23
                +rebbot) shall_continue systemctl reboot ;;

              
                
                24
                +poweroff) shall_continue systemctl poweroff ;;

              
                
                25
                +esac