From d7e51d1ba54c74ca1bde9b22f83bfaeb8e7d6a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Thu, 13 Aug 2026 13:05:40 +0200 Subject: [PATCH] hyprland migrate exec-once to hl.exec_cmd --- modules/applications/hyprland.nix | 47 +++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/modules/applications/hyprland.nix b/modules/applications/hyprland.nix index fb5d469..311360c 100644 --- a/modules/applications/hyprland.nix +++ b/modules/applications/hyprland.nix @@ -37,12 +37,20 @@ # Enable the X11 windowing system. services.xserver.enable = true; }; - flake.homeModules.hyprland-laptop = _: { + flake.homeModules.hyprland-laptop = {lib, ...}: { wayland.windowManager.hyprland.settings = { - exec-once = [ - "qtbatticon" # custom battery tray - "nixpkgs-notifier listen" # tracks PR merge in nixos-unstable - ]; + on = { + _args = [ + "hyprland.start" + (lib.generators.mkLuaInline '' + function() + hl.exec_cmd("qtbatticon") --- custom battery tray + hl.exec_cmd("source /run/agenix/ntfy && nixpkgs-notifier listen") --- tracks PR merge in nixos-unstable + end + '') + ]; + }; + monitor = [ "eDP-1, highres@highrr, 0x0, 1" ]; @@ -67,7 +75,7 @@ ]; }; }; - flake.homeModules.hyprland = {pkgs-unstable, ...}: let + flake.homeModules.hyprland = {pkgs-unstable, lib, ...}: let wallpaper = ../../assets/wallpaper1.jpg; in { #refer to https://wiki.hypr.land/Nix/Hyprland-on-Home-Manager/ @@ -266,6 +274,7 @@ ]; # █░░ ▄▀█ █░█ █▄░█ █▀▀ █░█ # █▄▄ █▀█ █▄█ █░▀█ █▄▄ █▀█ +<<<<<<< HEAD exec-once = [ "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" # for XDPH "dbus-update-activation-environment --systemd --all" # for XDPH @@ -307,6 +316,32 @@ ###################### */ ]; +======= + on = { + _args = [ + "hyprland.start" + (lib.generators.mkLuaInline '' + hl.exec_cmd("dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP") -- for XDPH + hl.exec_cmd("dbus-update-activation-environment --systemd --all") -- for XDPH + hl.exec_cmd("systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP") -- for XDPH + hl.exec_cmd("systemctl --user start xdg-desktop-portal-wlr.service") + hl.exec_cmd("blueman-applet") -- systray app for Bluetooth + hl.exec_cmd("udiskie --no-automount --smart-tray") -- front-end that allows to manage removable media + hl.exec_cmd("nm-applet --indicator") -- systray app for Network/wifi + hl.exec_cmd("rm -rf ~/.cache/cliphist/ && wl-paste --type text --watch cliphist store & wl-paste --type image --watch cliphist store") + hl.exec_cmd("custom-batterynotify") + hl.exec_cmd("custom-batterywarning") + hl.exec_cmd("awww img ${wallpaper}") + hl.exec_cmd("awww-daemon") + hl.exec_cmd("sleep 1 && custom-wallpaper") + hl.exec_cmd("custom-checkKdrive && custom-mountkdrive") -- checks if the remote works and mount it + hl.exec_cmd("custom-gitnotify") + hl.exec_cmd("sleep 4 & caelestia-shell") -- works better if it sleeps a bit before + hl.exec_cmd("sleep 20 && ngcp pull --automatic") -- see github.com/tomasriveral/nix-git-cherry-picker + '') + ]; + }; +>>>>>>> a37174c (hyprland migrate exec-once to hl.exec_cmd) splash = true; # remove default background on startup # gestures (also keybindings) gesture = [