refactor(hypr): migrate configuration to lua

This commit is contained in:
2026-08-11 18:47:19 -04:00
parent d4663ad9cd
commit a1a9081a2a
14 changed files with 169 additions and 164 deletions
-50
View File
@@ -1,50 +0,0 @@
$mainMod = SUPER
# Keybindings
bind = $mainMod, return, exec, $terminal
bind = $mainMod, Q, killactive,
bind = $mainMod, E, exec, $fileManager
bind = $mainMod, V, togglefloating,
bind = $mainMod, D, exec, $menu
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, layoutmsg, togglesplit # dwindle
bind = $mainMod, L, exec, hyprlock
bind = $mainMod, F, fullscreen
# Move focus window
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
# Switch workspaces
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
# Move active window to a workspace
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
+29
View File
@@ -0,0 +1,29 @@
local programs = require("env")
local main_mod = "SUPER"
hl.bind(main_mod .. " + return", hl.dsp.exec_cmd(programs.terminal))
hl.bind(main_mod .. " + Q", hl.dsp.window.close())
hl.bind(main_mod .. " + E", hl.dsp.exec_cmd(programs.file_manager))
hl.bind(main_mod .. " + V", hl.dsp.window.float({ action = "toggle" }))
hl.bind(main_mod .. " + D", hl.dsp.exec_cmd(programs.menu))
hl.bind(main_mod .. " + P", hl.dsp.window.pseudo())
hl.bind(main_mod .. " + J", hl.dsp.layout("togglesplit"))
hl.bind(main_mod .. " + L", hl.dsp.exec_cmd("hyprlock"))
hl.bind(main_mod .. " + F", hl.dsp.window.fullscreen())
hl.bind(main_mod .. " + left", hl.dsp.focus({ direction = "left" }))
hl.bind(main_mod .. " + right", hl.dsp.focus({ direction = "right" }))
hl.bind(main_mod .. " + up", hl.dsp.focus({ direction = "up" }))
hl.bind(main_mod .. " + down", hl.dsp.focus({ direction = "down" }))
for workspace = 1, 10 do
local key = workspace % 10
hl.bind(main_mod .. " + " .. key, hl.dsp.focus({ workspace = workspace }))
hl.bind(main_mod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = workspace }))
end
hl.bind(main_mod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" }))
hl.bind(main_mod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }))
hl.bind(main_mod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
hl.bind(main_mod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
-17
View File
@@ -1,17 +0,0 @@
# Screen brightness controls
exec-once = light -N 1
bind = ,XF86MonBrightnessUp, exec, ~/bin/system/backlight-ctl.sh -i
bind = ,XF86MonBrightnessDown, exec, ~/bin/system/backlight-ctl.sh -d
# Pulse Audio controls
bind = ,XF86AudioRaiseVolume, exec, amixer set Master 3%+ #increase sound volume
bind = ,XF86AudioLowerVolume, exec, amixer set Master 3%- #decrease sound volume
bind = ,XF86AudioMute, exec, amixer set Master toggle # toggle sound
# Media controls
bind = ,XF86AudioPrev, exec, playerctl previous
bind = ,XF86AudioPlay, exec, playerctl play-pause
bind = ,XF86AudioNext, exec, playerctl next
# Lockscreen
bind = $mainMod, escape, exec, swaylock
+18
View File
@@ -0,0 +1,18 @@
local main_mod = "SUPER"
hl.on("hyprland.start", function()
hl.exec_cmd("light -N 1")
end)
hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("~/bin/system/backlight-ctl.sh -i"))
hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("~/bin/system/backlight-ctl.sh -d"))
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("amixer set Master 3%+"))
hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("amixer set Master 3%-"))
hl.bind("XF86AudioMute", hl.dsp.exec_cmd("amixer set Master toggle"))
hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"))
hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"))
hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"))
hl.bind(main_mod .. " + escape", hl.dsp.exec_cmd("swaylock"))
-5
View File
@@ -1,5 +0,0 @@
# Programs
$terminal = alacritty
$fileManager = dolphin
$menu = rofi -show combi
$browser = brave-browser
+9
View File
@@ -0,0 +1,9 @@
hl.env("XCURSOR_SIZE", "24")
hl.env("QT_QPA_PLATFORMTHEME", "qt5ct")
return {
terminal = "alacritty",
file_manager = "dolphin",
menu = "rofi -show combi",
browser = "brave-browser",
}
-41
View File
@@ -1,41 +0,0 @@
general {
gaps_in = 5
gaps_out = 5
border_size = 2
col.active_border = rgba(e91e63ee) rgba(ffcdd2ee) 45deg
col.inactive_border = rgba(0288d1aa)
layout = dwindle
allow_tearing = false
}
decoration {
rounding = 5
blur {
enabled = true
size = 3
passes = 1
}
}
animations {
enabled = yes
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 3, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = borderangle, 1, 8, default
animation = fade, 1, 7, default
animation = workspaces, 1, 2, default
}
dwindle {
preserve_split = yes
force_split = 2
}
master {
orientation = right
}
gesture = 3, horizontal, workspace
+56
View File
@@ -0,0 +1,56 @@
hl.config({
general = {
gaps_in = 5,
gaps_out = 5,
border_size = 2,
col = {
active_border = {
colors = { "rgba(e91e63ee)", "rgba(ffcdd2ee)" },
angle = 45,
},
inactive_border = "rgba(0288d1aa)",
},
layout = "dwindle",
allow_tearing = false,
},
decoration = {
rounding = 5,
blur = {
enabled = true,
size = 3,
passes = 1,
},
},
animations = {
enabled = true,
},
dwindle = {
preserve_split = true,
force_split = 2,
},
master = {
orientation = "right",
},
})
hl.curve("myBezier", {
type = "bezier",
points = { { 0.05, 0.9 }, { 0.1, 1.05 } },
})
hl.animation({ leaf = "windows", enabled = true, speed = 3, bezier = "myBezier" })
hl.animation({ leaf = "windowsOut", enabled = true, speed = 7, bezier = "default", style = "popin 80%" })
hl.animation({ leaf = "border", enabled = true, speed = 10, bezier = "default" })
hl.animation({ leaf = "borderangle", enabled = true, speed = 8, bezier = "default" })
hl.animation({ leaf = "fade", enabled = true, speed = 7, bezier = "default" })
hl.animation({ leaf = "workspaces", enabled = true, speed = 2, bezier = "default" })
hl.gesture({
fingers = 3,
direction = "horizontal",
action = "workspace",
})
-40
View File
@@ -1,40 +0,0 @@
monitor=eDP-1,2256x1504@60,auto,1.175
# Enviroment
source = ~/.config/hypr/env.conf
# Startup programs
source = ~/.config/hypr/startup-all.conf
source = ~/.config/hypr/startup-framework.conf
# Default env vars
env = XCURSOR_SIZE,24
env = QT_QPA_PLATFORMTHEME,qt5ct
source = ~/.config/hypr/general.conf
input {
kb_layout = us
kb_variant =
kb_model =
kb_options =
kb_rules =
follow_mouse = 1
touchpad {
natural_scroll = yes
}
sensitivity = 0
}
xwayland {
force_zero_scaling = true
}
misc {
force_default_wallpaper = 0
}
windowrule = suppress_event maximize, match:class .*
source = ~/.config/hypr/bind-all.conf
source = ~/.config/hypr/bind-framework.conf
+45
View File
@@ -0,0 +1,45 @@
hl.monitor({
output = "eDP-1",
mode = "2256x1504@60",
position = "auto",
scale = 1.175,
})
require("env")
require("startup-all")
require("startup-framework")
require("general")
hl.config({
input = {
kb_layout = "us",
kb_variant = "",
kb_model = "",
kb_options = "",
kb_rules = "",
follow_mouse = 1,
touchpad = {
natural_scroll = true,
},
sensitivity = 0,
},
xwayland = {
force_zero_scaling = true,
},
misc = {
force_default_wallpaper = 0,
},
})
hl.window_rule({
name = "suppress-maximize-events",
match = { class = ".*" },
suppress_event = "maximize",
})
require("bind-all")
require("bind-framework")
-8
View File
@@ -1,8 +0,0 @@
# Password manager update
exec-once = pass git pull
# Start up script
exec-once = ~/bin/system/system-start.sh
# Lock, blank displays, and suspend when idle
exec-once = hypridle
+5
View File
@@ -0,0 +1,5 @@
hl.on("hyprland.start", function()
hl.exec_cmd("pass git pull")
hl.exec_cmd("~/bin/system/system-start.sh")
hl.exec_cmd("hypridle")
end)
@@ -1,3 +0,0 @@
exec-once = [workspace 1 silent] $browser
exec-once = [workspace 2 silent] $terminal
exec-once = [workspace 10 silent] flatpak run org.signal.Signal
@@ -0,0 +1,7 @@
local programs = require("env")
hl.on("hyprland.start", function()
hl.exec_cmd(programs.browser, { workspace = "1 silent" })
hl.exec_cmd(programs.terminal, { workspace = "2 silent" })
hl.exec_cmd("flatpak run org.signal.Signal", { workspace = "10 silent" })
end)