Add middlelayer to select corrent logout method per desktop environment
This commit is contained in:
parent
5d17437fc9
commit
3614eb1353
|
@ -1,9 +1,10 @@
|
|||
{pkgs, ...}: let
|
||||
logout-utility = pkgs.writeShellScriptBin "logout-utility" (builtins.readFile ./scripts/logout-utility);
|
||||
powermenu = pkgs.writeShellScriptBin "powermenu" (builtins.readFile ./scripts/powermenu);
|
||||
power-profiles = pkgs.writeShellScriptBin "power-profiles" (builtins.readFile ./scripts/power-profiles);
|
||||
in {
|
||||
imports = [../gui/foot.nix ./gtk.nix];
|
||||
home.packages = [powermenu power-profiles];
|
||||
home.packages = [logout-utility powermenu power-profiles];
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
location = "center";
|
||||
|
|
9
home/desktop/scripts/logout-utility
Normal file
9
home/desktop/scripts/logout-utility
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if [[ "$XDG_CURRENT_DESKTOP" == "Hyprland" ]]; then
|
||||
hyprctl dispatch exit
|
||||
elif [[ "$XDG_CURRENT_DESKTOP" == "sway" ]]; then
|
||||
swaymsg exit
|
||||
else
|
||||
echo "Unsupported desktop environment $XDG_CURRENT_DESKTOP"
|
||||
fi
|
|
@ -118,7 +118,7 @@ menu=(
|
|||
[ Suspend]="systemctl suspend"
|
||||
[ Hibernate]="systemctl hibernate"
|
||||
[ Lock]="hyprctl dispatch exec swaylock"
|
||||
[ Logout]="hyprctl dispatch exit"
|
||||
[ Logout]="logout-utility"
|
||||
[ Cancel]=""
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue