Change to lua style for hyprland

This commit is contained in:
2026-05-12 23:16:21 +02:00
parent 66ed635dba
commit 84f687e9f1
13 changed files with 310 additions and 7 deletions

View File

@@ -0,0 +1,22 @@
exec-once = XDG_MENU_PREFIX=arch- kbuildsycoca6
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
# exec-once = pipewire
# exec-once = pipewire && sleep 2 && wireplumber
exec-once = awww-daemon
exec-once = sleep .5 && awww img ~/.wallpaper/cat.gif -o DP-6
exec-once = sleep .5 && awww img ~/.wallpaper/train_station.gif -o DP-7
exec-once = gentoo-pipewire-launcher
exec-once = /usr/libexec/hyprpolkitagent
exec-once = dunst
exec-once = killall -q waybar; sleep .5 && env LC_TIME=de_DE.UTF-8 waybar
# exec-once = hyprpaper
exec-once = [workspace 1 silent] $terminal
# exec-once = [workspace 6 silent] $spotify
# exec-once = xrandr --output DP-4 --primary
# exec-once = playerctld daemon

View File

@@ -0,0 +1,9 @@
hl.on("hyprland.start", function()
hl.exec_cmd("awww-daemon")
hl.exec_cmd("awww img ~/.wallpaper/cat.gif -o " .. SECONDARY_DISPLAY)
hl.exec_cmd("awww img ~/.wallpaper/train_station.gif -o " .. MAIN_DISPLAY)
hl.exec_cmd("gentoo-pipewire-launcher")
hl.exec_cmd("/usr/libexec/hyprpolkitagent")
hl.exec_cmd("dunst")
hl.exec_cmd("killall -q waybar; sleep .5 && env LC_TIME=de_DE.UTF-8 waybar")
end)

View File

@@ -36,7 +36,7 @@ bindl=, XF86AudioNext, exec, playerctl next
bindl=, XF86AudioPrev, exec, playerctl previous bindl=, XF86AudioPrev, exec, playerctl previous
# also make sure you created a directory called screenshots in Pictures/ otherwise the screenshots won't appear anywhere # also make sure you created a directory called screenshots in Pictures/ otherwise the screenshots won't appear anywhere
bind = $mainMod, S, exec, grim -o DP-3 "${HOME}/Pictures/screenshots/screenshot-$(date +%F-%T).png" bind = $mainMod, S, exec, grim -o DP-7 "${HOME}/screenshots/screenshot-$(date +%F-%T).png"
# screenshot + crop keybind # screenshot + crop keybind
bind = $mainMod SHIFT, S, exec, grim -g "$(slurp)" - | wl-copy bind = $mainMod SHIFT, S, exec, grim -g "$(slurp)" - | wl-copy
@@ -78,7 +78,7 @@ bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10 bind = $mainMod SHIFT, 0, movetoworkspace, 10
# Example special workspace (scratchpad) # Example special workspace (scratchpad)
bind = $mainMod, S, togglespecialworkspace, magic # bind = $mainMod, S, togglespecialworkspace, magic
# bind = $mainMod SHIFT, S, movetoworkspace, special:magic # bind = $mainMod SHIFT, S, movetoworkspace, special:magic
# Scroll through existing workspaces with mainMod + scroll # Scroll through existing workspaces with mainMod + scroll
@@ -90,6 +90,7 @@ bind = $mainMod, F, fullscreen
# Move/resize windows with mainMod + LMB/RMB and dragging # Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow bindm = $mainMod, mouse:273, resizewindow
bindm = CONTROL, mouse:272, movewindow
bind = $mainMod SHIFT, H, movewindow, l bind = $mainMod SHIFT, H, movewindow, l
bind = $mainMod SHIFT, L, movewindow, r bind = $mainMod SHIFT, L, movewindow, r

View File

