Compare commits
35 Commits
37fef5cbd4
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| f00c8affc4 | |||
| e298b55cb7 | |||
| a0b22453eb | |||
| 4bbae7a78c | |||
| 4614859248 | |||
| 87ecb55fd8 | |||
| da74cab213 | |||
| 86e9b190af | |||
| 1e83dd2f5f | |||
| 0cb5829923 | |||
| 591515a149 | |||
| c4fbd94891 | |||
| 81a9d52938 | |||
| bd95554e17 | |||
| 900c1c8922 | |||
| a4edeec23b | |||
| 7182189e8e | |||
| 072c5876e4 | |||
| 90f1a6b17b | |||
| ffa71223d5 | |||
| d6d95173bd | |||
| 9bd03f67e4 | |||
| 305a9a4532 | |||
| d0f823dadb | |||
| e162025c51 | |||
| bf1ada37d8 | |||
| 96fad77198 | |||
| 4db681ca2d | |||
| 51166b0f3a | |||
| c2ba1a2f67 | |||
| 99a7107562 | |||
| 0208181c07 | |||
| a0af16868b | |||
| d97d7219e5 | |||
| a50825151c |
@@ -0,0 +1,8 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
insert_file_newline=true
|
||||
|
||||
[*.lua]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -0,0 +1,23 @@
|
||||
local M = {}
|
||||
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),
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,36 @@
|
||||
local M = {}
|
||||
local bind = require("lua.lib.bind")
|
||||
local utils = require("lua.lib.utils")
|
||||
|
||||
local pieces = {
|
||||
"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
|
||||
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
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,21 @@
|
||||
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",
|
||||
},
|
||||
}
|
||||
|
||||
M.submaps = {
|
||||
pass_through = {
|
||||
{
|
||||
keys = bind.with_leader("escape"),
|
||||
dispatcher = hl.dsp.submap("reset"),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,138 @@
|
||||
local bind = require("lua.lib.bind")
|
||||
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)
|
||||
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()),
|
||||
},
|
||||
}
|
||||
|
||||
for key, dir in pairs({
|
||||
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",
|
||||
})
|
||||
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",
|
||||
},
|
||||
})
|
||||
|
||||
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",
|
||||
},
|
||||
})
|
||||
|
||||
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",
|
||||
},
|
||||
})
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,58 @@
|
||||
local bind = require("lua.lib.bind")
|
||||
local utils = require("lua.lib.utils")
|
||||
|
||||
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",
|
||||
})
|
||||
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",
|
||||
},
|
||||
})
|
||||
|
||||
return M
|
||||
+31
-30
@@ -1,37 +1,38 @@
|
||||
local settings = require("lua.lib.settings")
|
||||
local colorscheme
|
||||
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.surface0
|
||||
colorscheme.accent = colorscheme.blue
|
||||
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
@@ -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
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
local M = {}
|
||||
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 },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
function M.load()
|
||||
hl.config(M.confs)
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -0,0 +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",
|
||||
}
|
||||
|
||||
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
|
||||
end
|
||||
|
||||
return M
|
||||
+22
-2
@@ -1,11 +1,31 @@
|
||||
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()
|
||||
require("lua.conf.env").load()
|
||||
require("lua.conf.input").load()
|
||||
require("lua.conf.decoration").load()
|
||||
require("lua.conf.layout").load()
|
||||
require("lua.conf.misc").load()
|
||||
require("lua.conf.windowrules").load()
|
||||
require("lua.conf.layerrules").load()
|
||||
|
||||
require("lua.binds").load()
|
||||
require("lua.modules").load()
|
||||
require("lua.plugins").load()
|
||||
require("lua.animations").load()
|
||||
|
||||
hl.bind("SUPER + Return", hl.dsp.exec_cmd("kitty"))
|
||||
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
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
local M = {}
|
||||
local settings = require("lua.lib.settings")
|
||||
local utils = require("lua.lib.utils")
|
||||
|
||||
M.confs = {
|
||||
input = { touchpad = {} },
|
||||
gestures = {},
|
||||
}
|
||||
|
||||
if settings["profile"] == "desktop" then
|
||||
M.confs.input = table.insert(M.confs.input, { numlock_by_default = true })
|
||||
elseif settings["profile"] == "laptop" then
|
||||
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 = 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
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,56 @@
|
||||
local M = {}
|
||||
|
||||
M.layer_rules = {
|
||||
{
|
||||
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 = "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 = "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
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,20 @@
|
||||
local M = {}
|
||||
local settings = require("lua.lib.settings")
|
||||
|
||||
M.confs = {
|
||||
general = {
|
||||
layout = settings["default_layout"],
|
||||
},
|
||||
dwindle = {
|
||||
preserve_split = true,
|
||||
},
|
||||
master = {},
|
||||
scrolling = {},
|
||||
monocle = {},
|
||||
}
|
||||
|
||||
function M.load()
|
||||
hl.config(M.confs)
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,21 @@
|
||||
local M = {}
|
||||
local colorscheme = require("lua.conf.colorscheme")
|
||||
local settings = require("lua.lib.settings")
|
||||
|
||||
M.confs = {
|
||||
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)
|
||||
end
|
||||
|
||||
return M
|
||||
+18
-5
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +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,
|
||||
},
|
||||
}
|
||||
|
||||
function M.load()
|
||||
for _, rule in ipairs(M.window_rules) do
|
||||
hl.window_rule(rule)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
+51
-21
@@ -3,39 +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
|
||||
|
||||
local function with_leader(keys)
|
||||
if keys == nil or keys == "" then
|
||||
return bind.leader
|
||||
end
|
||||
function bind.with_leader(keys)
|
||||
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.leader_key(keys, dispatcher, desc, opts)
|
||||
return bind.key(with_leader(keys), dispatcher, desc, opts)
|
||||
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)
|
||||
end
|
||||
|
||||
function bind.map(table)
|
||||
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
|
||||
|
||||
local action = actions[ws.tiled_layout] or fallback
|
||||
if action then
|
||||
hl.dispatch(action)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return bind
|
||||
|
||||
+3
-3
@@ -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
@@ -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
|
||||
|
||||
+35
-6
@@ -6,6 +6,28 @@ settings["hostname"] = ""
|
||||
---@type "desktop"|"laptop"
|
||||
settings["profile"] = "desktop"
|
||||
|
||||
---@type boolean
|
||||
settings["touchpad_natural_scroll"] = true
|
||||
|
||||
---@type string
|
||||
settings["kb_layout"] = "us"
|
||||
|
||||
---@type string
|
||||
settings["locale"] = ""
|
||||
|
||||
---@type "dwindle"|"master"|"scrolling"|"monocle"
|
||||
settings["default_layout"] = "dwindle"
|
||||
|
||||
---@type string
|
||||
settings["font_family"] = "FiraCode Nerd Font"
|
||||
|
||||
---@type table<string, string>
|
||||
settings["apps"] = {
|
||||
terminal = "kitty",
|
||||
file_manager = "thunar",
|
||||
browser = "chromium",
|
||||
}
|
||||
|
||||
---@type "catppuccin"|"catppuccin-mocha"
|
||||
settings["colorscheme"] = "catppuccin"
|
||||
|
||||
@@ -14,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
@@ -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
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
+38
-27
@@ -2,60 +2,71 @@ 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 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)
|
||||
|
||||
for _, bind in pairs(M.binds) do
|
||||
bind()
|
||||
end
|
||||
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
-5
@@ -2,17 +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 = {
|
||||
function()
|
||||
bind.leader_key("SHIFT + Return", hl.dsp.exec_cmd("pypr toggle term"), "Pyprland: toggle drop terminal", {})
|
||||
end,
|
||||
{
|
||||
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
|
||||
|
||||
@@ -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
@@ -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
-61
@@ -6,83 +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 = {
|
||||
function()
|
||||
bind.key(
|
||||
"XF86MonBrightnessUp",
|
||||
swayosd_client_cmd("--brightness raise"),
|
||||
"Increase brightness ",
|
||||
{ long_press = true, locked = true }
|
||||
)
|
||||
bind.key(
|
||||
"XF86MonBrightnessDown",
|
||||
swayosd_client_cmd("--brightness lower"),
|
||||
"Decrease brightness ",
|
||||
{ long_press = true, locked = true }
|
||||
)
|
||||
bind.key(
|
||||
"XF86AudioRaiseVolume",
|
||||
swayosd_client_cmd("--output-volume raise"),
|
||||
"Increase brightness ",
|
||||
{ long_press = true, locked = true }
|
||||
)
|
||||
bind.key(
|
||||
"XF86AudioLowerVolume",
|
||||
swayosd_client_cmd("--output-volume lower"),
|
||||
"Decrease brightness ",
|
||||
{ long_press = true, locked = true }
|
||||
)
|
||||
bind.key(
|
||||
"XF86AudioMute",
|
||||
swayosd_client_cmd("--output-volume mute-toggle"),
|
||||
"Toggle output mute",
|
||||
{ long_press = true, locked = true }
|
||||
)
|
||||
bind.key(
|
||||
"XF86AudioMicMute",
|
||||
swayosd_client_cmd("--input-volume mute-toggle"),
|
||||
"Toggle input mute",
|
||||
{ long_press = true, locked = true }
|
||||
)
|
||||
bind.key("XF86AudioPlay", swayosd_client_cmd("--playerctl play-pause"), "Player play/pause", { locked = true })
|
||||
bind.key("XF86AudioPause", swayosd_client_cmd("--playerctl pause"), "Player pause", { locked = true })
|
||||
bind.key("XF86AudioNext", swayosd_client_cmd("--playerctl next"), "Player next", { locked = true })
|
||||
bind.key("XF86AudioPrev", swayosd_client_cmd("--playerctl prev"), "Player previous", { locked = true })
|
||||
end,
|
||||
{
|
||||
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
-6
@@ -2,18 +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 = {
|
||||
function()
|
||||
bind.leader_key("SHIFT + B", hl.dsp.exec_cmd("~/dotfiles/waybar/launch.sh"), "(re)launch waybar", {})
|
||||
bind.leader_key("CTRL + B", hl.dsp.exec_cmd("~/dotfiles/waybar/toggle.sh"), "toggle waybar", {})
|
||||
end,
|
||||
{
|
||||
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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Remove gamemode flag
|
||||
if [ -f ~/.cache/gamemode ] ;then
|
||||
rm ~/.cache/gamemode
|
||||
echo ":: ~/.cache/gamemode removed"
|
||||
fi
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/bin/bash
|
||||
# _____ ____ __
|
||||
# / _ \ \ /\ / /\ \ /\ / /
|
||||
# | __/\ V V / \ V V /
|
||||
# \___| \_/\_/ \_/\_/
|
||||
#
|
||||
EWW=`which eww`
|
||||
if [[ ! `pidof eww` ]]; then
|
||||
${EWW} daemon
|
||||
sleep 0.5
|
||||
fi
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
sleep 0.5
|
||||
killall -9 Hyprland sleep 2
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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"
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/bash
|
||||
hyprctl reload
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
sleep 0.5
|
||||
hyprlock
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/bash
|
||||
hyprctl -j monitors
|
||||
@@ -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
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
sleep 0.5
|
||||
systemctl reboot
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
sleep 0.5
|
||||
systemctl poweroff
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
sleep 0.5
|
||||
systemctl suspend
|
||||
@@ -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
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/bin/bash
|
||||
# _ _ _ __ _ _
|
||||
# / \ | | |/ _| | ___ __ _| |_
|
||||
# / _ \ | | | |_| |/ _ \ / _` | __|
|
||||
# / ___ \| | | _| | (_) | (_| | |_
|
||||
# /_/ \_\_|_|_| |_|\___/ \__,_|\__|
|
||||
#
|
||||
# by Stephan Raabe (2023)
|
||||
# -----------------------------------------------------
|
||||
|
||||
hyprctl dispatch workspaceopt allfloat
|
||||
@@ -101,7 +101,7 @@ echo $newwall
|
||||
# -----------------------------------------------------
|
||||
# Reload waybar with new colors
|
||||
# -----------------------------------------------------
|
||||
~/dotfiles/waybar/launch.sh
|
||||
#~/dotfiles/waybar/launch.sh
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Set the new wallpaper
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user