From 0a1124a2462706c3243e8b29a03dfadcb682ed18 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Thu, 18 Jun 2026 12:05:02 +0200 Subject: [PATCH] fix: get laptop and docked configs working in hyprland --- config/hypr/hyprland.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/config/hypr/hyprland.lua b/config/hypr/hyprland.lua index 13d9d44..68296e9 100644 --- a/config/hypr/hyprland.lua +++ b/config/hypr/hyprland.lua @@ -1,8 +1,15 @@ -- Determine current platform +--- Trim a string +---@param s string the string to process +---@return string +local function trim_string(s) + return s:match("^%s*(.*)"):match("(.-)%s*$") +end + local is_docked = false local laptop_config = false -local read_platform = io.popen("cat ~/.config/janishutz/platform") == "l" -local read_docked = io.popen("cat ~/.config/janishutz/docked") == "true" +local read_platform = trim_string(io.popen("cat ~/.config/janishutz/platform"):read("a")) == "l" +local read_docked = trim_string(io.popen("cat ~/.config/janishutz/docked"):read("a")) == "y" if read_platform then laptop_config = true @@ -11,10 +18,12 @@ if read_docked and laptop_config then is_docked = true end +hl.notification.create({ text = "Config type: " .. tostring(read_platform), timeout = 5000 }) + -- Core require("hyprland.colors") require("hyprland.core.general") -require("hyprland.core.input")(laptop_config) +require("hyprland.core.input")(laptop_config and not is_docked) require("hyprland.core.group") require("hyprland.core.misc") require("hyprland.core.style")