ooknet/home/modules/desktop/wayland/windowManager/hyprland/pkgs/hyprkillsession.nix

17 lines
298 B
Nix

{ pkgs, ... }:
pkgs.writeShellApplication {
name = "hyprkillsession";
runtimeInputs = with pkgs; [ procps ];
text = ''
if pgrep -x Hyprland >/dev/null; then
hyprctl dispatch exit 0
sleep 2
if pgrep -x Hyprland >/dev/null; then
killall -9 Hyprland
fi
fi
'';
}