@@ -0,0 +1,52 @@
local mainMod = "SUPER"
-- Quit Keys
hl.bind(mainMod .. " + Q", hl.dsp.window.close())
hl.bind(mainMod .. " + CTRL + Q", hl.dsp.exit())
-- Program keys
hl.bind(mainMod .. " + T", hl.dsp.exec_cmd(TERMINAL))
hl.bind(mainMod .. " + R", hl.dsp.exec_cmd(MENU))
hl.bind(mainMod .. " + B", hl.dsp.exec_cmd(BROWSER))
hl.bind(mainMod .. " + O", hl.dsp.exec_cmd(HYPRLOCK))
hl.bind(mainMod .. " + G", hl.dsp.exec_cmd(STEAM))
hl.bind(mainMod .. " + S",
hl.dsp.exec_cmd("grim -o" .. MAIN_DISPLAY .. " \"${HOME}/screenshots/screenshot-$(date +%F-%T).png\""))
hl.bind(mainMod .. " + SHIFT + S", hl.dsp.exec_cmd("grim -g \"$(slurp)\" - | wl-copy"))
-- Movement Keys
hl.bind(mainMod .. " + H", hl.dsp.focus({ direction = "left" }))
hl.bind(mainMod .. " + L", hl.dsp.focus({ direction = "right" }))
hl.bind(mainMod .. " + J", hl.dsp.focus({ direction = "down" }))
hl.bind(mainMod .. " + K", hl.dsp.focus({ direction = "up" }))
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 + J", hl.dsp.window.move({ direction = "down" }))
hl.bind(mainMod .. " + SHIFT + K", hl.dsp.window.move({ direction = "up" }))
hl.bind(mainMod .. " + CTRL + H", hl.dsp.window.resize({ x = -10, y = 0 }), { repeating = true })
hl.bind(mainMod .. " + CTRL + L", hl.dsp.window.resize({ x = 10, y = 0 }), { repeating = true })
hl.bind(mainMod .. " + CTRL + J", hl.dsp.window.resize({ x = 0, y = -10 }), { repeating = true })
hl.bind(mainMod .. " + CTRL + K", hl.dsp.window.resize({ x = 0, y = 10 }), { repeating = true })
for i = 1, 10 do
local key = i % 10
hl.bind(mainMod .. " + " .. key, hl.dsp.focus({ workspace = i }))
hl.bind(mainMod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = i }))
end
-- Resize Keys
hl.bind(mainMod .. " + F", hl.dsp.window.fullscreen({ action = "toggle" }))
hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
-- Multimedia Keys
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"),
{ locked = true, repeating = true })
hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"),
{ locked = true, repeating = true })
hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"))
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 })

View File

@@ -0,0 +1,8 @@
TERMINAL = "ghostty"
MENU = "fuzzel"
BROWSER = "firefox"
HYPRLOCK = "hyprlock"
STEAM = "steam"
MAIN_DISPLAY = "DP-7"
SECONDARY_DISPLAY = "DP-6"

View File

@@ -0,0 +1,10 @@
hl.env("XCURSOR_SIZE", "24")
hl.env("HYPRCURSOR_SIZE", "24")
hl.env("HYPRCURSOR_THEME", "catppuccin-mocha-green-cursors")
hl.env("XCURSOR_THEME", "catppuccin-mocha-green-cursors")
hl.env("LIBVA_DRIVER_NAME", "nvidia")
hl.env("XDG_SESSION_TYPE", "wayland")
hl.env("GBM_BACKEND", "nvidia-drm")
hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia")
hl.env("NVD_BACKEND", "direct")
hl.env("WLR_NO_HARDWARE_CURSORS", "1")

View File

