Compare commits
6 Commits
d6d95173bd
...
900c1c8922
| Author | SHA1 | Date | |
|---|---|---|---|
| 900c1c8922 | |||
| a4edeec23b | |||
| 7182189e8e | |||
| 072c5876e4 | |||
| 90f1a6b17b | |||
| ffa71223d5 |
+5
-4
@@ -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",
|
||||
},
|
||||
|
||||
@@ -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
@@ -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)
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user