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
|
{pkgs, ...}: let
|
||||||
|
logout-utility = pkgs.writeShellScriptBin "logout-utility" (builtins.readFile ./scripts/logout-utility);
|
||||||
powermenu = pkgs.writeShellScriptBin "powermenu" (builtins.readFile ./scripts/powermenu);
|
powermenu = pkgs.writeShellScriptBin "powermenu" (builtins.readFile ./scripts/powermenu);
|
||||||
power-profiles = pkgs.writeShellScriptBin "power-profiles" (builtins.readFile ./scripts/power-profiles);
|
power-profiles = pkgs.writeShellScriptBin "power-profiles" (builtins.readFile ./scripts/power-profiles);
|
||||||
in {
|
in {
|
||||||
imports = [../gui/foot.nix ./gtk.nix];
|
imports = [../gui/foot.nix ./gtk.nix];
|
||||||
home.packages = [powermenu power-profiles];
|
home.packages = [logout-utility powermenu power-profiles];
|
||||||
programs.rofi = {
|
programs.rofi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
location = "center";
|
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"
|
[ Suspend]="systemctl suspend"
|
||||||
[ Hibernate]="systemctl hibernate"
|
[ Hibernate]="systemctl hibernate"
|
||||||
[ Lock]="hyprctl dispatch exec swaylock"
|
[ Lock]="hyprctl dispatch exec swaylock"
|
||||||
[ Logout]="hyprctl dispatch exit"
|
[ Logout]="logout-utility"
|
||||||
[ Cancel]=""
|
[ Cancel]=""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue