Compare commits

..

22 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
wyj d6d95173bd feat: init animation config 2026-05-30 05:55:44 -04:00
wyj 9bd03f67e4 clean: remove some legacy shell scripts 2026-05-30 04:07:34 -04:00
57 changed files with 1012 additions and 1053 deletions
+8
View File
@@ -0,0 +1,8 @@
root = true
[*]
insert_file_newline=true
[*.lua]
indent_style = space
indent_size = 2
+22
View File
@@ -0,0 +1,22 @@
local M = {}
M.curves = {
{
name = "easeInOutExpo",
curve = {
type = "bezier",
points = { { 0.87, 0 }, { 0.13, 1 } },
},
},
{
name = "rubber",
curve = {
type = "spring",
mass = 1,
stiffness = 50,
dampening = 8,
},
},
}
return M
+30
View File
@@ -0,0 +1,30 @@
local curves = require("lua.animations.curves")
local M = {}
M.animations = {
{
leaf = "windows",
enabled = true,
speed = 1,
spring = "rubber",
style = "slide",
},
{
leaf = "workspaces",
enabled = true,
speed = 8,
spring = "rubber",
},
}
function M.load()
for _, curve_item in pairs(curves.curves) do
hl.curve(curve_item.name, curve_item.curve)
end
for _, animation in pairs(M.animations) do
hl.animation(animation)
end
end
return M
+15 -15
View File
@@ -3,21 +3,21 @@ local settings = require("lua.lib.settings")
local bind = require("lua.lib.bind")
M.binds = {
{
keys = bind.with_leader("Return"),
desc = "Open terminal",
dispatcher = hl.dsp.exec_cmd(settings.apps.terminal),
},
{
keys = bind.with_leader("B"),
desc = "Open web browser",
dispatcher = hl.dsp.exec_cmd(settings.apps.browser),
},
{
keys = bind.with_leader("E"),
desc = "Open file manager",
dispatcher = hl.dsp.exec_cmd(settings.apps.file_manager),
},
{
keys = bind.with_leader("Return"),
desc = "Open terminal",
dispatcher = hl.dsp.exec_cmd(settings.apps.terminal),
},
{
keys = bind.with_leader("B"),
desc = "Open web browser",
dispatcher = hl.dsp.exec_cmd(settings.apps.browser),
},
{
keys = bind.with_leader("E"),
desc = "Open file manager",
dispatcher = hl.dsp.exec_cmd(settings.apps.file_manager),
},
}
return M
+19 -19
View File
@@ -3,34 +3,34 @@ local bind = require("lua.lib.bind")
local utils = require("lua.lib.utils")
local pieces = {
"apps",
"window",
"workspace",
"passthrough",
"apps",
"window",
"workspace",
"passthrough",
}
M.binds = {}
M.submaps = {}
for _, piece in pairs(pieces) do
local p = require("lua.binds." .. piece)
local bind_piece = p.binds
for _, bind_item in pairs(bind_piece) do
table.insert(M.binds, bind_item)
end
local submap = p.submaps
if submap then
M.submaps = utils.tbl_recursive_merge(M.submaps, submap)
end
local p = require("lua.binds." .. piece)
local bind_piece = p.binds
for _, bind_item in pairs(bind_piece) do
table.insert(M.binds, bind_item)
end
local submap = p.submaps
if submap then
M.submaps = utils.tbl_recursive_merge(M.submaps, submap)
end
end
function M.load()
bind.map(M.binds)
for name, binds in pairs(M.submaps) do
hl.define_submap(name, function()
bind.map(binds)
end)
end
bind.map(M.binds)
for name, binds in pairs(M.submaps) do
hl.define_submap(name, function()
bind.map(binds)
end)
end
end
return M
+11 -11
View File
@@ -2,20 +2,20 @@ local bind = require("lua.lib.bind")
local M = {}
M.binds = {
{
keys = bind.with_leader("P"),
dispatcher = hl.dsp.submap("pass_through"),
desc = "Pass through submap",
},
{
keys = bind.with_leader("P"),
dispatcher = hl.dsp.submap("pass_through"),
desc = "Pass through submap",
},
}
M.submaps = {
pass_through = {
{
keys = bind.with_leader("escape"),
dispatcher = hl.dsp.submap("reset"),
},
},
pass_through = {
{
keys = bind.with_leader("escape"),
dispatcher = hl.dsp.submap("reset"),
},
},
}
return M
+113 -113
View File
@@ -4,135 +4,135 @@ local utils = require("lua.lib.utils")
local M = {}
local function maximize_active_window()
local actions = {
scrolling = hl.dsp.layout("colresize 1.0"),
}
local fallback = hl.dsp.window.fullscreen({ mode = "maximized" })
return bind.layout_dispatcher(actions, fallback)
local actions = {
scrolling = hl.dsp.layout("colresize 1.0"),
}
local fallback = hl.dsp.window.fullscreen({ mode = "maximized" })
return bind.layout_dispatcher(actions, fallback)
end
M.binds = {
{
keys = bind.with_leader("Q"),
dispatcher = hl.dsp.window.close(),
desc = "Close the window",
},
{
keys = bind.with_leader("SHIFT + Q"),
dispatcher = hl.dsp.window.kill(),
desc = "Kill the window",
},
{
keys = bind.with_leader("F"),
dispatcher = hl.dsp.window.fullscreen({}),
desc = "Toggle fullscreen the window",
},
{
keys = bind.with_leader("SHIFT + F"),
dispatcher = maximize_active_window(),
desc = "Toggle maximize the window",
},
{
keys = bind.with_leader("CTRL + SHIFT + F"),
dispatcher = hl.dsp.window.fullscreen_state({ internal = 0, client = 2, action = "toggle" }),
desc = "Toggle fake the window it's fullscreened",
},
{
keys = bind.with_leader("T"),
dispatcher = hl.dsp.window.float(),
desc = "Toggle float the window",
},
{
keys = bind.with_leader("R"),
dispatcher = bind.layout_dispatcher({
dwindle = hl.dsp.layout("rotatesplit"),
}, hl.dsp.no_op()),
desc = "Toggle split",
},
{
keys = bind.with_leader("CTRL + R"),
dispatcher = bind.layout_dispatcher({
dwindle = hl.dsp.layout("swapsplit"),
master = hl.dsp.layout("swapnext"),
}, hl.dsp.no_op()),
},
{
keys = bind.with_leader("Q"),
dispatcher = hl.dsp.window.close(),
desc = "Close the window",
},
{
keys = bind.with_leader("SHIFT + Q"),
dispatcher = hl.dsp.window.kill(),
desc = "Kill the window",
},
{
keys = bind.with_leader("F"),
dispatcher = hl.dsp.window.fullscreen({}),
desc = "Toggle fullscreen the window",
},
{
keys = bind.with_leader("SHIFT + F"),
dispatcher = maximize_active_window(),
desc = "Toggle maximize the window",
},
{
keys = bind.with_leader("CTRL + SHIFT + F"),
dispatcher = hl.dsp.window.fullscreen_state({ internal = 0, client = 2, action = "toggle" }),
desc = "Toggle fake the window it's fullscreened",
},
{
keys = bind.with_leader("T"),
dispatcher = hl.dsp.window.float(),
desc = "Toggle float the window",
},
{
keys = bind.with_leader("R"),
dispatcher = bind.layout_dispatcher({
dwindle = hl.dsp.layout("rotatesplit"),
}, hl.dsp.no_op()),
desc = "Toggle split",
},
{
keys = bind.with_leader("CTRL + R"),
dispatcher = bind.layout_dispatcher({
dwindle = hl.dsp.layout("swapsplit"),
master = hl.dsp.layout("swapnext"),
}, hl.dsp.no_op()),
},
}
for key, dir in pairs({
H = "left",
L = "right",
K = "up",
J = "down",
H = "left",
L = "right",
K = "up",
J = "down",
}) do
table.insert(M.binds, {
keys = bind.with_leader("SHIFT+" .. key),
dispatcher = hl.dsp.window.move({ direction = string.sub(dir, 1, 1) }),
desc = "Move window " .. dir,
})
table.insert(M.binds, {
keys = bind.with_leader(key),
dispatcher = hl.dsp.focus({ direction = string.sub(dir, 1, 1) }),
desc = "Move window " .. dir,
})
table.insert(M.binds, {
keys = bind.with_leader("CTRL + " .. key),
dispatcher = hl.dsp.window.move({ direction = string.sub(dir, 1, 1), group_aware = true }),
desc = "Move window " .. dir .. " with group_aware",
})
table.insert(M.binds, {
keys = bind.with_leader("SHIFT+" .. key),
dispatcher = hl.dsp.window.move({ direction = string.sub(dir, 1, 1) }),
desc = "Move window " .. dir,
})
table.insert(M.binds, {
keys = bind.with_leader(key),
dispatcher = hl.dsp.focus({ direction = string.sub(dir, 1, 1) }),
desc = "Move window " .. dir,
})
table.insert(M.binds, {
keys = bind.with_leader("CTRL + " .. key),
dispatcher = hl.dsp.window.move({ direction = string.sub(dir, 1, 1), group_aware = true }),
desc = "Move window " .. dir .. " with group_aware",
})
end
M.binds = utils.list_extend(M.binds, {
{
keys = bind.with_leader("SHIFT + left"),
dispatcher = hl.dsp.window.resize({ x = -100, y = 0, relative = true }),
desc = "Resize window x-100",
},
{
keys = bind.with_leader("SHIFT + right"),
dispatcher = hl.dsp.window.resize({ x = 100, y = 0, relative = true }),
desc = "Resize window x+100",
},
{
keys = bind.with_leader("SHIFT + up"),
dispatcher = hl.dsp.window.resize({ x = 0, y = -100, relative = true }),
desc = "Resize window y-100",
},
{
keys = bind.with_leader("SHIFT + down"),
dispatcher = hl.dsp.window.resize({ x = 0, y = 100, relative = true }),
desc = "Resize window y+100",
},
{
keys = bind.with_leader("SHIFT + left"),
dispatcher = hl.dsp.window.resize({ x = -100, y = 0, relative = true }),
desc = "Resize window x-100",
},
{
keys = bind.with_leader("SHIFT + right"),
dispatcher = hl.dsp.window.resize({ x = 100, y = 0, relative = true }),
desc = "Resize window x+100",
},
{
keys = bind.with_leader("SHIFT + up"),
dispatcher = hl.dsp.window.resize({ x = 0, y = -100, relative = true }),
desc = "Resize window y-100",
},
{
keys = bind.with_leader("SHIFT + down"),
dispatcher = hl.dsp.window.resize({ x = 0, y = 100, relative = true }),
desc = "Resize window y+100",
},
})
M.binds = utils.list_extend(M.binds, {
{
keys = bind.with_leader("mouse:272"),
dispatcher = hl.dsp.window.drag(),
desc = "Drag window",
},
{
keys = bind.with_leader("mouse:273"),
dispatcher = hl.dsp.window.resize(),
desc = "Resize window",
},
{
keys = bind.with_leader("mouse:272"),
dispatcher = hl.dsp.window.drag(),
desc = "Drag window",
},
{
keys = bind.with_leader("mouse:273"),
dispatcher = hl.dsp.window.resize(),
desc = "Resize window",
},
})
M.binds = utils.list_extend(M.binds, {
{
keys = bind.with_leader("G"),
dispatcher = hl.dsp.group.toggle(),
desc = "Toggle a group",
},
{
keys = bind.with_leader("CTRL + Tab"),
dispatcher = hl.dsp.group.next(),
desc = "Switch to next window in group",
},
{
keys = bind.with_leader("CTRL + SHIFT + Tab"),
dispatcher = hl.dsp.group.prev(),
desc = "Switch to previous window in group",
},
{
keys = bind.with_leader("G"),
dispatcher = hl.dsp.group.toggle(),
desc = "Toggle a group",
},
{
keys = bind.with_leader("CTRL + Tab"),
dispatcher = hl.dsp.group.next(),
desc = "Switch to next window in group",
},
{
keys = bind.with_leader("CTRL + SHIFT + Tab"),
dispatcher = hl.dsp.group.prev(),
desc = "Switch to previous window in group",
},
})
return M
+44 -44
View File
@@ -6,53 +6,53 @@ local M = {}
M.binds = {}
for i = 1, 10 do
local n = tostring(i)
if n == "10" then
n = "0"
end
table.insert(M.binds, {
keys = bind.with_leader(n),
dispatcher = hl.dsp.focus({ workspace = i }),
desc = "Focus workspace " .. tostring(i),
})
table.insert(M.binds, {
keys = bind.with_leader("SHIFT + " .. n),
dispatcher = hl.dsp.window.move({ workspace = i, follow = true }),
desc = "Move window to workspace " .. tostring(i),
})
table.insert(M.binds, {
keys = bind.with_leader("CTRL + SHIFT + " .. n),
dispatcher = hl.dsp.window.move({ workspace = i, follow = false }),
desc = "Move window to workspace " .. tostring(i) .. " silently",
})
local n = tostring(i)
if n == "10" then
n = "0"
end
table.insert(M.binds, {
keys = bind.with_leader(n),
dispatcher = hl.dsp.focus({ workspace = i }),
desc = "Focus workspace " .. tostring(i),
})
table.insert(M.binds, {
keys = bind.with_leader("SHIFT + " .. n),
dispatcher = hl.dsp.window.move({ workspace = i, follow = true }),
desc = "Move window to workspace " .. tostring(i),
})
table.insert(M.binds, {
keys = bind.with_leader("CTRL + SHIFT + " .. n),
dispatcher = hl.dsp.window.move({ workspace = i, follow = false }),
desc = "Move window to workspace " .. tostring(i) .. " silently",
})
end
M.binds = utils.list_extend(M.binds, {
{
keys = bind.with_leader("mouse_up"),
dispatcher = hl.dsp.focus({ workspace = "m-1" }),
desc = "Focus to prev workspace on current monitor",
},
{
keys = bind.with_leader("mouse_down"),
dispatcher = hl.dsp.focus({ workspace = "m+1" }),
desc = "Focus to next workspace on current monitor",
},
{
keys = bind.with_leader("CTRL + down"),
dispatcher = hl.dsp.focus({ workspace = "emptynm" }),
desc = "Focus to next empty workspace",
},
{
keys = bind.with_leader("CTRL + left"),
dispatcher = hl.dsp.focus({ workspace = "m-1" }),
desc = "Focus to prev workspace on current monitor",
},
{
keys = bind.with_leader("CTRL + right"),
dispatcher = hl.dsp.focus({ workspace = "m+1" }),
desc = "Focus to next workspace on current monitor",
},
{
keys = bind.with_leader("mouse_up"),
dispatcher = hl.dsp.focus({ workspace = "m-1" }),
desc = "Focus to prev workspace on current monitor",
},
{
keys = bind.with_leader("mouse_down"),
dispatcher = hl.dsp.focus({ workspace = "m+1" }),
desc = "Focus to next workspace on current monitor",
},
{
keys = bind.with_leader("CTRL + down"),
dispatcher = hl.dsp.focus({ workspace = "emptynm" }),
desc = "Focus to next empty workspace",
},
{
keys = bind.with_leader("CTRL + left"),
dispatcher = hl.dsp.focus({ workspace = "m-1" }),
desc = "Focus to prev workspace on current monitor",
},
{
keys = bind.with_leader("CTRL + right"),
dispatcher = hl.dsp.focus({ workspace = "m+1" }),
desc = "Focus to next workspace on current monitor",
},
})
return M
+30 -30
View File
@@ -3,36 +3,36 @@ local colorscheme = {}
-- currently, only catppuccin is considerd
if settings["colorscheme"] == "catppuccin" or settings["colorscheme"] == "catppuccin-mocha" or true then
colorscheme.rosewater = "#f5e0dc"
colorscheme.flamingo = "#f2cdcd"
colorscheme.pink = "#f5c2e7"
colorscheme.mauve = "#cba6f7"
colorscheme.red = "#f38ba8"
colorscheme.maroon = "#eba0ac"
colorscheme.peach = "#fab387"
colorscheme.yellow = "#f9e2af"
colorscheme.green = "#a6e3a1"
colorscheme.teal = "#94e2d5"
colorscheme.sky = "#89dceb"
colorscheme.sapphire = "#74c7ec"
colorscheme.blue = "#89b4fa"
colorscheme.lavender = "#b4befe"
colorscheme.text = "#cdd6f4"
colorscheme.subtext1 = "#bac2de"
colorscheme.subtext0 = "#a6adc8"
colorscheme.overlay2 = "#9399b2"
colorscheme.overlay1 = "#7f849c"
colorscheme.overlay0 = "#6c7086"
colorscheme.surface2 = "#585b70"
colorscheme.surface1 = "#45475a"
colorscheme.surface0 = "#313244"
colorscheme.base = "#1e1e2e"
colorscheme.mantle = "#181825"
colorscheme.crust = "#11111b"
colorscheme.foreground = colorscheme.text
colorscheme.background = colorscheme.base
colorscheme.accent = colorscheme.blue
colorscheme.second = colorscheme.sky
colorscheme.rosewater = "#f5e0dc"
colorscheme.flamingo = "#f2cdcd"
colorscheme.pink = "#f5c2e7"
colorscheme.mauve = "#cba6f7"
colorscheme.red = "#f38ba8"
colorscheme.maroon = "#eba0ac"
colorscheme.peach = "#fab387"
colorscheme.yellow = "#f9e2af"
colorscheme.green = "#a6e3a1"
colorscheme.teal = "#94e2d5"
colorscheme.sky = "#89dceb"
colorscheme.sapphire = "#74c7ec"
colorscheme.blue = "#89b4fa"
colorscheme.lavender = "#b4befe"
colorscheme.text = "#cdd6f4"
colorscheme.subtext1 = "#bac2de"
colorscheme.subtext0 = "#a6adc8"
colorscheme.overlay2 = "#9399b2"
colorscheme.overlay1 = "#7f849c"
colorscheme.overlay0 = "#6c7086"
colorscheme.surface2 = "#585b70"
colorscheme.surface1 = "#45475a"
colorscheme.surface0 = "#313244"
colorscheme.base = "#1e1e2e"
colorscheme.mantle = "#181825"
colorscheme.crust = "#11111b"
colorscheme.foreground = colorscheme.text
colorscheme.background = colorscheme.base
colorscheme.accent = colorscheme.blue
colorscheme.second = colorscheme.sky
end
return colorscheme
+10 -10
View File
@@ -6,19 +6,19 @@ M.cursor = "Vimix-Hyprcursor"
M.size = 32
function M.fetch_Vimix_hyprcursor()
if M.cursor == "Vimix-Hyprcursor" then
if not utils.is_file_exists(DATA_HOME .. "/icons/Vimix-Hyprcursor") then
local tmppath = "/tmp/Vimix-Hyprcursor"
os.execute("git clone https://gitea.phy-yingjie.wang/wyj/Vimix-Hyprcursor.git " .. tmppath)
os.execute("cp " .. tmppath .. "/theme_Vimix-Hyprcursor " .. DATA_HOME .. "/icons/Vimix-Hyprcursor")
end
end
if M.cursor == "Vimix-Hyprcursor" then
if not utils.is_file_exists(DATA_HOME .. "/icons/Vimix-Hyprcursor") then
local tmppath = "/tmp/Vimix-Hyprcursor"
os.execute("git clone https://gitea.phy-yingjie.wang/wyj/Vimix-Hyprcursor.git " .. tmppath)
os.execute("cp " .. tmppath .. "/theme_Vimix-Hyprcursor " .. DATA_HOME .. "/icons/Vimix-Hyprcursor")
end
end
end
function M.load()
M.fetch_Vimix_hyprcursor()
hl.env("HYPRCURSOR_THEME", M.cursor)
hl.env("HYPRCURSOR_SIZE", tostring(M.size))
M.fetch_Vimix_hyprcursor()
hl.env("HYPRCURSOR_THEME", M.cursor)
hl.env("HYPRCURSOR_SIZE", tostring(M.size))
end
return M
+42 -42
View File
@@ -3,51 +3,51 @@ local colorscheme = require("lua.conf.colorscheme")
--local settings = require("lua.lib.settings")
M.confs = {
general = {
gaps_in = 10,
gaps_out = 14,
border_size = 2,
col = { active_border = colorscheme.accent, inactive_border = colorscheme.foreground .. "a0" },
},
group = {
col = { border_active = colorscheme.second, border_inactive = colorscheme.foreground .. "a0" },
groupbar = {
font_size = 12,
text_color = colorscheme.foreground,
height = 16,
gradients = false,
col = { active = colorscheme.teal, inactive = colorscheme.accent },
},
},
decoration = {
rounding = 12,
rounding_power = 3.0,
blur = {
enabled = true,
size = 12,
passes = 3,
noise = 0.06,
new_optimizations = true,
ignore_opacity = true,
xray = false,
popups = true,
popups_ignorealpha = 0.3,
},
active_opacity = 1.0,
inactive_opacity = 0.8,
fullscreen_opacity = 1.0,
shadow = {
enabled = true,
range = 15,
render_power = 2,
color = 0xbb000000,
offset = { 1, 1 },
},
},
general = {
gaps_in = 10,
gaps_out = 14,
border_size = 2,
col = { active_border = colorscheme.accent, inactive_border = colorscheme.foreground .. "a0" },
},
group = {
col = { border_active = colorscheme.second, border_inactive = colorscheme.foreground .. "a0" },
groupbar = {
font_size = 12,
text_color = colorscheme.foreground,
height = 16,
gradients = false,
col = { active = colorscheme.teal, inactive = colorscheme.accent },
},
},
decoration = {
rounding = 12,
rounding_power = 3.0,
blur = {
enabled = true,
size = 12,
passes = 3,
noise = 0.06,
new_optimizations = true,
ignore_opacity = true,
xray = false,
popups = true,
popups_ignorealpha = 0.3,
},
active_opacity = 1.0,
inactive_opacity = 0.8,
fullscreen_opacity = 1.0,
shadow = {
enabled = true,
range = 15,
render_power = 2,
color = 0xbb000000,
offset = { 1, 1 },
},
},
}
function M.load()
hl.config(M.confs)
hl.config(M.confs)
end
return M
+12 -6
View File
@@ -1,16 +1,22 @@
local settings = require("lua.lib.settings")
local M = {}
---@type table<string, string>
M.envs = {
XDG_SESSION_TYPE = "wayland",
XDG_SESSION_DESKTOP = "Hyprland",
QT_AUTO_SCREEN_SCALE_FACTOR = "1",
XDG_SESSION_TYPE = "wayland",
XDG_SESSION_DESKTOP = "Hyprland",
QT_AUTO_SCREEN_SCALE_FACTOR = "1",
}
if settings["locale"] and settings["locale"] ~= "" then
M.envs["LANG"] = settings["locale"]
end
function M.load()
for name, value in pairs(M.envs) do
hl.env(name, value)
end
for name, value in pairs(M.envs) do
hl.env(name, value)
end
end
return M
+15 -1
View File
@@ -1,7 +1,7 @@
local settings = require("lua.lib.settings")
require("lua.lib.globals")
require("lua.conf.monitor")
require("lua.conf.monitor"):load()
require("lua.conf.wallpaper").load()
require("lua.conf.cursor").load()
@@ -15,3 +15,17 @@ require("lua.conf.layerrules").load()
require("lua.binds").load()
require("lua.modules").load()
require("lua.plugins").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
+26 -17
View File
@@ -1,34 +1,43 @@
local M = {}
local settings = require("lua.lib.settings")
local utils = require("lua.lib.utils")
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.gestures = {
{
fingures = 3,
direction = "horizontal",
action = "workspace",
},
}
M.confs.gestures = table.insert(M.confs.gestures, { workspace_swipe_touch = true })
M.gestures = {
{
fingers = 3,
direction = "horizontal",
action = "workspace",
},
}
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"]
function M.load()
hl.config(M.confs)
if M.gestures then
for _, gesture in pairs(M.gestures) do
hl.gesture(gesture)
end
end
hl.config(M.confs)
if M.gestures then
for _, gesture in pairs(M.gestures) do
hl.gesture(gesture)
end
end
end
return M
+43 -43
View File
@@ -1,56 +1,56 @@
local M = {}
M.layer_rules = {
{
name = "blur-basic-layers",
match = {
namespace = "^(gtk-layer-shell|logout_dialog|nwg-drawer)$",
},
blur = true,
},
{
name = "blur-basic-layers",
match = {
namespace = "^(gtk-layer-shell|logout_dialog|nwg-drawer)$",
},
blur = true,
},
{
name = "waybar-translucent-popups",
match = {
namespace = "^(waybar)$",
},
blur_popups = true,
ignore_alpha = 0.10,
},
{
name = "waybar-translucent-popups",
match = {
namespace = "^(waybar)$",
},
blur_popups = true,
ignore_alpha = 0.10,
},
{
name = "rofi-blurred-xray",
match = {
namespace = "^(rofi)$",
},
blur = true,
xray = true,
ignore_alpha = 0,
},
{
name = "rofi-blurred-xray",
match = {
namespace = "^(rofi)$",
},
blur = true,
xray = true,
ignore_alpha = 0,
},
{
name = "swaync-control-center-blur",
match = {
namespace = "^(swaync-control-center)$",
},
blur = true,
ignore_alpha = 0.5,
},
{
name = "swaync-control-center-blur",
match = {
namespace = "^(swaync-control-center)$",
},
blur = true,
ignore_alpha = 0.5,
},
{
name = "swayosd-blur",
match = {
namespace = "^(swayosd)$",
},
blur = true,
ignore_alpha = 0.3,
},
{
name = "swayosd-blur",
match = {
namespace = "^(swayosd)$",
},
blur = true,
ignore_alpha = 0.3,
},
}
function M.load()
for _, rule in ipairs(M.layer_rules) do
hl.layer_rule(rule)
end
for _, rule in ipairs(M.layer_rules) do
hl.layer_rule(rule)
end
end
return M
+10 -10
View File
@@ -2,19 +2,19 @@ local M = {}
local settings = require("lua.lib.settings")
M.confs = {
general = {
layout = settings["default_layout"],
},
dwindle = {
preserve_split = true,
},
master = {},
scrolling = {},
monocle = {},
general = {
layout = settings["default_layout"],
},
dwindle = {
preserve_split = true,
},
master = {},
scrolling = {},
monocle = {},
}
function M.load()
hl.config(M.confs)
hl.config(M.confs)
end
return M
+10 -10
View File
@@ -3,19 +3,19 @@ local colorscheme = require("lua.conf.colorscheme")
local settings = require("lua.lib.settings")
M.confs = {
misc = {
disable_hyprland_logo = true,
disable_splash_rendering = true,
vrr = true,
enable_swallow = true,
swallow_regex = "^(kitty|Alacritty)$",
background_color = colorscheme.background,
font_family = settings["font_family"],
},
misc = {
disable_hyprland_logo = true,
disable_splash_rendering = true,
vrr = 3,
enable_swallow = true,
swallow_regex = "^(kitty|Alacritty)$",
background_color = colorscheme.background,
font_family = settings["font_family"],
},
}
function M.load()
hl.config(M.confs)
hl.config(M.confs)
end
return M
+18 -5
View File
@@ -1,9 +1,22 @@
local settings = require("lua.lib.settings")
local utils = require("lua.lib.utils")
local M = {}
M.monitors = {}
if settings["host"] == "laptop" then
hl.monitor({
output = "eDP-1",
mode = "highres",
scale = "auto",
})
M.monitors = table.insert({ {
output = "eDP-1",
mode = "highres",
scale = "auto",
} })
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")
+4 -4
View File
@@ -2,13 +2,13 @@ local M = {}
local events = require("lua.lib.events")
M.autostart = {
function()
hl.exec_cmd("~/dotfiles/hypr/scripts/init-wallpaper-engine.sh")
end,
function()
hl.exec_cmd("~/dotfiles/hypr/scripts/init-wallpaper-engine.sh")
end,
}
function M.load()
events.map("hyprland.start", M.autostart)
events.map("hyprland.start", M.autostart)
end
return M
+38 -38
View File
@@ -1,47 +1,47 @@
local M = {}
M.window_rules = {
{
name = "floating-utils",
match = {
class = "^(pavucontrol|blueman-manager|nm-connection-editor|qalculate-gtk|xdg-desktop-portal-gtk)$",
},
float = true,
},
{
name = "floating-mathematica",
match = {
title = "^(Mathematica|WolframNB)$",
},
float = true,
},
{
name = "transparent-vscode",
match = {
class = "^(code|code-url-handler)$",
},
opacity = "0.8",
},
{
name = "floating-social-apps",
match = {
class = "^(QQ|wechat)$",
},
float = true,
},
{
name = "floating-download-manager",
match = {
class = "^(fdm)$",
},
float = true,
},
{
name = "floating-utils",
match = {
class = "^(pavucontrol|blueman-manager|nm-connection-editor|qalculate-gtk|xdg-desktop-portal-gtk)$",
},
float = true,
},
{
name = "floating-mathematica",
match = {
title = "^(Mathematica|WolframNB)$",
},
float = true,
},
{
name = "transparent-vscode",
match = {
class = "^(code|code-url-handler)$",
},
opacity = "0.8",
},
{
name = "floating-social-apps",
match = {
class = "^(QQ|wechat)$",
},
float = true,
},
{
name = "floating-download-manager",
match = {
class = "^(fdm)$",
},
float = true,
},
}
function M.load()
for _, rule in ipairs(M.window_rules) do
hl.window_rule(rule)
end
for _, rule in ipairs(M.window_rules) do
hl.window_rule(rule)
end
end
return M
+42 -42
View File
@@ -3,69 +3,69 @@ local bind = {}
bind.leader = "SUPER"
local function merge(...)
local out = {}
local out = {}
for _, t in ipairs({ ... }) do
if t ~= nil then
for k, v in pairs(t) do
out[k] = v
end
end
end
for _, t in ipairs({ ... }) do
if t ~= nil then
for k, v in pairs(t) do
out[k] = v
end
end
end
return out
return out
end
function bind.with_leader(keys)
if keys == nil or keys == "" then
return bind.leader
end
if keys == nil or keys == "" then
return bind.leader
end
return bind.leader .. " + " .. keys
return bind.leader .. " + " .. keys
end
function bind.key(keys, dispatcher, desc, opts)
local flags = merge(opts)
local flags = merge(opts)
if desc ~= nil then
flags.description = desc
end
if desc ~= nil then
flags.description = desc
end
return hl.bind(keys, dispatcher, flags)
return hl.bind(keys, dispatcher, flags)
end
function bind.set(table)
local keys = table.keys
local dispatcher = table.dispatcher
local desc = ""
local opts = {}
if table.desc ~= nil and table.desc ~= "" then
desc = table.desc
end
if table.opts ~= nil then
opts = table.opts
end
bind.key(keys, dispatcher, desc, opts)
local keys = table.keys
local dispatcher = table.dispatcher
local desc = ""
local opts = {}
if table.desc ~= nil and table.desc ~= "" then
desc = table.desc
end
if table.opts ~= nil then
opts = table.opts
end
bind.key(keys, dispatcher, desc, opts)
end
function bind.map(table)
for _, item in pairs(table) do
bind.set(item)
end
for _, item in pairs(table) do
bind.set(item)
end
end
function bind.layout_dispatcher(actions, fallback)
return function()
local ws = hl.get_active_special_workspace() or hl.get_active_workspace()
if not ws then
return
end
return function()
local ws = hl.get_active_special_workspace() or hl.get_active_workspace()
if not ws then
return
end
local action = actions[ws.tiled_layout] or fallback
if action then
hl.dispatch(action)
end
end
local action = actions[ws.tiled_layout] or fallback
if action then
hl.dispatch(action)
end
end
end
return bind
+3 -3
View File
@@ -1,9 +1,9 @@
local M = {}
function M.map(event, func_list)
for _, func in pairs(func_list) do
hl.on(event, func)
end
for _, func in pairs(func_list) do
hl.on(event, func)
end
end
return M
+2 -2
View File
@@ -1,12 +1,12 @@
HOME = os.getenv("HOME")
CONFIG_HOME = os.getenv("XDG_CONFIG_HOME")
if not CONFIG_HOME then
CONFIG_HOME = HOME .. "/.config"
CONFIG_HOME = HOME .. "/.config"
end
HYPR = CONFIG_HOME .. "/hypr"
USER_CONFIG = HYPR .. "/lua/user"
DATA_HOME = os.getenv("XDG_DATA_HOME")
if not DATA_HOME then
DATA_HOME = HOME .. "/.local/share"
DATA_HOME = HOME .. "/.local/share"
end
+19 -9
View File
@@ -12,6 +12,9 @@ settings["touchpad_natural_scroll"] = true
---@type string
settings["kb_layout"] = "us"
---@type string
settings["locale"] = ""
---@type "dwindle"|"master"|"scrolling"|"monocle"
settings["default_layout"] = "dwindle"
@@ -20,9 +23,9 @@ settings["font_family"] = "FiraCode Nerd Font"
---@type table<string, string>
settings["apps"] = {
terminal = "kitty",
file_manager = "thunar",
browser = "chromium",
terminal = "kitty",
file_manager = "thunar",
browser = "chromium",
}
---@type "catppuccin"|"catppuccin-mocha"
@@ -33,12 +36,19 @@ settings["systemd"] = false
---@type table<string, boolean>
settings["modules"] = {
hypridle = true,
waybar = true,
swaync = true,
swayosd = true,
cliphist = true,
pypr = true,
hypridle = true,
waybar = true,
swaync = true,
swayosd = true,
cliphist = 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")
+13 -13
View File
@@ -2,30 +2,30 @@ local utils = require("lua.lib.utils")
local M = {}
function M.is_user_unit_exists(unit)
return utils.command_success("systemctl --user cat " .. utils.shell_quote(unit) .. " >/dev/null 2>&1")
return utils.command_success("systemctl --user cat " .. utils.shell_quote(unit) .. " >/dev/null 2>&1")
end
M.user_unit_dir = CONFIG_HOME .. "/systemd/user"
function M.ensure_user_unit(unit, source)
if M.is_user_unit_exists(unit) then
return true
end
if M.is_user_unit_exists(unit) then
return true
end
local target_dir = M.user_unit_dir
local target = target_dir .. "/" .. unit
local target_dir = M.user_unit_dir
local target = target_dir .. "/" .. unit
local cmd = table.concat({
"mkdir -p " .. utils.shell_quote(target_dir),
"ln -s " .. utils.shell_quote(source) .. " " .. utils.shell_quote(target),
"systemctl --user daemon-reload",
}, " && ")
local cmd = table.concat({
"mkdir -p " .. utils.shell_quote(target_dir),
"ln -s " .. utils.shell_quote(source) .. " " .. utils.shell_quote(target),
"systemctl --user daemon-reload",
}, " && ")
return utils.command_success(cmd)
return utils.command_success(cmd)
end
function M.start_user_unit(unit)
return utils.command_success("systemctl --user start " .. utils.shell_quote(unit) .. " >/dev/null 2>&1")
return utils.command_success("systemctl --user start " .. utils.shell_quote(unit) .. " >/dev/null 2>&1")
end
return M
+82 -80
View File
@@ -3,132 +3,134 @@ require("lua.lib.globals")
local M = {}
local function is_table(x)
return type(x) == "table"
return type(x) == "table"
end
local function is_list(t)
if type(t) ~= "table" then
return false
end
if type(t) ~= "table" then
return false
end
local n = 0
local n = 0
for k, _ in pairs(t) do
if type(k) ~= "number" then
return false
end
for k, _ in pairs(t) do
if type(k) ~= "number" then
return false
end
if k > n then
n = k
end
end
if k > n then
n = k
end
end
for i = 1, n do
if t[i] == nil then
return false
end
end
for i = 1, n do
if t[i] == nil then
return false
end
end
return true
return true
end
function M.list_extend(dst, src)
for _, value in ipairs(src) do
table.insert(dst, value)
end
for _, value in ipairs(src) do
table.insert(dst, value)
end
return dst
return dst
end
local function deepcopy(value, seen)
if type(value) ~= "table" then
return value
end
if type(value) ~= "table" then
return value
end
seen = seen or {}
if seen[value] then
return seen[value]
end
seen = seen or {}
if seen[value] then
return seen[value]
end
local result = {}
seen[value] = result
local result = {}
seen[value] = result
for k, v in pairs(value) do
result[deepcopy(k, seen)] = deepcopy(v, seen)
end
for k, v in pairs(value) do
result[deepcopy(k, seen)] = deepcopy(v, seen)
end
return result
return result
end
function M.tbl_recursive_merge(defaults, overrides)
local result = deepcopy(defaults)
local result = deepcopy(defaults)
if not is_table(overrides) then
return result
end
if not is_table(overrides) then
return result
end
for key, value in pairs(overrides) do
if is_table(value) and is_table(result[key]) then
result[key] = M.tbl_recursive_merge(result[key], value)
else
result[key] = deepcopy(value)
end
end
for key, value in pairs(overrides) do
if is_table(value) and is_table(result[key]) then
result[key] = M.tbl_recursive_merge(result[key], value)
else
result[key] = deepcopy(value)
end
end
return result
return result
end
function M.extend_config(defaults, user_module)
if not M.is_file_exists(HYPR .. user_module) then
return deepcopy(defaults)
end
local ok, overrides = pcall(require, user_module)
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)
if not ok then
return deepcopy(defaults)
end
if not ok then
return deepcopy(defaults)
end
if type(overrides) ~= "table" then
return deepcopy(defaults)
end
if type(overrides) ~= "table" then
return deepcopy(defaults)
end
return M.tbl_recursive_merge(defaults, overrides)
return M.tbl_recursive_merge(defaults, overrides)
end
function M.is_file_exists(name)
local f = io.open(name, "r")
if f ~= nil then
io.close(f)
return true
else
return false
end
local f = io.open(name, "r")
if f ~= nil then
io.close(f)
return true
else
return false
end
end
function M.exec_if_file_extes(file)
if M.is_file_exists(file) then
hl.exec_cmd(file)
else
hl.notification.create({ file .. " doesn't extist", 5000, 0 })
end
if M.is_file_exists(file) then
hl.exec_cmd(file)
else
hl.notification.create({ file .. " doesn't extist", 5000, 0 })
end
end
function M.create_if_not_exists(path)
if not M.is_file_exists(path) then
os.execute('mkdir -pv "$(dirname "' .. path .. '")"')
os.execute("touch " .. path)
return true
end
return false
if not M.is_file_exists(path) then
os.execute('mkdir -pv "$(dirname "' .. path .. '")"')
os.execute("touch " .. path)
return true
end
return false
end
function M.shell_quote(s)
return "'" .. tostring(s):gsub("'", "'\\''") .. "'"
return "'" .. tostring(s):gsub("'", "'\\''") .. "'"
end
function M.command_success(cmd)
local ok = os.execute(cmd)
return ok == true or ok == 0
local ok = os.execute(cmd)
return ok == true or ok == 0
end
return M
+2 -2
View File
@@ -1,11 +1,11 @@
local M = {}
local function start_wl_clipboard()
hl.exec_cmd("wl-paste --watch cliphist store")
hl.exec_cmd("wl-paste --watch cliphist store")
end
M.autostart = {
start_wl_clipboard,
start_wl_clipboard,
}
return M
+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
+2 -2
View File
@@ -1,11 +1,11 @@
local M = {}
local function start_hypridle()
hl.exec_cmd("hypridle")
hl.exec_cmd("hypridle")
end
M.autostart = {
start_hypridle,
start_hypridle,
}
return M
+37 -25
View File
@@ -8,53 +8,65 @@ local M = {}
local modules = {}
local function is_module_exists(name)
return utils.is_file_exists(HYPR .. "/lua/modules/" .. name .. ".lua")
return utils.is_file_exists(HYPR .. "/lua/modules/" .. name .. ".lua")
end
local function load_module(name)
if not is_module_exists(name) then
return {}
end
local default_mod = require("lua.modules." .. name)
if not is_module_exists(name) then
return {}
end
local default_mod = require("lua.modules." .. name)
local user_modname = "lua.user.modules." .. name
local mod = utils.extend_config(default_mod, user_modname)
local user_modname = "lua.user.modules." .. name
local mod = utils.extend_config(default_mod, user_modname)
return mod
return mod
end
for name, enabled in pairs(settings.modules) do
if enabled then
local mod = load_module(name)
table.insert(modules, {
name = name,
config = mod,
})
end
if enabled then
local mod = load_module(name)
print("module " .. name .. " loaded.")
table.insert(modules, {
name = name,
config = mod,
})
end
end
M.autostart = {}
M.autostop = {}
M.binds = {}
M.envs = {}
M.windowrules = {}
local function collect_modules_prop(module, prop)
if module[prop] then
M[prop] = utils.list_extend(M[prop], module[prop])
end
if module[prop] then
M[prop] = utils.list_extend(M[prop], module[prop])
end
end
for _, item in ipairs(modules) do
local module = item.config
collect_modules_prop(module, "autostart")
collect_modules_prop(module, "autostop")
collect_modules_prop(module, "binds")
local module = item.config
collect_modules_prop(module, "autostart")
collect_modules_prop(module, "autostop")
collect_modules_prop(module, "binds")
collect_modules_prop(module, "envs")
collect_modules_prop(module, "windowrules")
end
function M.load()
events.map("hyprland.start", M.autostart)
events.map("hyprland.shutdown", M.autostop)
events.map("hyprland.start", M.autostart)
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
return M
+17 -7
View File
@@ -2,19 +2,29 @@ local bind = require("lua.lib.bind")
local M = {}
local function start_pypr()
hl.exec_cmd("pypr")
hl.exec_cmd("pypr")
end
M.autostart = {
start_pypr,
start_pypr,
}
M.binds = {
{
keys = bind.with_leader("SHIFT + Return"),
dispatcher = hl.dsp.exec_cmd("pypr toggle term"),
desc = "Pyprland: toggle drop terminal",
},
{
keys = bind.with_leader("SHIFT + Return"),
dispatcher = hl.dsp.exec_cmd("pypr toggle term"),
desc = "Pyprland: toggle drop terminal",
},
}
M.windowrules = {
{
name = "Pyprland rules",
match = {
class = "kitty-dropterm"
},
float = true,
}
}
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
+16 -16
View File
@@ -5,32 +5,32 @@ require("lua.lib.globals")
local M = {}
local function start_swaync()
if settings["systemd"] then
local unit = "swaync.service"
local source = CONFIG_HOME .. "hypr/systemd/" .. unit
if settings["systemd"] then
local unit = "swaync.service"
local source = HYPR .. "/systemd/" .. unit
if systemd.ensure_user_unit(unit, source) then
hl.exec_cmd("systemctl --user start swaync")
else
hl.exec_cmd("swaync")
end
else
hl.exec_cmd("swaync")
end
if systemd.ensure_user_unit(unit, source) then
hl.exec_cmd("systemctl --user start swaync")
else
hl.exec_cmd("swaync")
end
else
hl.exec_cmd("swaync")
end
end
local function stop_swaync()
if settings["systemd"] and utils.command_success("systemctl --user status swaync") then
hl.exec_cmd("systemctl --user stop swaync")
end
if settings["systemd"] and utils.command_success("systemctl --user status swaync") then
hl.exec_cmd("systemctl --user stop swaync")
end
end
M.autostart = {
start_swaync,
start_swaync,
}
M.autostop = {
stop_swaync,
stop_swaync,
}
return M
+79 -81
View File
@@ -6,103 +6,101 @@ require("lua.lib.globals")
local M = {}
local function start_swayosd()
if settings["systemd"] then
local unit = "swayosd.service"
local source = CONFIG_HOME .. "hypr/systemd/" .. unit
if settings["systemd"] then
local unit = "swayosd.service"
local source = HYPR .. "/systemd/" .. unit
if systemd.ensure_user_unit(unit, source) then
hl.exec_cmd("systemctl --user start swayosd")
else
hl.exec_cmd("swayosd-server")
end
else
hl.exec_cmd("swayosd-server")
end
if systemd.ensure_user_unit(unit, source) then
hl.exec_cmd("systemctl --user start swayosd")
else
hl.exec_cmd("swayosd-server")
end
else
hl.exec_cmd("swayosd-server")
end
end
local function stop_swayosd()
if settings["systemd"] and utils.command_success("systemctl --user status swayosd") then
hl.exec_cmd("systemctl --user stop swayosd")
else
hl.exec_cmd("pkill -9 swayosd-server")
end
if settings["systemd"] and utils.command_success("systemctl --user status swayosd") then
hl.exec_cmd("systemctl --user stop swayosd")
else
hl.exec_cmd("pkill -9 swayosd-server")
end
end
M.autostart = {
start_swayosd,
start_swayosd,
}
M.autostop = {
stop_swayosd,
stop_swayosd,
}
local function swayosd_client_cmd(args)
return hl.dsp.exec_cmd("swayosd-client " .. args)
return hl.dsp.exec_cmd("swayosd-client " .. args)
end
M.binds = {
{
keys = "XF86MonBrightnessUp",
dispatcher = function()
swayosd_client_cmd("--brightness raise")
end,
dosc = "Increase brightness ",
opts = { long_press = true, locked = true },
},
{
keys = "XF86MonBrightnessDown",
dispatcher = swayosd_client_cmd("--brightness lower"),
desc = "Decrease brightness ",
opts = { long_press = true, locked = true },
},
{
keys = "XF86AudioRaiseVolume",
dispatcher = swayosd_client_cmd("--output-volume raise"),
desc = "Increase brightness ",
opts = { long_press = true, locked = true },
},
{
keys = "XF86AudioLowerVolume",
dispatcher = swayosd_client_cmd("--output-volume lower"),
desc = "Decrease brightness ",
opts = { long_press = true, locked = true },
},
{
keys = "XF86AudioMute",
dispatcher = swayosd_client_cmd("--output-volume mute-toggle"),
desc = "Toggle output mute",
opts = { long_press = true, locked = true },
},
{
keys = "XF86AudioMicMute",
dispatcher = swayosd_client_cmd("--input-volume mute-toggle"),
desc = "Toggle input mute",
opts = { long_press = true, locked = true },
},
{
keys = "XF86AudioPlay",
dispatcher = swayosd_client_cmd("--playerctl play-pause"),
desc = "Player play/pause",
opts = { locked = true },
},
{
keys = "XF86AudioPause",
dispatcher = swayosd_client_cmd("--playerctl pause"),
desc = "Player pause",
opts = { locked = true },
},
{
keys = "XF86AudioNext",
dispatcher = swayosd_client_cmd("--playerctl next"),
desc = "Player next",
opts = { locked = true },
},
{
keys = "XF86AudioPrev",
dispatcher = swayosd_client_cmd("--playerctl prev"),
desc = "Player previous",
opts = { locked = true },
},
{
keys = "XF86MonBrightnessUp",
dispatcher = swayosd_client_cmd("--brightness raise"),
dosc = "Increase brightness ",
opts = { repeating = true, locked = true },
},
{
keys = "XF86MonBrightnessDown",
dispatcher = swayosd_client_cmd("--brightness lower"),
desc = "Decrease brightness ",
opts = { repeating = true, locked = true },
},
{
keys = "XF86AudioRaiseVolume",
dispatcher = swayosd_client_cmd("--output-volume raise"),
desc = "Increase brightness ",
opts = { repeating = true, locked = true },
},
{
keys = "XF86AudioLowerVolume",
dispatcher = swayosd_client_cmd("--output-volume lower"),
desc = "Decrease brightness ",
opts = { repeating = true, locked = true },
},
{
keys = "XF86AudioMute",
dispatcher = swayosd_client_cmd("--output-volume mute-toggle"),
desc = "Toggle output mute",
opts = { repeating = true, locked = true },
},
{
keys = "XF86AudioMicMute",
dispatcher = swayosd_client_cmd("--input-volume mute-toggle"),
desc = "Toggle input mute",
opts = { repeating = true, locked = true },
},
{
keys = "XF86AudioPlay",
dispatcher = swayosd_client_cmd("--playerctl play-pause"),
desc = "Player play/pause",
opts = { locked = true },
},
{
keys = "XF86AudioPause",
dispatcher = swayosd_client_cmd("--playerctl pause"),
desc = "Player pause",
opts = { locked = true },
},
{
keys = "XF86AudioNext",
dispatcher = swayosd_client_cmd("--playerctl next"),
desc = "Player next",
opts = { locked = true },
},
{
keys = "XF86AudioPrev",
dispatcher = swayosd_client_cmd("--playerctl prev"),
desc = "Player previous",
opts = { locked = true },
},
}
return M
+12 -12
View File
@@ -2,24 +2,24 @@ local M = {}
local bind = require("lua.lib.bind")
local function start_waybar()
hl.exec_cmd("~/dotfiles/waybar/launch.sh")
hl.exec_cmd("~/dotfiles/waybar/launch.sh")
end
M.autostart = {
start_waybar,
start_waybar,
}
M.binds = {
{
keys = bind.with_leader("SHIFT + B"),
dispatcher = hl.dsp.exec_cmd("~/dotfiles/waybar/launch.sh"),
desc = "(re)launch waybar",
},
{
keys = bind.with_leader("CTRL + B"),
dispatcher = hl.dsp.exec_cmd("~/dotfiles/waybar/toggle.sh"),
desc = "toggle waybar",
},
{
keys = bind.with_leader("SHIFT + B"),
dispatcher = hl.dsp.exec_cmd("~/dotfiles/waybar/launch.sh"),
desc = "(re)launch waybar",
},
{
keys = bind.with_leader("CTRL + B"),
dispatcher = hl.dsp.exec_cmd("~/dotfiles/waybar/toggle.sh"),
desc = "toggle waybar",
},
}
return M
+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"])
-7
View File
@@ -1,7 +0,0 @@
#!/bin/bash
# Remove gamemode flag
if [ -f ~/.cache/gamemode ] ;then
rm ~/.cache/gamemode
echo ":: ~/.cache/gamemode removed"
fi
-52
View File
@@ -1,52 +0,0 @@
#!/bin/bash
# ____ _ _
# | _ \(_) __ _ __ _ _ __ ___ ___(_)___
# | | | | |/ _` |/ _` | '_ \ / _ \/ __| / __|
# | |_| | | (_| | (_| | | | | (_) \__ \ \__ \
# |____/|_|\__,_|\__, |_| |_|\___/|___/_|___/
# |___/
#
clear
sleep 0.5
figlet "Diagnosis"
echo
echo "This script will check that essential packages and "
echo "execution commands are available on your system."
echo
_commandExists() {
package="$1";
if ! type $package > /dev/null 2>&1; then
echo ":: ERROR: $package doesn't exists. Please install it with yay -S $2"
else
echo ":: OK: $package found."
fi
}
_folderExists() {
folder="$1";
if [ ! -d $folder ]; then
echo ":: ERROR: $folder doesn't exists."
else
echo ":: OK: $folder found."
fi
}
_commandExists "rofi" "rofi-wayland"
_commandExists "dunst" "dunst"
_commandExists "waybar" "waybar"
_commandExists "hyprpaper" "hyprpaper"
_commandExists "hyprlock" "hyprpaper"
_commandExists "hypridle" "hyprpaper"
_commandExists "wal" "python-pywal"
_commandExists "gum" "gum"
_commandExists "wlogout" "wlogout"
_commandExists "swww" "swww"
_commandExists "eww" "eww"
_commandExists "magick" "imagemagick"
_commandExists "figlet" "figlet"
echo
echo "Press return to exit"
read
-32
View File
@@ -1,32 +0,0 @@
#!/bin/bash
clear
cat <<"EOF"
____ _ _ _ ____ __ __
| _ \(_)___ __ _| |__ | | ___| _ \| \/ |
| | | | / __|/ _` | '_ \| |/ _ \ | | | |\/| |
| |_| | \__ \ (_| | |_) | | __/ |_| | | | |
|____/|_|___/\__,_|_.__/|_|\___|____/|_| |_|
EOF
echo "Hyprland recommends the start with the tty login."
echo "You can deactivate the current display manager (if exists)."
echo ""
echo "-> Do you really want to deactivate the display manager?"
while true; do
read -p "Do you want to enable the sddm display manager and setup theme? (Yy/Nn): " yn
case $yn in
[Yy]* )
if [ -f /etc/systemd/system/display-manager.service ]; then
sudo rm /etc/systemd/system/display-manager.service
echo "Current display manager removed."
else
echo "No active display manager found."
fi
break;;
[Nn]* )
exit
break;;
* ) echo "Please answer yes or no.";;
esac
done
-11
View File
@@ -1,11 +0,0 @@
#!/bin/bash
# _____ ____ __
# / _ \ \ /\ / /\ \ /\ / /
# | __/\ V V / \ V V /
# \___| \_/\_/ \_/\_/
#
EWW=`which eww`
if [[ ! `pidof eww` ]]; then
${EWW} daemon
sleep 0.5
fi
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
sleep 0.5
killall -9 Hyprland sleep 2
-24
View File
@@ -1,24 +0,0 @@
#!/bin/bash
# ____ _
# / ___| __ _ _ __ ___ ___ _ __ ___ ___ __| | ___
# | | _ / _` | '_ ` _ \ / _ \ '_ ` _ \ / _ \ / _` |/ _ \
# | |_| | (_| | | | | | | __/ | | | | | (_) | (_| | __/
# \____|\__,_|_| |_| |_|\___|_| |_| |_|\___/ \__,_|\___|
#
if [ -f ~/.cache/gamemode ] ;then
hyprctl reload
rm ~/.cache/gamemode
notify-send "Gamemode deactivated" "Animations and blur enabled"
else
hyprctl --batch "\
keyword animations:enabled 0;\
keyword decoration:drop_shadow 0;\
keyword decoration:blur:enabled 0;\
keyword general:gaps_in 0;\
keyword general:gaps_out 0;\
keyword general:border_size 1;\
keyword decoration:rounding 0"
touch ~/.cache/gamemode
notify-send "Gamemode activated" "Animations and blur disabled"
fi
-35
View File
@@ -1,35 +0,0 @@
#!/bin/bash
# ____ _____ _ __
# / ___|_ _| |/ /
# | | _ | | | ' /
# | |_| | | | | . \
# \____| |_| |_|\_\
#
# Source: https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
config="$HOME/.config/gtk-3.0/settings.ini"
if [ ! -f "$config" ]; then exit 1; fi
gnome_schema="org.gnome.desktop.interface"
gtk_theme="$(grep 'gtk-theme-name' "$config" | sed 's/.*\s*=\s*//')"
icon_theme="$(grep 'gtk-icon-theme-name' "$config" | sed 's/.*\s*=\s*//')"
cursor_theme="$(grep 'gtk-cursor-theme-name' "$config" | sed 's/.*\s*=\s*//')"
cursor_size="$(grep 'gtk-cursor-theme-size' "$config" | sed 's/.*\s*=\s*//')"
font_name="$(grep 'gtk-font-name' "$config" | sed 's/.*\s*=\s*//')"
echo $gtk_theme
echo $icon_theme
echo $cursor_theme
echo $cursor_size
echo $font_name
gsettings set "$gnome_schema" gtk-theme "$gtk_theme"
gsettings set "$gnome_schema" icon-theme "$icon_theme"
gsettings set "$gnome_schema" cursor-theme "$cursor_theme"
gsettings set "$gnome_schema" font-name "$font_name"
gsettings set "$gnome_schema" color-scheme "prefer-dark"
# if [ -f ~/dotfiles/hypr/conf/cursor.conf ] ;then
# echo "exec-once = hyprctl setcursor $cursor_theme $cursor_size" > ~/dotfiles/hypr/conf/cursor.conf
# hyprctl setcursor $cursor_theme $cursor_size
# fi
-49
View File
@@ -1,49 +0,0 @@
#!/bin/bash
# _ _ _ _ _
# | | _____ _ _| |__ (_)_ __ __| (_)_ __ __ _ ___
# | |/ / _ \ | | | '_ \| | '_ \ / _` | | '_ \ / _` / __|
# | < __/ |_| | |_) | | | | | (_| | | | | | (_| \__ \
# |_|\_\___|\__, |_.__/|_|_| |_|\__,_|_|_| |_|\__, |___/
# |___/ |___/
# by Stephan Raabe (2023)
# -----------------------------------------------------
# -----------------------------------------------------
# Get keybindings location based on variation
# -----------------------------------------------------
config_file=$(cat ~/dotfiles/hypr/conf/keybinding.conf)
config_file=${config_file/source = ~/}
config_file=${config_file/source=~/}
# -----------------------------------------------------
# Path to keybindings config file
# -----------------------------------------------------
config_file="/home/$USER$config_file"
echo "Reading from: $config_file"
keybinds=""
# Detect Start String
while read -r line
do
if [[ "$line" == "bind"* ]]; then
line="$(echo "$line" | sed 's/$mainMod/SUPER/g')"
line="$(echo "$line" | sed 's/bind = //g')"
line="$(echo "$line" | sed 's/bindm = //g')"
IFS='#'
read -a strarr <<<"$line"
kb_str=${strarr[0]}
cm_str=${strarr[1]}
IFS=','
read -a kbarr <<<"$kb_str"
item="${kbarr[0]} + ${kbarr[1]}"$'\r'"${cm_str:1}"
keybinds=$keybinds$item$'\n'
fi
done < "$config_file"
sleep 0.2
rofi -dmenu -i -markup -eh 2 -replace -p "Keybinds" -config ~/dotfiles/rofi/config-compact.rasi <<< "$keybinds"
-2
View File
@@ -1,2 +0,0 @@
#!/bin/bash
hyprctl reload
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
sleep 0.5
hyprlock
-2
View File
@@ -1,2 +0,0 @@
#!/bin/bash
hyprctl -j monitors
-42
View File
@@ -1,42 +0,0 @@
#!/bin/bash
# ____
# | _ \ _____ _____ _ __
# | |_) / _ \ \ /\ / / _ \ '__|
# | __/ (_) \ V V / __/ |
# |_| \___/ \_/\_/ \___|_|
#
if [[ "$1" == "exit" ]]; then
echo ":: Exit"
hyprctl dispatch exit
fi
if [[ "$1" == "lock" ]]; then
echo ":: Lock"
sleep 0.5
hyprlock
fi
if [[ "$1" == "reboot" ]]; then
echo ":: Reboot"
sleep 0.5
systemctl reboot
fi
if [[ "$1" == "shutdown" ]]; then
echo ":: Shutdown"
sleep 0.5
systemctl poweroff
fi
if [[ "$1" == "suspend" ]]; then
echo ":: Suspend"
sleep 0.5
systemctl suspend
fi
if [[ "$1" == "hibernate" ]]; then
echo ":: Hibernate"
sleep 1;
systemctl hibernate
fi
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
sleep 0.5
systemctl reboot
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
sleep 0.5
systemctl poweroff
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
sleep 0.5
systemctl suspend
-13
View File
@@ -1,13 +0,0 @@
#!/bin/bash
cache_file="$HOME/.cache/toggle_animation"
if [[ $(cat $HOME/dotfiles/hypr/conf/animation.conf) == *"disabled"* ]]; then
echo ":: Toggle blocked by disabled.conf variation."
else
if [ -f $cache_file ] ;then
hyprctl keyword animations:enabled true
rm $cache_file
else
hyprctl keyword animations:enabled false
touch $cache_file
fi
fi
-11
View File
@@ -1,11 +0,0 @@
#!/bin/bash
# _ _ _ __ _ _
# / \ | | |/ _| | ___ __ _| |_
# / _ \ | | | |_| |/ _ \ / _` | __|
# / ___ \| | | _| | (_) | (_| | |_
# /_/ \_\_|_|_| |_|\___/ \__,_|\__|
#
# by Stephan Raabe (2023)
# -----------------------------------------------------
hyprctl dispatch workspaceopt allfloat
+1 -1
View File
@@ -101,7 +101,7 @@ echo $newwall
# -----------------------------------------------------
# Reload waybar with new colors
# -----------------------------------------------------
~/dotfiles/waybar/launch.sh
#~/dotfiles/waybar/launch.sh
# -----------------------------------------------------
# Set the new wallpaper
-27
View File
@@ -1,27 +0,0 @@
#!/bin/bash
# __ ______ ____
# \ \/ / _ \ / ___|
# \ /| | | | | _
# / \| |_| | |_| |
# /_/\_\____/ \____|
#
# -----------------------------------------------------
sleep 1
# kill all possible running xdg-desktop-portals
killall -e xdg-desktop-portal-hyprland
killall -e xdg-desktop-portal-gnome
killall -e xdg-desktop-portal-kde
killall -e xdg-desktop-portal-lxqt
killall -e xdg-desktop-portal-wlr
killall -e xdg-desktop-portal-gtk
killall xdg-desktop-portal
sleep 1
# start xdg-desktop-portal-hyprland
/usr/lib/xdg-desktop-portal-hyprland &
sleep 2
# start xdg-desktop-portal
/usr/lib/xdg-desktop-portal &
sleep 1