first go at hyprland with lua config

This commit is contained in:
2026-05-10 15:35:01 +01:00
parent ecfa3d9c0f
commit b8ce839f2a
15 changed files with 576 additions and 144 deletions
+9
View File
@@ -0,0 +1,9 @@
hl.curve("myBezier", { type = "bezier", points = { { 0.05, 0.9 }, { 0.1, 1.05 } } })
hl.animation({ leaf = "global", enabled = true, speed = 1, bezier = "default" })
hl.animation({ leaf = "windows", enabled = true, speed = 6, bezier = "myBezier" })
hl.animation({ leaf = "windowsOut", enabled = true, speed = 6, bezier = "default", style = "popin 80%" })
hl.animation({ leaf = "border", enabled = true, speed = 8, bezier = "default" })
hl.animation({ leaf = "borderangle", enabled = true, speed = 6, bezier = "default" })
hl.animation({ leaf = "fade", enabled = true, speed = 6, bezier = "default" })
hl.animation({ leaf = "workspaces", enabled = true, speed = 3, bezier = "default" })
+140
View File
@@ -0,0 +1,140 @@
-- Binds :: General
hl.bind("ALT + Return", hl.dsp.exec_cmd("ghostty"))
hl.bind("ALT + SHIFT + Return", hl.dsp.exec_cmd("foot"))
hl.bind(mainMod .. " + SHIFT + D", hl.dsp.exec_cmd(discord))
hl.bind(mainMod .. " + SHIFT + S", hl.dsp.exec_cmd("signal-desktop"))
hl.bind(mainMod .. " + SHIFT + E", hl.dsp.exec_cmd("emacs -c -a 'emacs'"))
hl.bind(mainMod .. " + SHIFT + F", hl.dsp.exec_cmd("focus"))
hl.bind(mainMod .. " + E", hl.dsp.exec_cmd("thunar"))
hl.bind(mainMod .. " + S", hl.dsp.exec_cmd("spotify"))
hl.bind(mainMod .. " + P", hl.dsp.exec_cmd(colorpick))
hl.bind("Print", hl.dsp.exec_cmd(screenshot_area))
hl.bind("SHIFT + Print", hl.dsp.exec_cmd(screenshot))
hl.bind(mainMod .. " + Space", hl.dsp.exec_cmd("dms ipc call spotlight toggle"))
hl.bind(mainMod .. " + X", hl.dsp.exec_cmd("dms ipc call powermenu toggle"))
hl.bind(mainMod .. " + M", hl.dsp.exec_cmd("dms ipc call processlist toggle"))
hl.bind(mainMod .. " + I", hl.dsp.exec_cmd("dms ipc call settings toggle"))
hl.bind(mainMod .. " + V", hl.dsp.exec_cmd("dms ipc call clipboard toggle"))
hl.bind(mainMod .. " + CTRL + P", hl.dsp.exec_cmd("dms ipc call notepad toggle"))
hl.bind(mainMod .. " + CTRL + C", hl.dsp.exec_cmd("dms ipc call control-center toggle"))
hl.bind(mainMod .. " + N", hl.dsp.exec_cmd("dms ipc call notifications toggle"))
hl.bind(mainMod .. " + SHIFT + N", hl.dsp.exec_cmd("dms ipc call night toggle"))
hl.bind(mainMod .. " + CTRL + B", hl.dsp.exec_cmd("dms ipc call bar toggle"))
hl.bind(mainMod .. " + CTRL + S", hl.dsp.exec_cmd("$HOME/.config/hypr/ws-layout-toggle.sh"))
hl.bind(mainMod .. " + CTRL + Q", hl.dsp.exec_cmd(lock))
hl.bind(mainMod .. " + C", hl.dsp.window.kill())
hl.bind("ALT + F4", hl.dsp.window.kill())
hl.bind(mainMod .. " + F", hl.dsp.window.float({ action = "toggle" }))
hl.bind(mainMod .. " + CTRL + F", hl.dsp.window.fullscreen({ action = "toggle" }))
hl.bind(mainMod .. " + F4", hl.dsp.exit())
hl.bind(mainMod .. " + right", hl.dsp.window.resize({ x = 10, y = 0 }), { repeating = true })
hl.bind(mainMod .. " + left", hl.dsp.window.resize({ x = -10, y = 0 }), { repeating = true })
hl.bind(mainMod .. " + up", hl.dsp.window.resize({ x = 0, y = -10 }), { repeating = true })
hl.bind(mainMod .. " + down", hl.dsp.window.resize({ x = 0, y = 10 }), { repeating = true })
-- Binds :: Window & Navigation
hl.bind(mainMod .. " + H", hl.dsp.focus({ direction = "l" }))
hl.bind(mainMod .. " + L", hl.dsp.focus({ direction = "r" }))
hl.bind(mainMod .. " + K", hl.dsp.focus({ direction = "u" }))
hl.bind(mainMod .. " + J", hl.dsp.focus({ direction = "d" }))
hl.bind(mainMod .. " + comma", hl.dsp.focus({ monitor = "-1" }))
hl.bind(mainMod .. " + period", hl.dsp.focus({ monitor = "+1" }))
hl.bind(mainMod .. " + SHIFT + H", hl.dsp.window.move({ direction = "l" }))
hl.bind(mainMod .. " + SHIFT + L", hl.dsp.window.move({ direction = "r" }))
hl.bind(mainMod .. " + SHIFT + K", hl.dsp.window.move({ direction = "u" }))
hl.bind(mainMod .. " + SHIFT + J", hl.dsp.window.move({ direction = "d" }))
hl.bind(mainMod .. " + SHIFT + comma", hl.dsp.workspace.move({ monitor = "-1" }))
hl.bind(mainMod .. " + SHIFT + period", hl.dsp.workspace.move({ monitor = "+1" }))
hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
-- Binds :: Workspace
hl.bind(mainMod .. " + 0", hl.dsp.focus({ workspace = "name:extra" }))
hl.bind(mainMod .. " + SHIFT + 0", hl.dsp.window.move({ workspace = "name:extra" }))
hl.bind("ALT + SHIFT + 0", hl.dsp.window.move({ workspace = "name:extra", follow = false }))
hl.bind(mainMod .. " + CTRL + SHIFT + right", hl.dsp.window.move({ workspace = "+1" }))
hl.bind(mainMod .. " + CTRL + SHIFT + left", hl.dsp.window.move({ workspace = "-1" }))
hl.bind("ALT + CTRL + SHIFT + right", hl.dsp.window.move({ workspace = "+1", follow = false }))
hl.bind("ALT + CTRL + SHIFT + left", hl.dsp.window.move({ workspace = "-1", follow = false }))
hl.bind(mainMod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" }))
hl.bind(mainMod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }))
hl.bind(mainMod .. " + Tab", hl.dsp.focus({ workspace = "e+1" }))
hl.bind(mainMod .. " + SHIFT + Tab", hl.dsp.focus({ workspace = "e-1" }))
hl.bind(mainMod .. " + CTRL + right", hl.dsp.focus({ workspace = "+1" }))
hl.bind(mainMod .. " + CTRL + left", hl.dsp.focus({ workspace = "-1" }))
for i=1, 9 do
hl.bind(mainMod .. " + " .. i, hl.dsp.focus({ workspace = i }))
hl.bind(mainMod .. " + SHIFT + " .. i, hl.dsp.window.move({ workspace = i }))
hl.bind("ALT + SHIFT + " .. i, hl.dsp.window.move({ workspace = i, follow = false }))
end
-- Binds :: MultiMedia
hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true })
hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { locked = true })
hl.bind("XF86AudioMute", hl.dsp.exec_cmd("dms ipc call audio mute"), { locked = true })
hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("dms ipc call audio micmute"), { locked = true })
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("dms ipc call audio increment 3"), { locked = true, repeating = true })
hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("dms ipc call audio decrement 3"), { locked = true, repeating = true })
hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("dms ipc call brightness increment 5"), { locked = true, repeating = true })
hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("dms ipc call brightness decrement 5"), { locked = true, repeating = true })
-- Binds :: Submaps
hl.bind(mainMod .. " + R", hl.dsp.submap("resize"))
hl.define_submap("resize", function()
hl.bind("left", hl.dsp.window.resize({ x = -10, y = 0 }), { repeating = true })
hl.bind("right", hl.dsp.window.resize({ x = 0, y = -10 }), { repeating = true })
hl.bind("up", hl.dsp.window.resize({ x = 0, y = 10 }), { repeating = true })
hl.bind("down", hl.dsp.window.resize({ x = 10, y = 0 }), { repeating = true })
hl.bind("H", hl.dsp.window.resize({ x = -10, y = 0 }), { repeating = true })
hl.bind("J", hl.dsp.window.resize({ x = 0, y =-10 }), { repeating = true })
hl.bind("K", hl.dsp.window.resize({ x = 0, y = 10 }), { repeating = true })
hl.bind("L", hl.dsp.window.resize({ x = 10, y = 0 }), { repeating = true })
hl.bind("left", hl.dsp.submap("reset"), { release = true })
hl.bind("right", hl.dsp.submap("reset"), { release = true })
hl.bind("up", hl.dsp.submap("reset"), { release = true })
hl.bind("down", hl.dsp.submap("reset"), { release = true })
hl.bind("H", hl.dsp.submap("reset"), { release = true })
hl.bind("J", hl.dsp.submap("reset"), { release = true })
hl.bind("K", hl.dsp.submap("reset"), { release = true })
hl.bind("L", hl.dsp.submap("reset"), { release = true })
hl.bind("escape", hl.dsp.submap("reset"))
end)
hl.bind(mainMod .. " + B", hl.dsp.submap("browser"))
hl.define_submap("browser", function()
hl.bind("B", hl.dsp.exec_cmd("brave"))
hl.bind("F", hl.dsp.exec_cmd("Floorp"))
hl.bind("B", hl.dsp.submap("reset"), { release = true })
hl.bind("F", hl.dsp.submap("reset"), { release = true })
hl.bind("escape", hl.dsp.submap("reset"))
end)
hl.bind(mainMod .. " + V", hl.dsp.submap("video"))
hl.define_submap("video", function()
hl.bind("O", hl.dsp.exec_cmd("obs"))
hl.bind("K", hl.dsp.exec_cmd("kdenlive"))
hl.bind("O", hl.dsp.submap("reset"), { release = true })
hl.bind("K", hl.dsp.submap("reset"), { release = true })
hl.bind("escape", hl.dsp.submap("reset"))
end)
-- # Binds :: Global :: Discord
-- bind = , F7, pass, class:^(discord|Discord)$
-- bind = , F8, pass, class:^(discord|Discord)$
-- # bind = , T, pass, class:^(discord|Discord)$
--
-- # Binds :: Global :: OBS
-- bind = , F9, pass, class:^(.*obs.*)$
+56
View File
@@ -0,0 +1,56 @@
-- default colors
--image = /home/liamm/Pictures/wallpapers/frieren-flower-crown.jpeg
Color_background = "rgba(0e141cff)"
Color_error = "rgba(ffb4abff)"
Color_error_container = "rgba(93000aff)"
Color_inverse_on_surface = "rgba(2b313aff)"
Color_inverse_primary = "rgba(005fadff)"
Color_inverse_surface = "rgba(dee2efff)"
Color_on_background = "rgba(dee2efff)"
Color_on_error = "rgba(690005ff)"
Color_on_error_container = "rgba(ffdad6ff)"
Color_on_primary = "rgba(00315dff)"
Color_on_primary_container = "rgba(d4e3ffff)"
Color_on_primary_fixed = "rgba(001c39ff)"
Color_on_primary_fixed_variant = "rgba(004784ff)"
Color_on_secondary = "rgba(262f4dff)"
Color_on_secondary_container = "rgba(dce1ffff)"
Color_on_secondary_fixed = "rgba(111a37ff)"
Color_on_secondary_fixed_variant = "rgba(3d4665ff)"
Color_on_surface = "rgba(dee2efff)"
Color_on_surface_variant = "rgba(c2c6d2ff)"
Color_on_tertiary = "rgba(2d2b59ff)"
Color_on_tertiary_container = "rgba(e3dfffff)"
Color_on_tertiary_fixed = "rgba(181543ff)"
Color_on_tertiary_fixed_variant = "rgba(444171ff)"
Color_outline = "rgba(8c919cff)"
Color_outline_variant = "rgba(424751ff)"
Color_primary = "rgba(a4c9ffff)"
Color_primary_container = "rgba(004784ff)"
Color_primary_fixed = "rgba(d4e3ffff)"
Color_primary_fixed_dim = "rgba(a4c9ffff)"
Color_scrim = "rgba(000000ff)"
Color_secondary = "rgba(bcc5ebff)"
Color_secondary_container = "rgba(3d4665ff)"
Color_secondary_fixed = "rgba(dce1ffff)"
Color_secondary_fixed_dim = "rgba(bcc5ebff)"
Color_shadow = "rgba(000000ff)"
Color_source_color = "rgba(3680d3ff)"
Color_surface = "rgba(0e141cff)"
Color_surface_bright = "rgba(343943ff)"
Color_surface_container = "rgba(1a2028ff)"
Color_surface_container_high = "rgba(252a33ff)"
Color_surface_container_highest = "rgba(30353eff)"
Color_surface_container_low = "rgba(161c24ff)"
Color_surface_container_lowest = "rgba(090e17ff)"
Color_surface_dim = "rgba(0e141cff)"
Color_surface_tint = "rgba(a4c9ffff)"
Color_surface_variant = "rgba(424751ff)"
Color_tertiary = "rgba(c5c1f9ff)"
Color_tertiary_container = "rgba(444171ff)"
Color_tertiary_fixed = "rgba(e3dfffff)"
Color_tertiary_fixed_dim = "rgba(c5c1f9ff)"
-- load dynamic colors
dofile(os.getenv("HOME") .. "/.config/hypr/hypr-colors.conf")
+8
View File
@@ -0,0 +1,8 @@
require("variables")
require("settings")
require("animations")
require("binds")
require("rules")
-- desktop vs laptop
require("system")
+67
View File
@@ -0,0 +1,67 @@
local float_classes = {
"^(.*Emulator.*)$", "^(.*desktop-portal.*)$", "^(org.quickshell)$",
"^(polkit.*agent.*)$", "^(praat)$", "^(network)$", "^(nm-)$", "^(Network)$",
"^(Rofi)$", "^(Gimp)$", "^(thunar)$", "^(Nautilus)$",
"^(LmDev-.*)$", "^(notification)$", "^(Genymotion Player)$", "^(launcher)$",
}
local workspace_rules = {
{ class = "^(KeePassXC)$", ws = "2" },
{ class = "^(firefox)$", ws = "3" },
{ class = "^(floorp)$", ws = "3" },
{ class = "^(brave-browser)$", ws = "3" },
{ class = "^(Spotify)$", ws = "4" },
{ class = "^(discord)$", ws = "6" },
{ class = "^(.*obs.*)$", ws = "8" },
{ title = "^(Minecraft)$", ws = "name:extra" },
{ class = "^(signal)$", title = "^(Signal)$", ws = "6" },
{ class = "^(.*)$", title = "^(.*WhatsApp.*)$", ws = "6" },
}
local fullscreen_inhibits = {
"^(floorp)$", "^(firefox)$", "^(ghostty)$", "^(brave-browser)$",
}
local focus_inhibits = {
"^(mpv)$", "^(firefox)$", "^(floorp)$", "^(spotify)$",
"^(Emacs|emacs)$", "^(brave-browser)$", "^(Discord|dicord)$",
}
hl.window_rule({
match = { class = "steam", title = "^(Friends List)$"},
float = true,
})
hl.window_rule({
match = { class = "^(Discord|discord)$" },
opacity = "0.98 0.90",
})
hl.window_rule({
match = { class = "^(Emacs|emacs)$" },
opacity = "0.96 0.90",
})
hl.window_rule({
match = { xwayland = true },
rounding = 0,
})
for _, float_class in ipairs(float_classes) do
hl.window_rule({
match = { class = float_class},
float = true
})
end
for _, rule in ipairs(workspace_rules) do
hl.window_rule({
match = { class = rule.class, title = rule.title },
workspace = rule.ws
})
end
for _, fs_inhib in ipairs(fullscreen_inhibits) do
hl.window_rule({
match = { class = fs_inhib },
idle_inhibit = "fullscreen",
})
end
for _, fo_inhib in ipairs(focus_inhibits) do
hl.window_rule({
match = { class = fo_inhib },
idle_inhibit = "focus",
})
end
+80
View File
@@ -0,0 +1,80 @@
hl.env("HYPRCURSOR_SIZE", "24")
hl.env("HYPRCURSOR_THEME", "Bibate-Modern-Ice")
hl.env("XCURSOR_SIZE", "24")
hl.env("XCURSOR_THEME", "Bibate-Modern-Ice")
hl.env("XDG_CURRENT_DESKTOP", "Hyprland")
hl.env("XDG_SESSION_TYPE", "wayland")
hl.env("XDG_SESSION_DESKTOP", "Hyprland")
hl.env("QT_QPA_PLATFORM", "wayland")
hl.on("hyprland.start", function()
hl.exec_cmd("bash -c 'wl-paste --watch cliphist store &'")
hl.exec_cmd("fcitx5 -d")
hl.exec_cmd("emacs --daemon")
hl.exec_cmd("dms run")
end)
hl.config({
general = {
gaps_in = gaps_in,
gaps_out = gaps_out,
border_size = 2,
resize_on_border = true,
allow_tearing = true,
layout = "scrolling",
col = {
active_border = Color_primary_container,
inactive_border = Color_secondary_container,
},
},
decoration = {
rounding = 10,
blur = {
enabled = true,
new_optimizations = true,
passes = 2,
size = 3,
xray = true,
},
shadow = {
color = Color_shadow,
enabled = true,
range = 4,
render_power = 4,
},
},
input = {
touchpad = {
disable_while_typing = true,
drag_lock = false,
middle_button_emulation = true,
natural_scroll = true,
scroll_factor = 0.5,
tap_to_click = true,
},
follow_mouse = 1,
kb_layout = us,
numlock_by_default = true,
sensitivity = 0,
},
render = {
cm_enabled = true,
cm_auto_hdr = 0,
direct_scanout = 2,
},
misc = {
disable_hyprland_logo = true,
disable_splash_rendering = true,
key_press_enables_dpms = true,
mouse_move_enables_dpms = true,
},
quirks = {
prefer_hdr = 0,
},
ecosystem = {
no_donation_nag = true,
no_update_news = true,
},
})
+11
View File
@@ -0,0 +1,11 @@
lock = "dms ipc call lock lock"
screenshot = "grimblast --cursor copy output"
screenshot_area = "hyprctl keyword animation 'fadeOut,0,0,default'; grimblast copy area; hyprctl keyword animation 'fadeOut,1,4,default'"
discord = "discord --enable-blink-features=MiddleClickAutoscroll"
colorpick = "dms ipc call color-picker toggleInstant"
mainMod = "SUPER"
gaps_in = 2
gaps_out = 4
require("colors")