gemini generated lua config

This commit is contained in:
venus
2026-05-22 05:51:26 -05:00
parent 492f4723bf
commit 9231418ac1
12 changed files with 546 additions and 0 deletions

19
hyprland.lua Normal file
View File

@@ -0,0 +1,19 @@
-- Hyprland v0.55 Lua Configuration
-- Add the config directory to the package path for easy requiring
package.path = package.path .. ";" .. "/home/venus/.config/hypr/?.lua"
-- Load modules
require("modules.monitors")
require("modules.inputs")
require("modules.looks")
require("modules.windows")
require("modules.plugins")
require("modules.permissions")
require("modules.autostart")
require("modules.keybinds")
-- Optional: Add a hook for when the config is reloaded
hl.on("config.reload", function()
hl.exec("notify-send 'Hyprland' 'Configuration reloaded successfully!'")
end)

14
modules/autostart.lua Normal file
View File

@@ -0,0 +1,14 @@
local vars = require("modules.variables")
hl.on("hyprland.start", function()
hl.exec(vars.shellWrapper)
hl.exec("systemctl --user start hyprpolkitagent")
hl.exec("udiskie")
hl.exec("hyprpm reload -n")
hl.exec("kdeconnectd")
hl.exec("hyprshell run &")
hl.exec("[workspace special:discord silent] vesktop -m")
hl.exec("[workspace special:email silent] " .. vars.email)
hl.exec("[workspace special:notes silent] obsidian")
hl.exec("protonmail-bridge --no-window")
end)

30
modules/inputs.lua Normal file
View File

@@ -0,0 +1,30 @@
hl.config({
input = {
kb_layout = "us",
kb_variant = "",
kb_model = "",
kb_options = "",
kb_rules = "",
follow_mouse = 1,
sensitivity = 0,
touchpad = {
natural_scroll = true
}
},
cursor_inactive_timeout = 0.1,
gesture = {
workspace_swipe = true, -- Simplified based on common usage
workspace_swipe_fingers = 3
},
device = {
{
name = "epic-mouse-v1",
sensitivity = -0.5
}
}
})
-- The old 'gesture = 3, horizontal, workspace' might be handled differently in Lua.
-- Based on the search, hl.config handles these.

260
modules/keybinds.lua Normal file
View File

