From 55f5a412d94e6fcb3ab33c6ae86868ffdcbdca42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nina=20Chl=C3=B3e=20Kassandra=20Rei=C3=9F?= Date: Fri, 19 Jun 2026 10:55:05 +0200 Subject: [PATCH] Refactor lua modules for object ownership --- background.lua | 8 +++++--- hyprland.lua | 12 ++++++++++-- monitor.lua | 4 ++++ status_bar.lua | 5 +++++ 4 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 status_bar.lua diff --git a/background.lua b/background.lua index 2e2149d..2dfcfaa 100644 --- a/background.lua +++ b/background.lua @@ -1,3 +1,5 @@ -hl.on("hyprland.start", function() - hl.exec_cmd("swaybg -m stretch -i ./wallpaper/XP.jpg") -end) +return { + start = function() + hl.exec_cmd("swaybg -m stretch -i ./wallpaper/XP.jpg") + end, +} diff --git a/hyprland.lua b/hyprland.lua index 61eef48..6a665fa 100644 --- a/hyprland.lua +++ b/hyprland.lua @@ -1,2 +1,10 @@ -require("monitor") -require("background") +local monitor = require("monitor") +local background = require("background") +local status_bar = require("status_bar") + +-- on event +hl.on("hyprland.start", function() + monitor.start() + background.start() + status_bar.start() +end) diff --git a/monitor.lua b/monitor.lua index b94784e..b76bec3 100644 --- a/monitor.lua +++ b/monitor.lua @@ -11,3 +11,7 @@ hl.monitor({ position = "auto", scale = 1, }) + +return { + start = function() end, +} diff --git a/status_bar.lua b/status_bar.lua new file mode 100644 index 0000000..0477db8 --- /dev/null +++ b/status_bar.lua @@ -0,0 +1,5 @@ +return { + start = function() + hl.exec_cmd("waybar") + end, +}