fix reloading notif

This commit is contained in:
jacekpoz 2024-03-02 16:11:36 +01:00
parent 1079989183
commit 9ee8028e9b
No known key found for this signature in database
GPG key ID: 94E812A8B12AAE3C

View file

@ -14,6 +14,24 @@
hyprcontrib = inputs.hyprcontrib.packages.${pkgs.system};
inherit (inputs.shadower.packages.${pkgs.system}) shadower;
inherit (inputs.hyprland.packages.${pkgs.system}) hyprland;
# https://wiki.hyprland.org/IPC/#how-to-use-socket2-with-bash
handle_hyprland_events = pkgs.writeShellScriptBin "handle_hyprland_events" ''
#!/bin/sh
handle() {
case $1 in
configreloaded*)
${hyprland}/bin/hyprctl notify 1 2500 "" " Reloading Hyprland..."
;;
esac
}
${pkgs.socat}/bin/socat -U - UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock |
while read -r line; do
handle "$line"
done
'';
in {
options.myOptions.programs.hyprland = {
enable = mkEnableOption "enable hiper ląd";
@ -289,7 +307,7 @@ in {
"$mainMod SHIFT, S, exec, ${hyprcontrib.grimblast}/bin/grimblast save area - | ${shadower}/bin/shadower | ${pkgs.coreutils-full}/bin/tee \"$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/$(date +'screenshot-%Y%m%d%H%M%S.png')\" | ${wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send \"Screenshot taken (shadower)\""
"$mainMod CONTROL, S, exec, ${hyprcontrib.grimblast}/bin/grimblast save area - | ${pkgs.swappy}/bin/swappy -f - -o - | ${pkgs.coreutils-full}/bin/tee \"$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/$(date +'screenshot-%Y%m%d%H%M%S.png')\" | ${wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send \"Screenshot taken\""
"$mainMod SHIFT CONTROL, S, exec, ${hyprcontrib.grimblast}/bin/grimblast save area - | ${pkgs.swappy}/bin/swappy -f - -o - | ${shadower}/bin/shadower | ${pkgs.coreutils-full}/bin/tee \"$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/$(date +'screenshot-%Y%m%d%H%M%S.png')\" | ${wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send \"Screenshot taken (shadower)\""
"$mainMod SHIFT, R, exec, ${hyprland}/bin/hyprctl notify 1 2500 '' ' Reloading Hyprland...' && ${hyprland}/bin/hyprctl reload"
"$mainMod SHIFT, R, exec, ${hyprland}/bin/hyprctl reload"
", XF86Launch3, exec, ${pkgs.asusctl}/bin/asusctl led-mode -n"
", XF86Launch4, exec, ${pkgs.asusctl}/bin/asusctl profile -n"
@ -393,6 +411,7 @@ in {
"${pkgs.systemd}/bin/systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"${pkgs.dbus}/bin/dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=$XDG_CURRENT_DESKTOP"
"rot8"
"${handle_hyprland_events}/bin/handle_hyprland_events"
];
exec = [