fix: get laptop and docked configs working in hyprland
This commit is contained in:
@@ -1,8 +1,15 @@
|
|||||||
-- Determine current platform
|
-- 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 is_docked = false
|
||||||
local laptop_config = false
|
local laptop_config = false
|
||||||
local read_platform = io.popen("cat ~/.config/janishutz/platform") == "l"
|
local read_platform = trim_string(io.popen("cat ~/.config/janishutz/platform"):read("a")) == "l"
|
||||||
local read_docked = io.popen("cat ~/.config/janishutz/docked") == "true"
|
local read_docked = trim_string(io.popen("cat ~/.config/janishutz/docked"):read("a")) == "y"
|
||||||
|
|
||||||
if read_platform then
|
if read_platform then
|
||||||
laptop_config = true
|
laptop_config = true
|
||||||
@@ -11,10 +18,12 @@ if read_docked and laptop_config then
|
|||||||
is_docked = true
|
is_docked = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
hl.notification.create({ text = "Config type: " .. tostring(read_platform), timeout = 5000 })
|
||||||
|
|
||||||
-- Core
|
-- Core
|
||||||
require("hyprland.colors")
|
require("hyprland.colors")
|
||||||
require("hyprland.core.general")
|
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.group")
|
||||||
require("hyprland.core.misc")
|
require("hyprland.core.misc")
|
||||||
require("hyprland.core.style")
|
require("hyprland.core.style")
|
||||||
|
|||||||
Reference in New Issue
Block a user