Compare commits
20 Commits
d6d95173bd
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| f00c8affc4 | |||
| e298b55cb7 | |||
| a0b22453eb | |||
| 4bbae7a78c | |||
| 4614859248 | |||
| 87ecb55fd8 | |||
| da74cab213 | |||
| 86e9b190af | |||
| 1e83dd2f5f | |||
| 0cb5829923 | |||
| 591515a149 | |||
| c4fbd94891 | |||
| 81a9d52938 | |||
| bd95554e17 | |||
| 900c1c8922 | |||
| a4edeec23b | |||
| 7182189e8e | |||
| 072c5876e4 | |||
| 90f1a6b17b | |||
| ffa71223d5 |
@@ -0,0 +1,8 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
insert_file_newline=true
|
||||
|
||||
[*.lua]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
@@ -14,7 +14,7 @@ M.curves = {
|
||||
type = "spring",
|
||||
mass = 1,
|
||||
stiffness = 50,
|
||||
dampening = 6,
|
||||
dampening = 8,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
local settings = require("lua.lib.settings")
|
||||
|
||||
local M = {}
|
||||
|
||||
---@type table<string, string>
|
||||
@@ -7,6 +9,10 @@ M.envs = {
|
||||
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)
|
||||
|
||||
+14
-1
@@ -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,4 +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
|
||||
|
||||
+14
-5
@@ -1,24 +1,33 @@
|
||||
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.confs.gestures = table.insert(M.confs.gestures, { workspace_swipe_touch = true })
|
||||
M.gestures = {
|
||||
{
|
||||
fingures = 3,
|
||||
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"]
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ M.confs = {
|
||||
misc = {
|
||||
disable_hyprland_logo = true,
|
||||
disable_splash_rendering = true,
|
||||
vrr = true,
|
||||
vrr = 3,
|
||||
enable_swallow = true,
|
||||
swallow_regex = "^(kitty|Alacritty)$",
|
||||
background_color = colorscheme.background,
|
||||
|
||||
+15
-2
@@ -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({
|
||||
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")
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -39,6 +42,13 @@ settings["modules"] = {
|
||||
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")
|
||||
|
||||
+3
-1
@@ -79,7 +79,9 @@ function M.tbl_recursive_merge(defaults, overrides)
|
||||
end
|
||||
|
||||
function M.extend_config(defaults, user_module)
|
||||
if not M.is_file_exists(HYPR .. user_module) then
|
||||
local file = HYPR .. "/" .. string.gsub(user_module, "%.", "/") .. ".lua"
|
||||
if not M.is_file_exists(file) then
|
||||
print(file .. " not found.")
|
||||
return deepcopy(defaults)
|
||||
end
|
||||
local ok, overrides = pcall(require, user_module)
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
local bind = require("lua.lib.bind")
|
||||
|
||||
local M = {}
|
||||
|
||||
M.binds = {
|
||||
{
|
||||
keys = bind.with_leader("CTRL + E"),
|
||||
dispatcher = hl.dsp.exec_cmd("pkill fcitx5 -9;sleep 1;fcitx5 -d"),
|
||||
desc = "restart fcitx5",
|
||||
},
|
||||
}
|
||||
|
||||
M.autostart = {
|
||||
function()
|
||||
hl.exec_cmd("fcitx5 -d")
|
||||
end,
|
||||
}
|
||||
|
||||
M.envs = {
|
||||
QT_IM_MODULE = "fcitx",
|
||||
XMODIFIERS = "@im=fcitx",
|
||||
}
|
||||
|
||||
return M
|
||||
@@ -26,6 +26,7 @@ end
|
||||
for name, enabled in pairs(settings.modules) do
|
||||
if enabled then
|
||||
local mod = load_module(name)
|
||||
print("module " .. name .. " loaded.")
|
||||
table.insert(modules, {
|
||||
name = name,
|
||||
config = mod,
|
||||
@@ -36,6 +37,8 @@ end
|
||||
M.autostart = {}
|
||||
M.autostop = {}
|
||||
M.binds = {}
|
||||
M.envs = {}
|
||||
M.windowrules = {}
|
||||
|
||||
local function collect_modules_prop(module, prop)
|
||||
if module[prop] then
|
||||
@@ -48,6 +51,8 @@ for _, item in ipairs(modules) do
|
||||
collect_modules_prop(module, "autostart")
|
||||
collect_modules_prop(module, "autostop")
|
||||
collect_modules_prop(module, "binds")
|
||||
collect_modules_prop(module, "envs")
|
||||
collect_modules_prop(module, "windowrules")
|
||||
end
|
||||
|
||||
function M.load()
|
||||
@@ -55,6 +60,13 @@ function M.load()
|
||||
events.map("hyprland.shutdown", M.autostop)
|
||||
|
||||
bind.map(M.binds)
|
||||
for name, value in pairs(M.envs) do
|
||||
hl.env(name, value)
|
||||
end
|
||||
|
||||
for _, rule in ipairs(M.windowrules) do
|
||||
hl.window_rule(rule)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
@@ -17,4 +17,14 @@ M.binds = {
|
||||
},
|
||||
}
|
||||
|
||||
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
|
||||
@@ -7,7 +7,7 @@ local M = {}
|
||||
local function start_swaync()
|
||||
if settings["systemd"] then
|
||||
local unit = "swaync.service"
|
||||
local source = CONFIG_HOME .. "hypr/systemd/" .. unit
|
||||
local source = HYPR .. "/systemd/" .. unit
|
||||
|
||||
if systemd.ensure_user_unit(unit, source) then
|
||||
hl.exec_cmd("systemctl --user start swaync")
|
||||
|
||||
+8
-10
@@ -8,7 +8,7 @@ local M = {}
|
||||
local function start_swayosd()
|
||||
if settings["systemd"] then
|
||||
local unit = "swayosd.service"
|
||||
local source = CONFIG_HOME .. "hypr/systemd/" .. unit
|
||||
local source = HYPR .. "/systemd/" .. unit
|
||||
|
||||
if systemd.ensure_user_unit(unit, source) then
|
||||
hl.exec_cmd("systemctl --user start swayosd")
|
||||
@@ -43,41 +43,39 @@ end
|
||||
M.binds = {
|
||||
{
|
||||
keys = "XF86MonBrightnessUp",
|
||||
dispatcher = function()
|
||||
swayosd_client_cmd("--brightness raise")
|
||||
end,
|
||||
dispatcher = swayosd_client_cmd("--brightness raise"),
|
||||
dosc = "Increase brightness ",
|
||||
opts = { long_press = true, locked = true },
|
||||
opts = { repeating = true, locked = true },
|
||||
},
|
||||
{
|
||||
keys = "XF86MonBrightnessDown",
|
||||
dispatcher = swayosd_client_cmd("--brightness lower"),
|
||||
desc = "Decrease brightness ",
|
||||
opts = { long_press = true, locked = true },
|
||||
opts = { repeating = true, locked = true },
|
||||
},
|
||||
{
|
||||
keys = "XF86AudioRaiseVolume",
|
||||
dispatcher = swayosd_client_cmd("--output-volume raise"),
|
||||
desc = "Increase brightness ",
|
||||
opts = { long_press = true, locked = true },
|
||||
opts = { repeating = true, locked = true },
|
||||
},
|
||||
{
|
||||
keys = "XF86AudioLowerVolume",
|
||||
dispatcher = swayosd_client_cmd("--output-volume lower"),
|
||||
desc = "Decrease brightness ",
|
||||
opts = { long_press = true, locked = true },
|
||||
opts = { repeating = true, locked = true },
|
||||
},
|
||||
{
|
||||
keys = "XF86AudioMute",
|
||||
dispatcher = swayosd_client_cmd("--output-volume mute-toggle"),
|
||||
desc = "Toggle output mute",
|
||||
opts = { long_press = true, locked = true },
|
||||
opts = { repeating = true, locked = true },
|
||||
},
|
||||
{
|
||||
keys = "XF86AudioMicMute",
|
||||
dispatcher = swayosd_client_cmd("--input-volume mute-toggle"),
|
||||
desc = "Toggle input mute",
|
||||
opts = { long_press = true, locked = true },
|
||||
opts = { repeating = true, locked = true },
|
||||
},
|
||||
{
|
||||
keys = "XF86AudioPlay",
|
||||
|
||||
@@ -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"])
|
||||
@@ -101,7 +101,7 @@ echo $newwall
|
||||
# -----------------------------------------------------
|
||||
# Reload waybar with new colors
|
||||
# -----------------------------------------------------
|
||||
~/dotfiles/waybar/launch.sh
|
||||
#~/dotfiles/waybar/launch.sh
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Set the new wallpaper
|
||||
|
||||
Reference in New Issue
Block a user