add hyprland lua conf for laptops
nixos config pipeline / show-flake (push) Successful in 22s
nixos config pipeline / deploy (push) Successful in 56s

This commit is contained in:
smayzy
2026-08-26 23:40:14 +02:00
parent 5210fb36a0
commit 01e8bed0fc
8 changed files with 242 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
---------------
--- SOURCES ---
---------------
-- MONITORS
require("source/monitors")
-- BINDS
require("source/binds")
-- AUTOSTART
require("source/autostart")
-- ENVIRONMENT VARIABLES
require("source/ev")
-- LOOK AND FEEL
require("source/look")
-- INPUT
require("source/input")
-- WINDOWS AND WORKSPACES
require("source/winandwork")
+16
View File
@@ -0,0 +1,16 @@
-- exec_once
hl.on("hyprland.start", function ()
hl.exec_cmd("waybar")
hl.exec_cmd("/home/smayzy/.config/hypr/battery.sh")
hl.exec_cmd("systemctl --user start hypr-wallpaper.service")
hl.exec_cmd("wl-paste --type text --watch cliphist store")
hl.exec_cmd("wl-paste --type image --watch cliphist store")
hl.exec_cmd("systemctl --user start hyprpolkitagent")
hl.exec_cmd("mako")
hl.exec_cmd("thunderbird", {workspace = "10 silent"})
end)
-- exec at each reload
hl.on("config.reloaded", function ()
hl.exec_cmd("killall waybar && waybar")
end)
+94
View File
@@ -0,0 +1,94 @@
------------------------------------
--- USE WEV TO GET THE KEYS CODE ---
------------------------------------
--------------------
--- KEYBINDINGSS ---
--------------------
-- MainMod
mainMod = "SUPER"
-- exec
hl.bind(mainMod .. " + comma", hl.dsp.exit())
hl.bind(mainMod .. " + F", hl.dsp.window.fullscreen())
hl.bind(mainMod .. " + T", hl.dsp.window.float())
hl.bind(mainMod .. " + C", hl.dsp.window.close())
hl.bind(mainMod .. " + Q", hl.dsp.exec_cmd("kitty"))
hl.bind(mainMod .. " + A", hl.dsp.exec_cmd("alacritty"))
hl.bind(mainMod .. " + E", hl.dsp.exec_cmd("dolphin"))
hl.bind(mainMod .. " + R", hl.dsp.exec_cmd("wofi --show drun"))
hl.bind(mainMod .. " + W", hl.dsp.exec_cmd("wlogout"))
hl.bind("XF86Calculator", hl.dsp.exec_cmd("qalculate-gtk"))
-- Volume
hl.bind("XF86AudioMute" , hl.dsp.exec_cmd("pactl set-sink-volume @DEFAULT_SINK@ 0%"))
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("pactl set-sink-volume @DEFAULT_SINK@ +5%"))
hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("pactl set-sink-volume @DEFAULT_SINK@ -5%"))
-- Brightness
hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl set 5%-"))
hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl set 5%+"))
-- Change wallpaper
hl.bind(mainMod .. " + SHIFT + W", hl.dsp.exec_cmd("echo trigger > /tmp/wallpaper-trigger"))
-- Reload waybar
hl.bind(mainMod .. " + SHIFT + B", hl.dsp.exec_cmd("pkill waybar && waybar"))
-- Hide waybar
hl.bind(mainMod .. " + X", hl.dsp.exec_cmd("pkill waybar || waybar"))
-- Clipboard history
hl.bind(mainMod .. " + V", hl.dsp.exec_cmd("cliphist list | wofi -dmenu | cliphist decode | wl-copy"))
-- Screenshot to clipboard
hl.bind(mainMod .. " + SHIFT + S", hl.dsp.exec_cmd("grim -g \"$(slurp -d)\" - | wl-copy"))
-- Move focus with mainMod + arrow keys
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"}))
-- 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 })
-- Resize Windows
hl.bind(mainMod .. " + CTRL + h", hl.dsp.window.resize({ x = -20 , y = 0 , relative = true }))
hl.bind(mainMod .. " + CTRL + l", hl.dsp.window.resize({ x = 20 , y = 0 , relative = true }))
hl.bind(mainMod .. " + CTRL + k", hl.dsp.window.resize({ x = 0 , y = -20 , relative = true }))
hl.bind(mainMod .. " + CTRL + j", hl.dsp.window.resize({ x = 0 , y = 20 , relative = true }))
-- Switch workspaces
hl.bind(mainMod .. " + ampersand", hl.dsp.focus({ workspace = "1"}))
hl.bind(mainMod .. " + eacute", hl.dsp.focus({ workspace = "2"}))
hl.bind(mainMod .. " + quotedbl", hl.dsp.focus({ workspace = "3"}))
hl.bind(mainMod .. " + apostrophe", hl.dsp.focus({ workspace = "4"}))
hl.bind(mainMod .. " + parenleft", hl.dsp.focus({ workspace = "5"}))
hl.bind(mainMod .. " + minus", hl.dsp.focus({ workspace = "6"}))
hl.bind(mainMod .. " + egrave", hl.dsp.focus({ workspace = "7"}))
hl.bind(mainMod .. " + underscore", hl.dsp.focus({ workspace = "8"}))
hl.bind(mainMod .. " + ccedilla", hl.dsp.focus({ workspace = "9"}))
hl.bind(mainMod .. " + agrave", hl.dsp.focus({ workspace = "10"}))
hl.bind(mainMod .. " + dead_circumflex", hl.dsp.focus({ workspace = "11"}))
hl.bind(mainMod .. " + dollar", hl.dsp.focus({ workspace = "12"}))
hl.bind(mainMod .. " + ugrave", hl.dsp.focus({ workspace = "13"}))
hl.bind(mainMod .. " + asterisk", hl.dsp.focus({ workspace = "14"}))
-- Move active window to a workspace
hl.bind(mainMod .. " + SHIFT + ampersand", hl.dsp.window.move({ workspace = "1"}))
hl.bind(mainMod .. " + SHIFT + eacute", hl.dsp.window.move({ workspace = "2"}))
hl.bind(mainMod .. " + SHIFT + quotedbl", hl.dsp.window.move({ workspace = "3"}))
hl.bind(mainMod .. " + SHIFT + apostrophe", hl.dsp.window.move({ workspace = "4"}))
hl.bind(mainMod .. " + SHIFT + parenleft", hl.dsp.window.move({ workspace = "5"}))
hl.bind(mainMod .. " + SHIFT + minus", hl.dsp.window.move({ workspace = "6"}))
hl.bind(mainMod .. " + SHIFT + egrave", hl.dsp.window.move({ workspace = "7"}))
hl.bind(mainMod .. " + SHIFT + underscore", hl.dsp.window.move({ workspace = "8"}))
hl.bind(mainMod .. " + SHIFT + ccedilla", hl.dsp.window.move({ workspace = "9"}))
hl.bind(mainMod .. " + SHIFT + agrave", hl.dsp.window.move({ workspace = "10"}))
hl.bind(mainMod .. " + SHIFT + dead_circumflex", hl.dsp.window.move({ workspace = "11"}))
hl.bind(mainMod .. " + SHIFT + dollar", hl.dsp.window.move({ workspace = "12"}))
hl.bind(mainMod .. " + SHIFT + ugrave", hl.dsp.window.move({ workspace = "13"}))
hl.bind(mainMod .. " + SHIFT + asterisk", hl.dsp.window.move({ workspace = "14"}))
+6
View File
@@ -0,0 +1,6 @@
-- Set env here
hl.env("XCURSOR_SIZE", "24")
hl.env("HYPRCURSOR_SIZE", "24")
hl.env("XDG_SESSION_TYPE", "wayland")
hl.env("HYPRLAND_NO_SD_VARS", "1")
hl.env("LD_LIBRARY_PATH", "/nix/store/p5c2hfgw9pipp2vd0xvxjmly99nbsdki-pipewire-1.6.8-jack/lib/")
+22
View File
@@ -0,0 +1,22 @@
--Set inputs here
hl.config({
input = {
kb_layout = "fr",
kb_variant = "",
kb_model = "pc105",
kb_options = "terminate:ctrl_alt_bksp",
kb_rules = "",
follow_mouse = 1,
sensitivity = 0,
touchpad = {
natural_scroll = false,
},
},
cursor = {
no_hardware_cursors = 0,
}
})
+61
View File
@@ -0,0 +1,61 @@
--Set look and feel here
hl.config({
general = {
layout = "dwindle",
gaps_in = 3,
gaps_out = 5,
border_size = 1,
col = {
active_border = { colors = {"rgba(33ccffee)", "rgba(00ff99ee)"}, angle = 45 },
inactive_border = "rgba(595959aa)",
},
},
decoration = {
rounding = 6,
rounding_power = 2,
active_opacity = 1.0,
inactive_opacity = 1.0,
shadow = {
enabled = false
},
blur = {
enabled = false,
},
},
animations = {
enabled = true,
},
dwindle = {
preserve_split = true,
},
master = {
new_status = "master",
},
misc = {
force_default_wallpaper = 0,
disable_hyprland_logo = true,
},
ecosystem = {
no_update_news = true,
no_donation_nag = true,
}
})
hl.curve( "mybezier", { type = "bezier", points = { {0.05, 0.9}, {0.1, 1.05} } })
hl.animation({ leaf = "windows", enabled = true, speed = 7, bezier = "mybezier" })
hl.animation({ leaf = "windowsOut", enabled = true, speed = 7, bezier = "mybezier" })
hl.animation({ leaf = "border", enabled = true, speed = 7, bezier = "mybezier" })
hl.animation({ leaf = "borderangle", enabled = true, speed = 7, bezier = "mybezier" })
hl.animation({ leaf = "fade", enabled = true, speed = 7, bezier = "mybezier" })
hl.animation({ leaf = "workspaces", enabled = true, speed = 7, bezier = "mybezier" })
+6
View File
@@ -0,0 +1,6 @@
hl.monitor({
output = "",
mode = "preferred",
position = "auto",
scale = 1
})
+19
View File
@@ -0,0 +1,19 @@
hl.window_rule({
name = "suppress-maximize-events",
match = {class = ".*"},
suppress_event = "maximize"
})
hl.window_rule({
name = "fix-xwayland-drags",
match = {
class = "^$",
title = "^$",
xwayland = true,
float = true,
fullscreen = false,
pin = false,
},
no_focus = true,
})