Compare commits

...

20 Commits

Author SHA1 Message Date
wyj f00c8affc4 feat: add module windowrule support 2026-06-14 04:28:35 -04:00
wyj e298b55cb7 style: re-format 2026-06-12 17:12:25 -04:00
wyj a0b22453eb new: add editorconfig 2026-06-12 16:31:48 -04:00
wyj 4bbae7a78c fix: fix vrr 2026-06-12 16:19:36 -04:00
wyj 4614859248 fix: fix systemd unit 2026-06-12 16:19:36 -04:00
wyj 87ecb55fd8 fix: avoid double waybar 2026-06-12 14:19:04 -04:00
wyj da74cab213 update: add ATRI specific starups 2026-06-07 17:46:17 -04:00
wyj 86e9b190af new: add locale setting 2026-06-07 16:57:01 -04:00
wyj 1e83dd2f5f update: increase dampening in spring curve 2026-06-06 17:06:35 -04:00
wyj 0cb5829923 feat: init plugins support 2026-06-06 17:01:55 -04:00
wyj 591515a149 fix: fix monitor config 2026-06-02 17:56:17 -04:00
wyj c4fbd94891 fix: fix input config 2026-05-30 17:48:21 -04:00
wyj 81a9d52938 clean: remove unneeded scripts 2026-05-30 14:42:41 -04:00
wyj bd95554e17 new: add rofi module 2026-05-30 14:38:05 -04:00
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
39 changed files with 994 additions and 766 deletions
+8
View File
@@ -0,0 +1,8 @@
root = true
[*]
insert_file_newline=true
[*.lua]
indent_style = space
indent_size = 2
+1 -1
View File
@@ -14,7 +14,7 @@ M.curves = {
type = "spring", type = "spring",
mass = 1, mass = 1,
stiffness = 50, stiffness = 50,
dampening = 6, dampening = 8,
}, },
}, },
} }
+6
View File
@@ -1,3 +1,5 @@
local settings = require("lua.lib.settings")
local M = {} local M = {}
---@type table<string, string> ---@type table<string, string>
@@ -7,6 +9,10 @@ M.envs = {
QT_AUTO_SCREEN_SCALE_FACTOR = "1", QT_AUTO_SCREEN_SCALE_FACTOR = "1",
} }
if settings["locale"] and settings["locale"] ~= "" then
M.envs["LANG"] = settings["locale"]
end
function M.load() function M.load()
for name, value in pairs(M.envs) do for name, value in pairs(M.envs) do
hl.env(name, value) hl.env(name, value)
+14 -1
View File
@@ -1,7 +1,7 @@
local settings = require("lua.lib.settings") local settings = require("lua.lib.settings")
require("lua.lib.globals") require("lua.lib.globals")
require("lua.conf.monitor") require("lua.conf.monitor"):load()
require("lua.conf.wallpaper").load() require("lua.conf.wallpaper").load()
require("lua.conf.cursor").load() require("lua.conf.cursor").load()
@@ -15,4 +15,17 @@ require("lua.conf.layerrules").load()
require("lua.binds").load() require("lua.binds").load()
require("lua.modules").load() require("lua.modules").load()
require("lua.plugins").load()
require("lua.animations").load() require("lua.animations").load()
if string.sub(settings["hostname"], 1, 4) == "ATRI" then
hl.on("hyprland.start", function()
hl.exec_cmd("kitty", {
workspace = "1 silent",
})
hl.exec_cmd("kitty -o font_size=10 btop", {
workspace = "2 silent",
})
hl.exec_cmd("sleep 1 && pw-play ~/.local/share/startupsounds/start-computeraif-14572.mp3")
end)
end
+14 -5
View File
@@ -1,24 +1,33 @@
local M = {} local M = {}
local settings = require("lua.lib.settings") local settings = require("lua.lib.settings")
local utils = require("lua.lib.utils")
M.confs = { M.confs = {
input = { touchpad = {}, gestures = {} }, input = { touchpad = {} },
gestures = {},
} }
if settings["profile"] == "desktop" then 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 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 = { M.gestures = {
{ {
fingures = 3, fingers = 3,
direction = "horizontal", direction = "horizontal",
action = "workspace", action = "workspace",
}, },
} }
end end
M.confs.input.touchpad.natural_scroll = settings["touchpad_natural_scroll"] --M.confs.input.touchpad.natural_scroll = settings["touchpad_natural_scroll"]
M.confs = utils.tbl_recursive_merge(M.confs, {
input = {
touchpad = {
natural_scroll = settings["touchpad_natural_scroll"],
},
},
})
M.confs.input.kb_layout = settings["kb_layout"] M.confs.input.kb_layout = settings["kb_layout"]
+1 -1
View File
@@ -6,7 +6,7 @@ M.confs = {
misc = { misc = {
disable_hyprland_logo = true, disable_hyprland_logo = true,
disable_splash_rendering = true, disable_splash_rendering = true,
vrr = true, vrr = 3,
enable_swallow = true, enable_swallow = true,
swallow_regex = "^(kitty|Alacritty)$", swallow_regex = "^(kitty|Alacritty)$",
background_color = colorscheme.background, background_color = colorscheme.background,
+15 -2
View File
@@ -1,9 +1,22 @@
local settings = require("lua.lib.settings") local settings = require("lua.lib.settings")
local utils = require("lua.lib.utils")
local M = {}
M.monitors = {}
if settings["host"] == "laptop" then if settings["host"] == "laptop" then
hl.monitor({ M.monitors = table.insert({ {
output = "eDP-1", output = "eDP-1",
mode = "highres", mode = "highres",
scale = "auto", scale = "auto",
}) } })
end end
function M:load()
for _, monitor in ipairs(self.monitors) do
hl.monitor(monitor)
end
end
return utils.extend_config(M, "lua.user.conf.monitor")
+10
View File
@@ -12,6 +12,9 @@ settings["touchpad_natural_scroll"] = true
---@type string ---@type string
settings["kb_layout"] = "us" settings["kb_layout"] = "us"
---@type string
settings["locale"] = ""
---@type "dwindle"|"master"|"scrolling"|"monocle" ---@type "dwindle"|"master"|"scrolling"|"monocle"
settings["default_layout"] = "dwindle" settings["default_layout"] = "dwindle"
@@ -39,6 +42,13 @@ settings["modules"] = {
swayosd = true, swayosd = true,
cliphist = true, cliphist = true,
pypr = true, pypr = true,
fcitx5 = false,
rofi = true,
}
---@type table<string, boolean>
settings["plugins"] = {
hyprexpo = false,
} }
return require("lua.lib.utils").extend_config(settings, "lua.user.settings") 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 end
function M.extend_config(defaults, user_module) 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) return deepcopy(defaults)
end end
local ok, overrides = pcall(require, user_module) 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
+12
View File
@@ -26,6 +26,7 @@ end
for name, enabled in pairs(settings.modules) do for name, enabled in pairs(settings.modules) do
if enabled then if enabled then
local mod = load_module(name) local mod = load_module(name)
print("module " .. name .. " loaded.")
table.insert(modules, { table.insert(modules, {
name = name, name = name,
config = mod, config = mod,
@@ -36,6 +37,8 @@ end
M.autostart = {} M.autostart = {}
M.autostop = {} M.autostop = {}
M.binds = {} M.binds = {}
M.envs = {}
M.windowrules = {}
local function collect_modules_prop(module, prop) local function collect_modules_prop(module, prop)
if module[prop] then if module[prop] then
@@ -48,6 +51,8 @@ for _, item in ipairs(modules) do
collect_modules_prop(module, "autostart") collect_modules_prop(module, "autostart")
collect_modules_prop(module, "autostop") collect_modules_prop(module, "autostop")
collect_modules_prop(module, "binds") collect_modules_prop(module, "binds")
collect_modules_prop(module, "envs")
collect_modules_prop(module, "windowrules")
end end
function M.load() function M.load()
@@ -55,6 +60,13 @@ function M.load()
events.map("hyprland.shutdown", M.autostop) events.map("hyprland.shutdown", M.autostop)
bind.map(M.binds) bind.map(M.binds)
for name, value in pairs(M.envs) do
hl.env(name, value)
end
for _, rule in ipairs(M.windowrules) do
hl.window_rule(rule)
end
end end
return M return M
+10
View File
@@ -17,4 +17,14 @@ M.binds = {
}, },
} }
M.windowrules = {
{
name = "Pyprland rules",
match = {
class = "kitty-dropterm"
},
float = true,
}
}
return M return M
+28
View File
@@ -0,0 +1,28 @@
local bind = require("lua.lib.bind")
local M = {}
M.binds = {
{
keys = bind.with_leader("Space"),
dispatcher = hl.dsp.exec_cmd("rofi -show drun -replace -i"),
desc = "Rofi launcher",
},
{
keys = bind.with_leader("CTRL + W"),
dispatcher = hl.dsp.exec_cmd("~/dotfiles/hypr/scripts/wallpaper.sh select"),
desc = "Rofi wallpaper selector",
},
{
keys = bind.with_leader("Print"),
dispatcher = hl.dsp.exec_cmd("~/dotfiles/hypr/scripts/screenshot.sh"),
desc = "Rofi screenshot dialog",
},
{
keys = bind.with_leader("V"),
dispatcher = hl.dsp.exec_cmd("~/dotfiles/scripts/cliphist.sh"),
desc = "Rofi cliphist clipboard manager",
},
}
return M
+1 -1
View File
@@ -7,7 +7,7 @@ local M = {}
local function start_swaync() local function start_swaync()
if settings["systemd"] then if settings["systemd"] then
local unit = "swaync.service" local unit = "swaync.service"
local source = CONFIG_HOME .. "hypr/systemd/" .. unit local source = HYPR .. "/systemd/" .. unit
if systemd.ensure_user_unit(unit, source) then if systemd.ensure_user_unit(unit, source) then
hl.exec_cmd("systemctl --user start swaync") hl.exec_cmd("systemctl --user start swaync")
+8 -10
View File
@@ -8,7 +8,7 @@ local M = {}
local function start_swayosd() local function start_swayosd()
if settings["systemd"] then if settings["systemd"] then
local unit = "swayosd.service" local unit = "swayosd.service"
local source = CONFIG_HOME .. "hypr/systemd/" .. unit local source = HYPR .. "/systemd/" .. unit
if systemd.ensure_user_unit(unit, source) then if systemd.ensure_user_unit(unit, source) then
hl.exec_cmd("systemctl --user start swayosd") hl.exec_cmd("systemctl --user start swayosd")
@@ -43,41 +43,39 @@ end
M.binds = { M.binds = {
{ {
keys = "XF86MonBrightnessUp", keys = "XF86MonBrightnessUp",
dispatcher = function() dispatcher = swayosd_client_cmd("--brightness raise"),
swayosd_client_cmd("--brightness raise")
end,
dosc = "Increase brightness ", dosc = "Increase brightness ",
opts = { long_press = true, locked = true }, opts = { repeating = true, locked = true },
}, },
{ {
keys = "XF86MonBrightnessDown", keys = "XF86MonBrightnessDown",
dispatcher = swayosd_client_cmd("--brightness lower"), dispatcher = swayosd_client_cmd("--brightness lower"),
desc = "Decrease brightness ", desc = "Decrease brightness ",
opts = { long_press = true, locked = true }, opts = { repeating = true, locked = true },
}, },
{ {
keys = "XF86AudioRaiseVolume", keys = "XF86AudioRaiseVolume",
dispatcher = swayosd_client_cmd("--output-volume raise"), dispatcher = swayosd_client_cmd("--output-volume raise"),
desc = "Increase brightness ", desc = "Increase brightness ",
opts = { long_press = true, locked = true }, opts = { repeating = true, locked = true },
}, },
{ {
keys = "XF86AudioLowerVolume", keys = "XF86AudioLowerVolume",
dispatcher = swayosd_client_cmd("--output-volume lower"), dispatcher = swayosd_client_cmd("--output-volume lower"),
desc = "Decrease brightness ", desc = "Decrease brightness ",
opts = { long_press = true, locked = true }, opts = { repeating = true, locked = true },
}, },
{ {
keys = "XF86AudioMute", keys = "XF86AudioMute",
dispatcher = swayosd_client_cmd("--output-volume mute-toggle"), dispatcher = swayosd_client_cmd("--output-volume mute-toggle"),
desc = "Toggle output mute", desc = "Toggle output mute",
opts = { long_press = true, locked = true }, opts = { repeating = true, locked = true },
}, },
{ {
keys = "XF86AudioMicMute", keys = "XF86AudioMicMute",
dispatcher = swayosd_client_cmd("--input-volume mute-toggle"), dispatcher = swayosd_client_cmd("--input-volume mute-toggle"),
desc = "Toggle input mute", desc = "Toggle input mute",
opts = { long_press = true, locked = true }, opts = { repeating = true, locked = true },
}, },
{ {
keys = "XF86AudioPlay", keys = "XF86AudioPlay",
+48
View File
@@ -0,0 +1,48 @@
local bind = require("lua.lib.bind")
local colorscheme = require("lua.conf.colorscheme")
local M = {}
M.autostart = {
function()
hl.exec_cmd("hyprctl plugin load /usr/lib/hyprland-plugins/hyprexpo.so")
end,
}
M.confs = {
plugin = {
hyprexpo = {
columns = 3,
gap_size = 5,
gap_size_outer = 0,
bg_col = colorscheme.background,
workspace_method = "center current",
skip_empty = false,
max_workspace = 0,
show_workspace_numbers = false,
workspace_number_color = colorscheme.foreground,
window_icon_enable = false,
window_icon_position = "bottom-right",
window_icon_size = 32,
label_enable = false,
label_text_mode = "id",
label_token_map = "",
selection_label_enable = false,
selection_label_token_map = "a,s,d,f,g,q,w,e,r,t,z,x,c,v,b",
gesture_distance = 300,
cancel_key = "escape",
},
},
}
M.binds = {
{
keys = bind.with_leader("F3"),
dispatcher = function()
hl.plugin.hyprexpo.expo("toggle")
end,
desc = "Toggle hyprexpo",
},
}
return M
+65
View File
@@ -0,0 +1,65 @@
local settings = require("lua.lib.settings")
require("lua.lib.globals")
local utils = require("lua.lib.utils")
local events = require("lua.lib.events")
local bind = require("lua.lib.bind")
local M = {}
local plugins = {}
local function is_plugin_exists(name)
return utils.is_file_exists(HYPR .. "/lua/plugins/" .. name .. ".lua")
end
local function load_plugin(name)
if not is_plugin_exists(name) then
return {}
end
local default_plug = require("lua.plugins." .. name)
local user_plugname = "lua.user.plugins." .. name
local plug = utils.extend_config(default_plug, user_plugname)
return plug
end
print("loading plugins...")
for name, enabled in pairs(settings.plugins) do
print("plugin " .. name .. " enabled is " .. tostring(enabled))
if enabled then
local plug = load_plugin(name)
print("plugin " .. name .. " loaded.")
table.insert(plugins, {
name = name,
config = plug,
})
end
end
M.autostart = {}
M.binds = {}
M.confs = {}
local function collect_plugins_prop(plugin, prop)
if plugin[prop] then
M[prop] = utils.list_extend(M[prop], plugin[prop])
end
end
for _, item in ipairs(plugins) do
local plugin = item.config
collect_plugins_prop(plugin, "autostart")
collect_plugins_prop(plugin, "binds")
collect_plugins_prop(plugin, "confs")
end
function M.load()
events.map("hyprland.start", M.autostart)
bind.map(M.binds)
hl.config(M.confs)
end
return M
-18
View File
@@ -1,18 +0,0 @@
import sys
import subprocess
import os
import json
import pathlib
import shutil
# Get script path
pathname = os.path.dirname(sys.argv[0])
homeFolder = os.path.expanduser('~') # Path to home folder
dotfiles = homeFolder + "/dotfiles/"
result = subprocess.run(["bash", dotfiles + "hypr/scripts/monitors.sh"], capture_output=True, text=True)
monitors_json = result.stdout.strip()
monitors_arr = json.loads(monitors_json)
for row in monitors_arr:
if row["focused"]:
print(row["id"])
+1 -1
View File
@@ -101,7 +101,7 @@ echo $newwall
# ----------------------------------------------------- # -----------------------------------------------------
# Reload waybar with new colors # Reload waybar with new colors
# ----------------------------------------------------- # -----------------------------------------------------
~/dotfiles/waybar/launch.sh #~/dotfiles/waybar/launch.sh
# ----------------------------------------------------- # -----------------------------------------------------
# Set the new wallpaper # Set the new wallpaper