From 10c23c4d24bd15e0bb2b886c2dd948359c727ac5 Mon Sep 17 00:00:00 2001 From: Mathias Scheider Date: Fri, 25 Sep 2026 15:57:38 +0200 Subject: [PATCH] better env management --- .gitignore | 1 + .../hypr/{env.example.lua => env_example.lua} | 0 hypr/.config/hypr/hyprland-gui.lua | 34 ------------------- hypr/.config/hypr/hyprland.lua | 25 ++++++++------ hypr/.config/hypr/scripts/screensaver-tte.sh | 2 +- 5 files changed, 17 insertions(+), 45 deletions(-) rename hypr/.config/hypr/{env.example.lua => env_example.lua} (100%) delete mode 100644 hypr/.config/hypr/hyprland-gui.lua diff --git a/.gitignore b/.gitignore index 8e5e10d..d35d123 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ term/.config/opencode/cli.json term/.config/opencode/service.json hypr/.config/hypr/scheme/current.lua hypr/.config/hypr/env.lua +hypr/.config/hypr/hyprland-buntes-monster-gui.lua diff --git a/hypr/.config/hypr/env.example.lua b/hypr/.config/hypr/env_example.lua similarity index 100% rename from hypr/.config/hypr/env.example.lua rename to hypr/.config/hypr/env_example.lua diff --git a/hypr/.config/hypr/hyprland-gui.lua b/hypr/.config/hypr/hyprland-gui.lua deleted file mode 100644 index c0b4cdd..0000000 --- a/hypr/.config/hypr/hyprland-gui.lua +++ /dev/null @@ -1,34 +0,0 @@ --- Generated by HyprMod - --- Monitors -hl.monitor({ - output = "desc:AOC U27G4R XZ1R7HA004323", - disabled = false, - mode = "3840x2160@160.00Hz", - position = "-2560x0", - scale = 1.5, - bitdepth = 10, - cm = "hdredid", - sdrbrightness = 0.29, - sdrsaturation = 1.19, - sdr_min_luminance = 0, - sdr_max_luminance = 773, - min_luminance = 0, - max_luminance = 773, - max_avg_luminance = 456, -}) -hl.monitor({ - output = "desc:Acer Technologies XB253Q TH5EE0058521", - disabled = false, - mode = "1920x1080@60.00Hz", - position = "0x0", - scale = 1, - bitdepth = 10, - cm = "hdredid", - sdrbrightness = 0.5, - sdr_min_luminance = 0, - sdr_max_luminance = 763, - min_luminance = 0.02, - max_luminance = 763, - max_avg_luminance = 400, -}) diff --git a/hypr/.config/hypr/hyprland.lua b/hypr/.config/hypr/hyprland.lua index 34f6c96..b66e84d 100644 --- a/hypr/.config/hypr/hyprland.lua +++ b/hypr/.config/hypr/hyprland.lua @@ -1,5 +1,14 @@ -local env = require("env") +local config_home = os.getenv("XDG_CONFIG_HOME") or os.getenv("HOME") .. "/.config" + +local fid_env = io.open(config_home .. "/hypr/env") +local env = {} +if fid_env then + env = require("env") +else + env = require("env_example") +end + if env.shell ~= "noctalia" and env.shell ~= "caelestia" then error("Unsupported shell '" .. tostring(env.shell) .. "' in ~/.config/hypr/env.lua; choose 'noctalia' or 'caelestia'") end @@ -13,14 +22,6 @@ hl.exec_cmd("bash ~/.config/hypr/env.sh") -- load default monitor config require("modules.monitor_setup_default") --- Only use monitor_setup if the file exists -local config_home = os.getenv("XDG_CONFIG_HOME") or os.getenv("HOME") .. "/.config" -local f = io.open(config_home .. "/hypr/monitor_setup.lua", "r") -if f then - f:close() - require("monitor_setup") -end - -- unscale XWayland hl.config({ xwayland = { @@ -50,7 +51,11 @@ require("modules.keybinds") require("modules.windows_and_workspaces") -- HyprMod managed settings -require("hyprland-gui") +local fid_gui = io.open(config_home .. "/hypr/hyprland-buntes-monster-gui") +if fid_gui then + fid_gui:close() + require("hyprland-buntes-monster-gui") +end -- For Noctalia Color templates require("noctalia").apply_theme() diff --git a/hypr/.config/hypr/scripts/screensaver-tte.sh b/hypr/.config/hypr/scripts/screensaver-tte.sh index 2b30a60..c7af194 100755 --- a/hypr/.config/hypr/scripts/screensaver-tte.sh +++ b/hypr/.config/hypr/scripts/screensaver-tte.sh @@ -16,7 +16,7 @@ input="$SCREENSAVER_TEXT" [[ -f "$input" ]] || input="/etc/hostname" while true; do - tte -i "$input" \ + tte -i <(fastfetch --pipe) \ --frame-rate 60 --canvas-width 0 --canvas-height 0 \ --anchor-canvas c --anchor-text c \ --random-effect --exclude-effects dev_worm \