@@ -4,8 +4,8 @@ monitor=DP-6,1920x1200@60,auto-left,1,transform,1
workspace=DP-6,6 workspace=DP-6,6
general { general {
gaps_in = 0 gaps_in = 5
gaps_out = 0 gaps_out = 10
border_size = 1 border_size = 1
@@ -14,7 +14,7 @@ general {
col.inactive_border = rgba(595959aa) col.inactive_border = rgba(595959aa)
# Set to true enable resizing windows by clicking and dragging on borders and gaps # Set to true enable resizing windows by clicking and dragging on borders and gaps
resize_on_border = false resize_on_border = true
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false allow_tearing = false
@@ -28,7 +28,7 @@ cursor {
# https://wiki.hyprland.org/Configuring/Variables/#decoration # https://wiki.hyprland.org/Configuring/Variables/#decoration
decoration { decoration {
# rounding = 10 rounding = 10
# Change transparency of focused and unfocused windows # Change transparency of focused and unfocused windows
active_opacity = 1.0 active_opacity = 1.0

View File

@@ -0,0 +1,129 @@
-- monitor stuff
hl.monitor({
output = MAIN_DISPLAY,
mode = "2560x1440@240",
position = "auto",
scale = "auto"
})
hl.monitor({
output = SECONDARY_DISPLAY,
mode = "preferred",
position = "auto-left",
scale = "auto",
transform = 1
})
-- backup monitor
hl.monitor({
output = "",
mode = "preferred",
position = "auto",
scale = "1"
})
-- general
hl.config({
general = {
gaps_in = 5,
gaps_out = 20,
border_size = 1,
col = {
active_border = { colors = { "rgba(33ccffee)", "rgba(00ff99ee)" }, angle = 45 },
inactive_border = "rgba(595959aa)",
},
resize_on_border = false,
layout = "dwindle",
allow_tearing = false,
},
decoration = {
rounding = 10,
rounding_power = 2,
active_opacity = 1.0,
fullscreen_opacity = 1.0,
blur = {
enabled = true,
size = 3,
passes = 1,
vibrancy = 0.1696,
}
},
animations = {
enabled = true,
},
cursor = {
no_hardware_cursors = 1
}
})
-- Animation stuff copied straight from docs
-- Default curves and animations, see https://wiki.hypr.land/Configuring/Advanced-and-Cool/Animations/
hl.curve("easeOutQuint", { type = "bezier", points = { { 0.23, 1 }, { 0.32, 1 } } })
hl.curve("easeInOutCubic", { type = "bezier", points = { { 0.65, 0.05 }, { 0.36, 1 } } })
hl.curve("linear", { type = "bezier", points = { { 0, 0 }, { 1, 1 } } })
hl.curve("almostLinear", { type = "bezier", points = { { 0.5, 0.5 }, { 0.75, 1 } } })
hl.curve("quick", { type = "bezier", points = { { 0.15, 0 }, { 0.1, 1 } } })
-- Default springs
hl.curve("easy", { type = "spring", mass = 1, stiffness = 71.2633, dampening = 15.8273644 })
hl.animation({ leaf = "global", enabled = true, speed = 10, bezier = "default" })
hl.animation({ leaf = "border", enabled = true, speed = 5.39, bezier = "easeOutQuint" })
hl.animation({ leaf = "windows", enabled = true, speed = 4.79, spring = "easy" })
hl.animation({ leaf = "windowsIn", enabled = true, speed = 4.1, spring = "easy", style = "popin 87%" })
hl.animation({ leaf = "windowsOut", enabled = true, speed = 1.49, bezier = "linear", style = "popin 87%" })
hl.animation({ leaf = "fadeIn", enabled = true, speed = 1.73, bezier = "almostLinear" })
hl.animation({ leaf = "fadeOut", enabled = true, speed = 1.46, bezier = "almostLinear" })
hl.animation({ leaf = "fade", enabled = true, speed = 3.03, bezier = "quick" })
hl.animation({ leaf = "layers", enabled = true, speed = 3.81, bezier = "easeOutQuint" })
hl.animation({ leaf = "layersIn", enabled = true, speed = 4, bezier = "easeOutQuint", style = "fade" })
hl.animation({ leaf = "layersOut", enabled = true, speed = 1.5, bezier = "linear", style = "fade" })
hl.animation({ leaf = "fadeLayersIn", enabled = true, speed = 1.79, bezier = "almostLinear" })
hl.animation({ leaf = "fadeLayersOut", enabled = true, speed = 1.39, bezier = "almostLinear" })
hl.animation({ leaf = "workspaces", enabled = true, speed = 1.94, bezier = "almostLinear", style = "fade" })
hl.animation({ leaf = "workspacesIn", enabled = true, speed = 1.21, bezier = "almostLinear", style = "fade" })
hl.animation({ leaf = "workspacesOut", enabled = true, speed = 1.94, bezier = "almostLinear", style = "fade" })
hl.animation({ leaf = "zoomFactor", enabled = true, speed = 7, bezier = "quick" })
-- Layout stuff and misc
hl.config({
dwindle = {
preserve_split = true
}
})
hl.config({
misc = {
force_default_wallpaper = -1,
disable_hyprland_logo = false,
focus_on_activate = false,
}
})
-- Input
hl.config({
input = {
kb_layout = "de",
kb_variant = "nodeadkeys",
follow_mouse = 1,
sensitivity = 0.2,
force_no_accel = 1,
}
})
-- Device specific
hl.device({
name = "kinesis-kinesis-adv360-1",
kb_layout = "us",
kb_variant = "",
})

View File

@@ -35,3 +35,11 @@ windowrule = no_focus on, no_initial_focus on, match:class ^(steam)$, match:titl
windowrule = float on, match:class ^(jetbrains-.*)$, match:title ^(win[0-9]+)$ windowrule = float on, match:class ^(jetbrains-.*)$, match:title ^(win[0-9]+)$
windowrule = no_focus on, match:class ^(jetbrains-.*)$, match:title ^(win[0-9]+)$ windowrule = no_focus on, match:class ^(jetbrains-.*)$, match:title ^(win[0-9]+)$
# Smart gaps
workspace = w[tv1], gapsout:0, gapsin:0
workspace = f[1], gapsout:0, gapsin:0
windowrule = border_size 0, match:float 0, match:workspace w[tv1]
windowrule = rounding 0, match:float 0, match:workspace w[tv1]
windowrule = border_size 0, match:float 0, match:workspace f[1]
windowrule = rounding 0, match:float 0, match:workspace f[1]

View File

@@ -0,0 +1,47 @@
-- No gaps when only window
hl.workspace_rule({ workspace = "w[tv1]", gaps_out = 0, gaps_in = 0 })
hl.workspace_rule({ workspace = "f[1]", gaps_out = 0, gaps_in = 0 })
hl.window_rule({
name = "no-gaps-wtv1",
match = { float = false, workspace = "w[tv1]" },
border_size = 0,
rounding = 0,
})
hl.window_rule({
name = "no-gaps-f1",
match = { float = false, workspace = "f[1]" },
border_size = 0,
rounding = 0,
})
-- Workspaces to monitors
for i = 1, 6 do
hl.workspace_rule({ workspace = tostring(i), monitor = MAIN_DISPLAY, persistent = true })
end
for i = 6, 10 do
hl.workspace_rule({ workspace = tostring(i), monitor = SECONDARY_DISPLAY, persistent = true })
end
hl.window_rule({
name = "steam",
match = {
class = "steam"
},
monitor = SECONDARY_DISPLAY,
workspace = "7 silent",
no_initial_focus = true,
focus_on_activate = false,
suppress_event = "activatefocus"
})
hl.window_rule({
name = "steam_notifications",
match = {
class = "^(steam)$",
title = "^(notificationtoasts_*)$"
},
no_focus = true,
no_initial_focus = true
})

View File

@@ -0,0 +1,10 @@
{
"workspace": {
"library": [
"/usr/share/hypr/stubs"
]
},
"diagnostics": {
"globals": ["hl"]
}
}

View File

@@ -0,0 +1,6 @@
require("config.constants")
require("config.env")
require("config.autostart")
require("config.binds")
require("config.general")
require("config.rules")

View File

@@ -1,7 +1,8 @@
return { return {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
config = function() config = function()
vim.lsp.enable({ "lua_ls", vim.lsp.enable({
"lua_ls",
"basedpyright", "basedpyright",
"gopls", "gopls",
"html", "html",