From 0aad7f9f3324055f313eb8211cddbb687f9c176d Mon Sep 17 00:00:00 2001 From: djairoh Date: Fri, 2 Oct 2026 14:57:24 +0200 Subject: [PATCH] hm: hypr autostart --- lib/hypr.nix | 11 +++++++++++ modules/desktop/hypr.nix | 42 ++++++++++++++-------------------------- 2 files changed, 25 insertions(+), 28 deletions(-) diff --git a/lib/hypr.nix b/lib/hypr.nix index 194b874..118a3c9 100644 --- a/lib/hypr.nix +++ b/lib/hypr.nix @@ -51,5 +51,16 @@ rec { (lua "function()\n ${bindContent}\nend") ]; }; + + on-signal = signal: cmds: + let + content = builtins.concatStringsSep "\n " (map (cmd: "hl.exec_cmd(\"${cmd}\")") cmds); + in + { + _args = [ + signal + (lua "function()\n ${content}\nend") + ]; + }; } diff --git a/modules/desktop/hypr.nix b/modules/desktop/hypr.nix index 14a1c60..01f3bec 100644 --- a/modules/desktop/hypr.nix +++ b/modules/desktop/hypr.nix @@ -1,33 +1,5 @@ { lib, pkgs, ... }: -#----------------------------------------Autostart---------------------------------------- -# hl.on("hyprland.start", function() -# -- plugins -# hl.exec_cmd("hyprpm reload") -# -# -- run kanshi for output placement (also starts up bg and waybar) -# hl.exec_cmd("kanshi") -# -# -- notification manager -# hl.exec_cmd("dunst") -# -# -- start a terminal in the scratchpad -# hl.exec_cmd("kitty --class scratchme -d ~/Documents/diary") -# -# -- run flameshot daemon -# hl.exec_cmd("nohup flameshot") -# -# -- cursor theme -# hl.exec_cmd("hyprctl setcursor Catppuccin-Macchiato-Dark-Cursors 24") -# -# -- opencloud -# hl.exec_cmd("opencloud") -# -# -- openrgb -# hl.exec_cmd("type openrgb &> /dev/null && openrgb --noautoconnect -p aroace.orp > /dev/null") -# end) -# - let hyprLib = import ../../lib/hypr.nix { inherit lib; }; @@ -78,6 +50,20 @@ in portalPackage = null; settings = { + on = [ #TODO: set up exec oncess + (hyprLib.on-signal "hyprland.start" [ + # "uwsm app -- /home/djai/AppImages/opencloud.appimage" # TODO: get opencloud + "uwsm app -- openrgb --noautoconnect -p aroace.orp" + "uwsm app -- kitty --class scratchme -d /home/djai/Documents/diary" + # these should be done thru systemd already + # hl.exec_cmd("nohup flameshot") + # hl.exec_cmd("hyprpm reload") + # hl.exec_cmd("kanshi") + # hl.exec_cmd("dunst") + # hl.exec_cmd("hyprctl setcursor Catppuccin-Macchiato-Dark-Cursors 24") + ]) + ]; + config = { general = { gaps_in = 5;