From 65e610507e4313430d96e19b07e9521e2dd8862a Mon Sep 17 00:00:00 2001 From: Frank Zechert Date: Sun, 9 Aug 2026 19:09:29 +0200 Subject: [PATCH] update hyprland autostart --- user/dot_config/hypr/hyprland-autostart.lua | 21 ---------------- .../hypr/hyprland-autostart.lua.tmpl | 23 +++++++++++++++++ user/dot_config/hypr/hyprland-binds.lua | 18 ------------- user/dot_config/hypr/hyprland-windowrules.lua | 1 - user/dot_config/hypr/hyprland.lua | 25 ++++++++++++++++++- 5 files changed, 47 insertions(+), 41 deletions(-) delete mode 100644 user/dot_config/hypr/hyprland-autostart.lua create mode 100644 user/dot_config/hypr/hyprland-autostart.lua.tmpl diff --git a/user/dot_config/hypr/hyprland-autostart.lua b/user/dot_config/hypr/hyprland-autostart.lua deleted file mode 100644 index 6eb7e5a..0000000 --- a/user/dot_config/hypr/hyprland-autostart.lua +++ /dev/null @@ -1,21 +0,0 @@ - --- See https://wiki.hypr.land/Configuring/Basics/Autostart/ - --- Autostart necessary processes (like notifications daemons, status bars, etc.) --- Or execute your favorite apps at launch like this: --- --- hl.on("hyprland.start", function () --- hl.exec_cmd(terminal) --- hl.exec_cmd("nm-applet") --- hl.exec_cmd("waybar & hyprpaper & firefox") --- end) - -hl.on("hyprland.start", function() - hl.exec_cmd("librewolf", { workspace = 9 }) - - hl.exec_cmd("thunderbird", { workspace = 10 }) - hl.timer(function() - hl.exec_cmd("signal-desktop", { workspace = 10 }) - hl.exec_cmd("Telegram", { workspace = 10 }) - end, { timeout = 1000, type = "oneshot" }) -end) diff --git a/user/dot_config/hypr/hyprland-autostart.lua.tmpl b/user/dot_config/hypr/hyprland-autostart.lua.tmpl new file mode 100644 index 0000000..e735437 --- /dev/null +++ b/user/dot_config/hypr/hyprland-autostart.lua.tmpl @@ -0,0 +1,23 @@ + +-- See https://wiki.hypr.land/Configuring/Basics/Autostart/ + +-- Autostart necessary processes (like notifications daemons, status bars, etc.) +-- Or execute your favorite apps at launch like this: +-- +-- Most applications are started by systemd. Others are wrapped by uwsm app -- (by create_launcher() function) + +function delay(f, millis) + hl.timer(f, { timeout = millis, type = "oneshot" }) +end + +hl.on("hyprland.start", function() + hl.exec_cmd(create_launcher("thunderbird"), { workspace = 10 }) + delay(function() hl.exec_cmd(create_launcher("signal-desktop"), { workspace = 10 }) end, 4000) + delay(function() hl.exec_cmd(create_launcher("Telegram"), { workspace = 10 }) end, 5000) + {{ if eq .work_env true -}} + -- Outlook + hl.exec_cmd(create_launcher("/home/frank/.local/share/applications/librewolf.webapp-e7db0a1c-02e9-42cc-a5da-8fdc222e89dc.desktop"), { workspace = "9" }) + -- Teams + delay(function() hl.exec_cmd(create_launcher("/home/frank/.local/share/applications/librewolf.webapp-daf88433-cdaa-4a10-9bfb-af0a20fb7b71.desktop"), { workspace = "9" }) end, 3000) + {{ end -}} +end) diff --git a/user/dot_config/hypr/hyprland-binds.lua b/user/dot_config/hypr/hyprland-binds.lua index 5809d98..e2d9dfb 100644 --- a/user/dot_config/hypr/hyprland-binds.lua +++ b/user/dot_config/hypr/hyprland-binds.lua @@ -1,23 +1,5 @@ -local launchPrefix = "uwsm app -- " -local function is_ipc_call(command) - -- check if this is an ipc call to a running programm - is_dms_ipc = starts_with(command, "dms ipc") - is_hyprctl = starts_with(command, "hyprctl") - is_ipc = any({is_dms_ipc, is_hyprctl}, function(v) return v end) - return is_ipc -end -function create_launcher(command) - if is_ipc_call(command) then - return command - end - return launchPrefix .. command -end - -function execute(command) - return hl.dsp.exec_cmd(create_launcher(command)) -end -- Program Launchers hl.bind("SUPER + Return", execute(programs.terminal), { description = "Open Terminal" }) diff --git a/user/dot_config/hypr/hyprland-windowrules.lua b/user/dot_config/hypr/hyprland-windowrules.lua index ebe4e9e..ea2d69d 100644 --- a/user/dot_config/hypr/hyprland-windowrules.lua +++ b/user/dot_config/hypr/hyprland-windowrules.lua @@ -286,4 +286,3 @@ rule( { matches_title("^(Teams for Linux - Screen is being shared)$") }, { float(), size(600, 300), pin() } ) - diff --git a/user/dot_config/hypr/hyprland.lua b/user/dot_config/hypr/hyprland.lua index b861fe0..99df9c8 100644 --- a/user/dot_config/hypr/hyprland.lua +++ b/user/dot_config/hypr/hyprland.lua @@ -7,7 +7,7 @@ debug_flag = true ------------------- function debug_notify(message) if debug_flag and message ~= nil then - hl.notification.create({text = message, timeout = 30000}) + hl.notification.create({text = message, timeout = 10000}) hl.exec_cmd("echo '" .. message .. "' >> /tmp/hyprland-notify.log") end end @@ -81,6 +81,25 @@ programs = { browser = "librewolf", calculator = "qalculate-gtk", } +launchPrefix = "uwsm app -- " +function is_ipc_call(command) + -- check if this is an ipc call to a running programm + is_dms_ipc = starts_with(command, "dms ipc") + is_hyprctl = starts_with(command, "hyprctl") + is_ipc = any({is_dms_ipc, is_hyprctl}, function(v) return v end) + return is_ipc +end + +function create_launcher(command) + if is_ipc_call(command) then + return command + end + return launchPrefix .. command +end + +function execute(command) + return hl.dsp.exec_cmd(create_launcher(command)) +end ------------------- ---- Variables ---- @@ -118,6 +137,10 @@ require("hyprland-binds") ---- WINDOW RULES ---- ---------------------- require("hyprland-windowrules") + +--------------------- +---- LAYER RULES ---- +--------------------- hl.layer_rule({ match = { namespace = "^(quickshell)$" }, no_anim = true }) hl.layer_rule({ match = { namespace = "^dms:.*" }, no_anim = true })