@@ -0,0 +1,260 @@
local vars = require("modules.variables")
local mainMod = vars.mainMod
local ipc = "qs -c noctalia-shell ipc call"
-- 1. Basic Binds
hl.bind(mainMod .. " + Q", hl.dsp.exec(vars.terminal))
hl.bind("ALT + Q", hl.dsp.exec(vars.terminal .. " --class popup-term"))
hl.bind(mainMod .. " + W", hl.dsp.exec(vars.terminal .. " --class popup-term"))
hl.bind(mainMod .. " + C", hl.dsp.window.close())
hl.bind(mainMod .. " + SHIFT + CTRL + M", function()
hl.exec("command -v hyprshutdown >/dev/null 2>&1 && hyprshutdown || hyprctl dispatch exit")
end)
hl.bind(mainMod .. " + P", function()
hl.dispatch(hl.dsp.window.float({ action = "toggle" }))
hl.dispatch(hl.dsp.window.pin({ action = "toggle" }))
end)
hl.bind(mainMod .. " + SHIFT + BACKSLASH", hl.dsp.window.float({ action = "toggle" }))
hl.bind(mainMod .. " + BACKSLASH", hl.dsp.layout.msg("togglesplit"))
hl.bind(mainMod .. " + CTRL + BACKSLASH", hl.dsp.window.pseudo({ action = "toggle" }))
-- Compiler window
hl.bind(mainMod .. " + SHIFT + A", hl.dsp.window.tag("compiler"))
hl.bind(mainMod .. " + A", hl.dsp.exec("/home/venus/.config/hypr/scripts/compile.sh"))
-- 2. moving focus with vim
hl.bind(mainMod .. " + H", hl.dsp.focus({ direction = "left" }))
hl.bind(mainMod .. " + L", hl.dsp.focus({ direction = "right" }))
hl.bind(mainMod .. " + K", hl.dsp.focus({ direction = "up" }))
hl.bind(mainMod .. " + J", hl.dsp.focus({ direction = "down" }))
hl.bind(mainMod .. " + SHIFT + H", hl.dsp.window.move({ direction = "left" }))
hl.bind(mainMod .. " + SHIFT + L", hl.dsp.window.move({ direction = "right" }))
hl.bind(mainMod .. " + SHIFT + K", hl.dsp.window.move({ direction = "up" }))
hl.bind(mainMod .. " + SHIFT + J", hl.dsp.window.move({ direction = "down" }))
hl.bind(mainMod .. " + mouse_up", hl.dsp.workspace.m_relative(-1))
hl.bind(mainMod .. " + mouse_down", hl.dsp.workspace.m_relative(1))
hl.bind(mainMod .. " + SHIFT + mouse_up", hl.dsp.workspace.e_relative(-1))
hl.bind(mainMod .. " + SHIFT + mouse_down", hl.dsp.workspace.e_relative(1))
hl.bind(mainMod .. " + CTRL + right", hl.dsp.workspace.m_relative(1))
hl.bind(mainMod .. " + CTRL + left", hl.dsp.workspace.m_relative(-1))
hl.bind("CTRL + SPACE", hl.dsp.focus.current_or_last())
-- 3. resize with arrows
hl.bind(mainMod .. " + right", hl.dsp.window.resize({ x = 20, y = 0 }), { repeating = true })
hl.bind(mainMod .. " + left", hl.dsp.window.resize({ x = -20, y = 0 }), { repeating = true })
hl.bind(mainMod .. " + up", hl.dsp.window.resize({ x = 0, y = -20 }), { repeating = true })
hl.bind(mainMod .. " + down", hl.dsp.window.resize({ x = 0, y = 20 }), { repeating = true })
-- 4. Switch workspaces with mainMod + [0-9]
for i = 1, 9 do
hl.bind(mainMod .. " + " .. i, hl.dsp.workspace.id(i))
end
hl.bind(mainMod .. " + 0", hl.dsp.workspace.id(10))
-- 5. Move active window to a workspace with mainMod + SHIFT + [0-9]
for i = 1, 9 do
hl.bind(mainMod .. " + SHIFT + " .. i, hl.dsp.window.move_to_workspace(i))
end
hl.bind(mainMod .. " + SHIFT + 0", hl.dsp.window.move_to_workspace(10))
-- 6. special workspace (scratchpad)
hl.bind(mainMod .. " + S", hl.dsp.workspace.special("magic"))
hl.bind(mainMod .. " + SHIFT + S", hl.dsp.window.move_to_workspace("special:magic"))
hl.bind(mainMod .. " + B", hl.dsp.workspace.special("magic2"))
hl.bind(mainMod .. " + SHIFT + B", hl.dsp.window.move_to_workspace("special:book"))
hl.bind(mainMod .. " + D", function()
hl.exec("discord")
hl.dispatch(hl.dsp.workspace.special("discord"))
end)
hl.bind(mainMod .. " + E", function()
hl.exec(vars.email)
hl.dispatch(hl.dsp.workspace.special("email"))
end)
hl.bind(mainMod .. " + G", function()
hl.exec("steam -forcedesktopscaling 0.5")
hl.dispatch(hl.dsp.workspace.special("gaming"))
end)
hl.bind(mainMod .. " + N", hl.dsp.workspace.special("notes"))
hl.bind(mainMod .. " + X", hl.dsp.workspace.special("phantom"))
-- 8. Move/resize windows with mainMod + LMB/RMB and dragging
hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
-- 9. Laptop multimedia keys for volume and LCD brightness
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), { repeating = true, locked = true })
hl.bind("XF86AudioLowerVolume", hl.dsp.exec("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { repeating = true, locked = true })
hl.bind("XF86AudioMute", hl.dsp.exec("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { repeating = true, locked = true })
hl.bind("XF86AudioMicMute", hl.dsp.exec("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), { repeating = true, locked = true })
hl.bind("XF86MonBrightnessUp", hl.dsp.exec("brightnessctl -e4 -n2 set 5%+"), { repeating = true, locked = true })
hl.bind("XF86MonBrightnessDown", hl.dsp.exec("brightnessctl -e4 -n2 set 5%-"), { repeating = true, locked = true })
-- Playerctl
hl.bind("XF86AudioNext", hl.dsp.exec("playerctl next"), { locked = true })
hl.bind("XF86AudioPause", hl.dsp.exec("playerctl play-pause"), { locked = true })
hl.bind("XF86AudioPlay", hl.dsp.exec("playerctl play-pause"), { locked = true })
hl.bind("XF86AudioPrev", hl.dsp.exec("playerctl previous"), { locked = true })
hl.bind("ALT + mouse:274", hl.dsp.exec("playerctl play-pause"))
-- 10. Applications and shortcuts
hl.bind(mainMod .. " + F", hl.dsp.exec("firefox"))
hl.bind(mainMod .. " + SHIFT + F", hl.dsp.exec("qutebrowser"))
hl.bind(mainMod .. " + SHIFT + Q", hl.dsp.exec("qutebrowser"))
hl.bind(mainMod .. " + SPACE", hl.dsp.exec("playerctl play-pause"))
hl.bind("ALT + C", hl.dsp.exec(ipc .. " plugin:clipper openPanel"))
hl.bind("code:148", hl.dsp.exec("kitty --class calc-term -o 'confirm_os_window_close 0' /home/venus/.cargo/bin/mathypad"))
hl.bind("SUPER + escape", hl.dsp.exec("kitty --class btop -o 'confirm_os_window_close 0' /usr/bin/btop"))
hl.bind("SUPER + SHIFT + escape", hl.dsp.exec("kitty --class btop -o 'confirm_os_window_close 0' /usr/bin/nvtop"))
hl.bind(mainMod .. " + I", function()
hl.exec("/home/venus/.config/scripts/connectPhone.sh")
hl.exec("scrcpy --no-audio --no-video --keyboard=uhid --mouse=uhid")
end)
hl.bind(mainMod .. " + SHIFT + I", function()
hl.exec("/home/venus/.config/scripts/connectPhone.sh")
hl.exec("scrcpy --no-audio --keyboard=uhid --mouse=uhid")
end)
hl.bind("CTRL + SHIFT + escape", hl.dsp.exec("btop++"))
hl.bind(mainMod .. " + T", function()
hl.exec("notify-send \"$(/home/venus/.config/hypr/scripts/getIp.sh)\"")
hl.exec("kdeconnect-app")
end)
-- 12. quick access to controls submap
hl.bind(mainMod .. " + comma", hl.dsp.exec(ipc .. " controlCenter toggle"))
hl.bind(mainMod .. " + period", hl.dsp.exec(ipc .. " settings toggle"))
hl.bind("PRINT", hl.dsp.exec("hyprshot -m active -m window --output-folder ~/Images/Screenshots"))
hl.bind("SHIFT + PRINT", hl.dsp.exec("hyprshot -m region --output-folder ~/Images/Screenshots"))
hl.bind("ALT + PRINT", hl.dsp.exec("hyprshot -m active -m output --output-folder ~/Images/Screenshots"))
hl.bind(mainMod .. " + M", function()
hl.exec(ipc .. " controlCenter toggle")
hl.dispatch(hl.dsp.submap("quick-settings"))
end)
hl.bind(mainMod .. " + O", hl.dsp.submap("open-apps"))
-- Submaps
hl.define_submap("quick-settings", function()
hl.bind("", "V", function()
hl.exec("protonvpn-app &")
hl.dispatch(hl.dsp.submap("vpn"))
end)
hl.bind("", "S", hl.dsp.exec(ipc .. " settings toggle"))
hl.bind("", "C", hl.dsp.exec(ipc .. " plugin:clipper togglePanel"))
hl.bind("", "P", hl.dsp.exec(ipc .. " sessionMenu toggle"))
hl.bind(mainMod .. " + L", hl.dsp.exec(ipc .. " sessionMenu toggle"))
hl.bind("", "T", hl.dsp.exec(ipc .. " systemMonitor toggle"))
hl.bind("", "M", hl.dsp.exec(ipc .. " controlCenter toggle"))
hl.bind("", "D", hl.dsp.exec(ipc .. " notifications toggleDND"))
hl.bind("", "A", hl.dsp.exec(ipc .. " notifications dismissAll"))
hl.bind("", "N", function()
hl.exec(ipc .. " notifications toggleHistory")
hl.dispatch(hl.dsp.submap("notifications-sub"))
end)
hl.bind("", "L", hl.dsp.submap("layouts"))
hl.bind("SHIFT", "B", hl.dsp.exec(ipc .. " bar toggle"))
hl.bind("", "P", hl.dsp.exec(ipc .. " wallpaper toggle"))
hl.bind("", "B", function()
hl.exec(ipc .. " bluetooth togglePanel")
hl.dispatch(hl.dsp.submap("bt-sub"))
end)
hl.bind("", "W", function()
hl.exec(ipc .. " network togglePanel")
hl.dispatch(hl.dsp.submap("wifi-sub"))
end)
hl.bind("SHIFT", "W", hl.dsp.exec(ipc .. " wifi toggle"))
hl.bind(mainMod .. " + B", hl.dsp.exec(ipc .. " battery togglePanel"))
hl.bind(mainMod .. " + C", hl.dsp.exec(ipc .. " calendar toggle"))
hl.bind("", "E", hl.dsp.exec("nvim /home/venus/.config/hypr/basic/keybinds"))
hl.bind("", "escape", hl.dsp.submap("reset"))
hl.bind("", "catchall", hl.dsp.submap("reset"))
end)
hl.define_submap("notifications-sub", function()
hl.bind("", "D", hl.dsp.exec(ipc .. " notifications toggleDND"))
hl.bind("", "S", hl.dsp.exec(ipc .. " notifications toggleDND"))
hl.bind("", "Q", hl.dsp.exec(ipc .. " notifications toggleDND"))
hl.bind("", "A", hl.dsp.exec(ipc .. " notifications dismissAll"))
hl.bind("CTRL", "D", hl.dsp.exec(ipc .. " notifications dismissAll"))
hl.bind("SHIFT", "D", hl.dsp.exec(ipc .. " notifications dismissAll"))
hl.bind(mainMod, "D", hl.dsp.exec(ipc .. " notifications dismissAll"))
hl.bind("", "C", hl.dsp.exec(ipc .. " notifications clear"))
hl.bind("", "catchall", function()
hl.dispatch(hl.dsp.submap("reset"))
hl.exec(ipc .. " notifications toggleHistory")
end)
end)
hl.define_submap("wifi-sub", function()
local call = ipc .. " wifi"
hl.bind("", "T", hl.dsp.exec(call .. " toggle"))
hl.bind("", "S", hl.dsp.exec(call .. " togglePanel"))
hl.bind("", "D", hl.dsp.exec(call .. " disable"))
hl.bind("", "E", hl.dsp.exec(call .. " enable"))
hl.bind("", "R", hl.dsp.exec("sudo systemctl restart iwd"))
hl.bind("", "catchall", function()
hl.dispatch(hl.dsp.submap("reset"))
hl.exec(ipc .. " network togglePanel")
end)
end)
hl.define_submap("bt-sub", function()
local call = ipc .. " bluetooth"
hl.bind("", "T", hl.dsp.exec(call .. " toggle"))
hl.bind("", "S", hl.dsp.exec(call .. " togglePanel"))
hl.bind("", "D", hl.dsp.exec(call .. " disable"))
hl.bind("", "E", hl.dsp.exec(call .. " enable"))
hl.bind("", "H", hl.dsp.exec("sh -c 'bluetoothctl connect 88:92:CC:53:88:7E' && notify-send 'connected to headphones'"))
hl.bind("", "J", hl.dsp.exec("sh -c 'bluetoothctl disconnect 88:92:CC:53:88:7E' && notify-send 'disconnected from headphones'"))
hl.bind("", "P", hl.dsp.exec("sh -c 'bluetoothctl connect 64:9D:38:E0:4D:02' && notify-send 'Connected to phone'"))
hl.bind("", "M", hl.dsp.exec("sh -c 'bluetoothctl disconnect 64:9D:38:E0:4D:02' && notify-send 'Disconnected from phone'"))
hl.bind("", "catchall", function()
hl.dispatch(hl.dsp.submap("reset"))
hl.exec(ipc .. " bluetooth togglePanel")
end)
end)
hl.define_submap("vpn", function()
local call = "protonvpn"
hl.bind("", "O", hl.dsp.exec(call .. "-app"))
hl.bind("", "C", hl.dsp.exec(call .. " connect"))
hl.bind("", "D", hl.dsp.exec(call .. " disconnect"))
hl.bind("", "catchall", hl.dsp.submap("reset"))
end)
hl.define_submap("open-apps", function()
hl.bind("", "S", hl.dsp.exec("signal-desktop"))
hl.bind("", "D", hl.dsp.exec("vesktop"))
hl.bind("", "F", hl.dsp.exec("firefox"))
hl.bind("", "Q", hl.dsp.exec("qutebrowser"))
hl.bind("", "M", hl.dsp.exec("feishin"))
hl.bind("", "O", hl.dsp.exec("obsidian"))
hl.bind("", "T", hl.dsp.exec("thunderbird"))
hl.bind("", "R", hl.dsp.exec("calibre"))
hl.bind("", "E", hl.dsp.exec("darktable"))
hl.bind("", "catchall", hl.dsp.submap("reset"))
end)
hl.define_submap("layouts", function()
hl.bind("", "D", hl.dsp.layout.msg("dwindle"))
hl.bind("", "M", hl.dsp.layout.msg("master"))
hl.bind("", "catchall", hl.dsp.submap("reset"))
end)
-- 13. Misc tools.
hl.bind("ALT + SPACE", hl.dsp.exec(vars.menu))
hl.bind(mainMod .. " + CTRL + L", hl.dsp.exec(ipc .. " lockScreen lock"))

80
modules/looks.lua Normal file
View File

@@ -0,0 +1,80 @@
local theme = require("modules.theme")
hl.config({
general = {
gaps_in = 3,
gaps_out = 5,
border_size = 1,
["col.active_border"] = theme.primary,
["col.inactive_border"] = theme.surface,
resize_on_border = true,
allow_tearing = false,
layout = "dwindle"
},
decoration = {
rounding = 10,
rounding_power = 2,
active_opacity = 1.0,
inactive_opacity = 1.0,
shadow = {
enabled = true,
range = 4,
render_power = 3,
color = "rgba(1a1a1aee)"
},
blur = {
enabled = true,
size = 3,
passes = 1,
vibrancy = 0.1696
}
},
animations = {
enabled = true,
bezier = {
"easeOutQuint, 0.23, 1, 0.32, 1",
"easeInOutCubic, 0.65, 0.05, 0.36, 1",
"linear, 0, 0, 1, 1",
"almostLinear, 0.5, 0.5, 0.75, 1",
"quick, 0.15, 0, 0.1, 1"
},
animation = {
"global, 1, 10, default",
"border, 1, 5.39, easeOutQuint",
"windows, 1, 4.79, easeOutQuint",
"windowsIn, 1, 4.1, easeOutQuint, popin 87%",
"windowsOut, 1, 1.49, linear, popin 87%",
"fadeIn, 1, 1.73, almostLinear",
"fadeOut, 1, 1.46, almostLinear",
"fade, 1, 3.03, quick",
"layers, 1, 3.81, easeOutQuint",
"layersIn, 1, 4, easeOutQuint, fade",
"layersOut, 1, 1.5, linear, fade",
"fadeLayersIn, 1, 1.79, almostLinear",
"fadeLayersOut, 1, 1.39, almostLinear",
"workspaces, 1, 1.94, almostLinear, fade",
"workspacesIn, 1, 1.21, almostLinear, fade",
"workspacesOut, 1, 1.94, almostLinear, fade",
"zoomFactor, 1, 7, quick"
}
},
master = {
new_status = "master"
},
misc = {
force_default_wallpaper = 0,
disable_hyprland_logo = false
},
group = {
["col.border_active"] = theme.secondary,
["col.border_inactive"] = theme.surface,
["col.border_locked_active"] = theme.error,
["col.border_locked_inactive"] = theme.surface,
groupbar = {
["col.active"] = theme.secondary,
["col.inactive"] = theme.surface,
["col.locked_active"] = theme.error,
["col.locked_inactive"] = theme.surface
}
}
})

6
modules/monitors.lua Normal file
View File

@@ -0,0 +1,6 @@
hl.config({
monitor = {
"desc:BOE 0x0BC9,2560x1600@165.00000,6540x-50,1.60000000,transform,0,vrr,0",
"desc:Invalid Vendor Codename - RTK TYPE-C 0000000000000,1920x1200@59.95000,8140x50,1.00000000,transform,0,vrr,0"
}
})

10
modules/permissions.lua Normal file
View File

@@ -0,0 +1,10 @@
-- Permissions (Hyprland v0.55)
-- Note: Permission changes usually require a Hyprland restart.
hl.config({
-- ecosystem = {
-- enforce_permissions = 1
-- }
})
-- hl.permission("/usr/(bin|local/bin)/grim", "screencopy", "allow")

22
modules/plugins.lua Normal file
View File

@@ -0,0 +1,22 @@
hl.config({
plugin = {
hyprexpo = {
columns = 2,
gap_size = 5,
["bg_col"] = "rgb(111111)",
workspace_method = "first 1",
skip_empty = true
},
hy3 = {
no_gaps_when_only = 1,
node_collapse_policy = 2,
tab_first_window = false,
tabs = {
height = 22
},
autotile = {
-- settings
}
}
}
})

20
modules/theme.lua Normal file
View File

@@ -0,0 +1,20 @@
local M = {}
-- From hyprtoolkit.conf
M.background = "rgba(121316ff)"
M.base = "rgba(121316ff)"
M.text = "rgba(e2e2e6ff)"
M.alternate_base = "rgba(43474eff)"
M.bright_text = "rgba(253140ff)"
M.accent = "rgba(9fcaffff)"
M.accent_secondary = "rgba(bbc7dbff)"
-- From noctalia-colors.conf
M.primary = "rgb(9fcaff)"
M.surface = "rgb(121316)"
M.secondary = "rgb(bbc7db)"
M.error = "rgb(ffb4ab)"
M.tertiary = "rgb(d7bee4)"
M.surface_lowest = "rgb(0d0e11)"
return M

13
modules/variables.lua Normal file
View File

@@ -0,0 +1,13 @@
local M = {}
M.terminal = "kitty"
M.fileManager = "dolphin"
M.menu = "qs -c noctalia-shell ipc call launcher toggle"
M.browser = "qutebrowser"
M.menuBar = "qs -c noctalia-shell"
M.shellWrapper = "qs -c noctalia-shell"
M.blkmanager = "udiskie"
M.email = "thunderbird"
M.mainMod = "SUPER"
return M

72
modules/windows.lua Normal file
View File

@@ -0,0 +1,72 @@
hl.window_rule({
match = { class = "scrcpy" },
border_size = 5,
float = true,
dim_around = true,
move = { 5, 40 }
})
hl.window_rule({
name = "compiler-window",
match = { tag = "compiler" },
["col.active_border"] = "rgba(ccaaffee)",
border_size = 2,
float = false
})
hl.window_rule({
match = { class = "steam" },
workspace = "special:gaming"
})
hl.window_rule({
match = { class = ".*" },
suppress_event = "maximize"
})
hl.window_rule({
match = {
class = "^$",
title = "^$",
xwayland = true,
float = true,
fullscreen = false,
pin = false
},
no_focus = true
})
hl.config({
xwayland = {
force_zero_scaling = true
}
})
hl.window_rule({
match = { class = "hyprland-run" },
move = "20 monitor_h-120", -- Lua string interpolation could be used if monitor_h was known
float = true
})
hl.window_rule({
match = { class = "calc-term" },
pseudo = true,
float = true,
center = true,
opacity = 1,
size = "monitor_w*.4 monitor_h*.4"
})
hl.window_rule({
match = { class = "btop" },
float = true,
size = "monitor_w*.9 monitor_h*.8",
dim_around = true
})
hl.window_rule({
match = { class = "popup-term" },
float = true,
size = "monitor_w*.9 monitor_h*.8",
dim_around = true
})