Compare commits

...

6 Commits

Author SHA1 Message Date
wyj 900c1c8922 new: add fcitx5 module 2026-05-30 14:23:06 -04:00
wyj a4edeec23b new: add envs to modules 2026-05-30 14:22:49 -04:00
wyj 7182189e8e add: add a debug print of module loaded 2026-05-30 14:19:57 -04:00
wyj 072c5876e4 fix: fix the swayosd module 2026-05-30 14:18:17 -04:00
wyj 90f1a6b17b fix: fix the input config 2026-05-30 14:17:41 -04:00
wyj ffa71223d5 fix: fix the usermodule load 2026-05-30 14:16:56 -04:00
6 changed files with 46 additions and 14 deletions
+5 -4
View File
@@ -2,16 +2,17 @@ local M = {}
local settings = require("lua.lib.settings")
M.confs = {
input = { touchpad = {}, gestures = {} },
input = { touchpad = {} },
gestures = {},
}
if settings["profile"] == "desktop" then
M.confs.input.numlock_by_default = true
M.confs.input = table.insert(M.confs.input, { numlock_by_default = true })
elseif settings["profile"] == "laptop" then
M.confs.input.gestures.workspace_swipe_touch = true
M.confs.gestures = table.insert(M.confs.gestures, { workspace_swipe_touch = true })
M.gestures = {
{
fingures = 3,
fingers = 3,
direction = "horizontal",
action = "workspace",
},
+1
View File
@@ -39,6 +39,7 @@ settings["modules"] = {
swayosd = true,
cliphist = true,
pypr = true,
fcitx5 = false,
}
return require("lua.lib.utils").extend_config(settings, "lua.user.settings")
+3 -1
View File
@@ -79,7 +79,9 @@ function M.tbl_recursive_merge(defaults, overrides)
end
function M.extend_config(defaults, user_module)
if not M.is_file_exists(HYPR .. user_module) then
local file = HYPR .. "/" .. string.gsub(user_module, "%.", "/") .. ".lua"
if not M.is_file_exists(file) then
print(file .. " not found.")
return deepcopy(defaults)
end
local ok, overrides = pcall(require, user_module)
+24
View File
@@ -0,0 +1,24 @@
local bind = require("lua.lib.bind")
local M = {}
M.binds = {
{
keys = bind.with_leader("CTRL + E"),
dispatcher = hl.dsp.exec_cmd("pkill fcitx5 -9;sleep 1;fcitx5 -d"),
desc = "restart fcitx5",
},
}
M.autostart = {
function()
hl.exec_cmd("fcitx5 -d")
end,
}
M.envs = {
QT_IM_MODULE = "fcitx",
XMODIFIERS = "@im=fcitx",
}
return M
+6
View File
@@ -26,6 +26,7 @@ end
for name, enabled in pairs(settings.modules) do
if enabled then
local mod = load_module(name)
print("module " .. name .. " loaded.")
table.insert(modules, {
name = name,
config = mod,
@@ -36,6 +37,7 @@ end
M.autostart = {}
M.autostop = {}
M.binds = {}
M.envs = {}
local function collect_modules_prop(module, prop)
if module[prop] then
@@ -48,6 +50,7 @@ for _, item in ipairs(modules) do
collect_modules_prop(module, "autostart")
collect_modules_prop(module, "autostop")
collect_modules_prop(module, "binds")
collect_modules_prop(module, "envs")
end
function M.load()
@@ -55,6 +58,9 @@ function M.load()
events.map("hyprland.shutdown", M.autostop)
bind.map(M.binds)
for name, value in pairs(M.envs) do
hl.env(name, value)
end
end
return M
+7 -9
View File
@@ -43,41 +43,39 @@ end
M.binds = {
{
keys = "XF86MonBrightnessUp",
dispatcher = function()
swayosd_client_cmd("--brightness raise")
end,
dispatcher = swayosd_client_cmd("--brightness raise"),
dosc = "Increase brightness ",
opts = { long_press = true, locked = true },
opts = { repeating = true, locked = true },
},
{
keys = "XF86MonBrightnessDown",
dispatcher = swayosd_client_cmd("--brightness lower"),
desc = "Decrease brightness ",
opts = { long_press = true, locked = true },
opts = { repeating = true, locked = true },
},
{
keys = "XF86AudioRaiseVolume",
dispatcher = swayosd_client_cmd("--output-volume raise"),
desc = "Increase brightness ",
opts = { long_press = true, locked = true },
opts = { repeating = true, locked = true },
},
{
keys = "XF86AudioLowerVolume",
dispatcher = swayosd_client_cmd("--output-volume lower"),
desc = "Decrease brightness ",
opts = { long_press = true, locked = true },
opts = { repeating = true, locked = true },
},
{
keys = "XF86AudioMute",
dispatcher = swayosd_client_cmd("--output-volume mute-toggle"),
desc = "Toggle output mute",
opts = { long_press = true, locked = true },
opts = { repeating = true, locked = true },
},
{
keys = "XF86AudioMicMute",
dispatcher = swayosd_client_cmd("--input-volume mute-toggle"),
desc = "Toggle input mute",
opts = { long_press = true, locked = true },
opts = { repeating = true, locked = true },
},
{
keys = "XF86AudioPlay",