From 1eadb45ac7e092da81601e0f48203696c5cdec4c Mon Sep 17 00:00:00 2001 From: Daniele Pintore Date: Tue, 12 May 2026 16:16:33 +0200 Subject: [PATCH] feat: migrate hyprland configs to lua --- .config/hypr/.luarc.json | 10 ++ .config/hypr/fn_keys.conf | 30 ---- .config/hypr/hyprland.conf | 231 ------------------------------ .config/hypr/hyprland.lua | 8 ++ .config/hypr/lua/autostart.lua | 19 +++ .config/hypr/lua/binds.lua | 89 ++++++++++++ .config/hypr/lua/defaults.lua | 8 ++ .config/hypr/lua/env.lua | 9 ++ .config/hypr/lua/input.lua | 42 ++++++ .config/hypr/lua/monitors.lua | 10 ++ .config/hypr/lua/permissions.lua | 18 +++ .config/hypr/lua/theme.lua | 140 ++++++++++++++++++ .config/hypr/lua/utils.lua | 10 ++ .config/hypr/lua/window_rules.lua | 113 +++++++++++++++ .config/hypr/windows_rules.conf | 49 ------- 15 files changed, 476 insertions(+), 310 deletions(-) create mode 100644 .config/hypr/.luarc.json delete mode 100644 .config/hypr/fn_keys.conf delete mode 100644 .config/hypr/hyprland.conf create mode 100644 .config/hypr/hyprland.lua create mode 100644 .config/hypr/lua/autostart.lua create mode 100644 .config/hypr/lua/binds.lua create mode 100644 .config/hypr/lua/defaults.lua create mode 100644 .config/hypr/lua/env.lua create mode 100644 .config/hypr/lua/input.lua create mode 100644 .config/hypr/lua/monitors.lua create mode 100644 .config/hypr/lua/permissions.lua create mode 100644 .config/hypr/lua/theme.lua create mode 100644 .config/hypr/lua/utils.lua create mode 100644 .config/hypr/lua/window_rules.lua delete mode 100644 .config/hypr/windows_rules.conf diff --git a/.config/hypr/.luarc.json b/.config/hypr/.luarc.json new file mode 100644 index 0000000..62faf36 --- /dev/null +++ b/.config/hypr/.luarc.json @@ -0,0 +1,10 @@ +{ + "workspace": { + "library": [ + "/usr/share/hypr/stubs" + ] + }, + "diagnostics": { + "globals": ["hl"] + } +} diff --git a/.config/hypr/fn_keys.conf b/.config/hypr/fn_keys.conf deleted file mode 100644 index 48dd8a4..0000000 --- a/.config/hypr/fn_keys.conf +++ /dev/null @@ -1,30 +0,0 @@ -$noctalia_ipc = qs -c noctalia-shell ipc call - -# Volume -binde =, XF86AudioLowerVolume, exec, $noctalia_ipc volume decrease -binde =, XF86AudioRaiseVolume, exec, $noctalia_ipc volume increase -bind =, XF86AudioMute, exec, $noctalia_ipc volume muteOutput - -# Mic volume -binde =SUPER,XF86AudioLowerVolume, exec, amixer -q set Dmic0 3%- -binde =SUPER,XF86AudioRaiseVolume, exec, amixer -q set Dmic0 3%+ -#binde =,XF86AudioMicMute, exec, amixer -q set Dmic0 toggle -binde =,XF86AudioMicMute, exec, $noctalia_ipc volume decrease - -#Screen brightness -binde =,XF86MonBrightnessDown, exec, $noctalia_ipc brightness decrease -binde =,XF86MonBrightnessUp, exec, $noctalia_ipc brightness increase - -# Shutdown menu -bind =SUPER,Delete,exec, $noctalia_ipc sessionMenu toggle - -# Noctalia settings menu -bind =SUPER,Home,exec, $noctalia_ipc settings toggle - -# Do not disturb -bind =, XF86NotificationCenter, exec, $noctalia_ipc notifications toggleDND - -# Media controls -bind =, XF86PickupPhone, exec, playerctl previous -bind =, XF86HangupPhone, exec, playerctl play-pause -bind =, XF86Favorites, exec, playerctl next diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf deleted file mode 100644 index 1fccf11..0000000 --- a/.config/hypr/hyprland.conf +++ /dev/null @@ -1,231 +0,0 @@ - -# ###################################################################################### -# AUTOGENERATED HYPR CONFIG. -# PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT, -# OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS. -# ####################################################################################### - -# -# Please note not all available settings / options are set here. -# For a full list, see the wiki -# -ecosystem { - no_donation_nag = true -} - -# See https://wiki.hyprland.org/Configuring/Monitors/ -# monitor=,preferred,auto,auto -monitor=eDP-1,1920x1200,auto,1.20 - - -# See https://wiki.hyprland.org/Configuring/Keywords/ for more - -# Default applications -$terminal = wezterm -$fileManager = nautilus --new-window -$browser = zen-browser -$messenger = Telegram -$aiChat = gtk-launch Perplexity.desktop - -# Execute your favorite apps at launch -exec-once = uwsm-app -- qs -c noctalia-shell -exec-once = uwsm-app -- batsignal -b -e -w 30 -c 20 -d 10 -f 100 -exec-once = uwsm-app -- nm-applet -exec-once = uwsm-app -- sleep 1 && blueman-applet -exec-once = uwsm-app -- sleep 2 && udiskie --tray # automount external hdds or usbs -exec-once = uwsm-app -- xwaylandvideobridge - -# Source a file (multi-file configs) -# source = ~/.config/hypr/myColors.conf - -# Some default env vars. -env = XCURSOR_SIZE,24 -env = HYPRCURSOR_THEME,macOS_hyprcursor -env = HYPRCURSOR_SIZE,24 - -# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ -input { - kb_layout = us - kb_variant = altgr-intl - kb_model = - kb_options = altwin:swap_lalt_lwin,ctrl:nocaps,shift:both_capslock - # kb_options description (ordered): - # swap left alt and meta keys - # set caps lock to ctrl - # press both shifts to enab - kb_rules = - - follow_mouse = 1 - - touchpad { - natural_scroll = yes - drag_lock = 0 - } - - accel_profile = flat - sensitivity = 0.2 # -1.0 - 1.0, 0 means no modification. -} - -general { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - - gaps_in = 2.5 - gaps_out = 4.5 - border_size = 1 - - #col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg - #col.inactive_border = rgba(595959aa) - - layout = dwindle -} - -decoration { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - - rounding = 10 - - blur { - enabled = true - size = 5 - passes = 2 - } - - shadow { - enabled = yes - range = 4 - render_power = 3 - color = rgba(1a1a1aee) - } -} - -animations { - enabled = no - - # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more - - bezier = myBezier, 0.05, 0.9, 0.1, 1.02 - bezier = easeOutExpo, 0.16, 1, 0.3, 1 - - animation = windows, 1, 4, myBezier - animation = windowsOut, 1, 2, default, popin 80% - animation = border, 1, 2, default - animation = borderangle, 1, 2, default - animation = fade, 1, 2, default - animation = workspaces, 1, 2, easeOutExpo -} - -dwindle { - # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more - preserve_split = yes # you probably want this -} - -master { - # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more - new_status = master -} - -gestures { - # See https://wiki.hyprland.org/Configuring/Variables/ for more -} -# Workspace switching with 3-finger horizontal swipe -gesture = 3, horizontal, workspace - -# Example per-device config -# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more -device { - name = tpps/2-elan-trackpoint - sensitivity = 0 -} - -xwayland { - force_zero_scaling = true -} - -misc { - force_default_wallpaper = 0 - disable_hyprland_logo = 1 - focus_on_activate = true -} - -# Include windows rules -source = ~/.config/hypr/windows_rules.conf - -# Include shaders config -source = ~/.config/hypr/shaders/shader.conf - -# See https://wiki.hyprland.org/Configuring/Keywords/ for more -$mainMod = SUPER -$noctalia_ipc = qs -c noctalia-shell ipc call - -# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more -bind = $mainMod, Q, exec, uwsm-app -- $terminal -bind = $mainMod SHIFT, Q, exec, uwsm-app -- $terminal --theme=BlueBerryPie --background-opacity=0.9 --initial-command="zsh -c 'ssh ctf-vm'" -bind = $mainMod, M, exec, uwsm-app -- $messenger -bind = $mainMod, E, exec, uwsm-app -- $fileManager -bind = $mainMod, W, exec, uwsm-app -- $browser -bind = $mainMod SHIFT, W, exec, uwsm-app -- $noctalia_ipc wallpaper toggle -bind = $mainMod, S, exec, uwsm-app -- sh -c 'IMG=$(xdg-user-dir PICTURES)/Screenshots/$(date +'%s_grim.png') && grim $IMG && wl-copy < $IMG' # screenshot -bind = ,print, exec, uwsm-app -- pkill slurp; sh -c 'IMG=$(xdg-user-dir PICTURES)/Screenshots/$(date +'%s_grim.png') && grim -g "$(slurp)" $IMG && wl-copy < $IMG' # screenshot only a part of the screen -bind = $mainMod SHIFT, S, exec, uwsm-app -- sh -c 'IMG=$(xdg-user-dir PICTURES)/Screenshots/$(date +'%s_grim.png') && grim -g "$(slurp)" $IMG && wl-copy < $IMG' # screenshot only a part of the screen -bind = $mainMod, R, exec, $noctalia_ipc launcher toggle -bind = $mainMod, A, exec, uwsm-app -- $aiChat -bind = $mainMod, C, killactive, -bind = $mainMod, T, togglefloating, -bind = $mainMod, P, pseudo, # dwindle -bind = $mainMod, F, fullscreen, - -# Move focus with mainMod + arrow keys -bind = $mainMod, left, movefocus, l -bind = $mainMod, right, movefocus, r -bind = $mainMod, up, movefocus, u -bind = $mainMod, down, movefocus, d - -# Move focus with mainMod + h/j/k/l like vim -bind = $mainMod, h, movefocus, l -bind = $mainMod, l, movefocus, r -bind = $mainMod, k, movefocus, u -bind = $mainMod, j, movefocus, d - -# Switch workspaces with mainMod + [0-9] -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 with mainMod + SHIFT + [0-9] -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 -bindm = SUPERALT, mouse:272, resizewindow - -# FN row control -source = ~/.config/hypr/fn_keys.conf - -# resize windows -binde = $mainMod SHIFT, l, resizeactive, 10 0 -binde = $mainMod SHIFT, h, resizeactive, -10 0 -binde = $mainMod SHIFT, k, resizeactive, 0 -10 -binde = $mainMod SHIFT, j, resizeactive, 0 10 - -source = /home/daniele/.config/hypr/noctalia/noctalia-colors.conf diff --git a/.config/hypr/hyprland.lua b/.config/hypr/hyprland.lua new file mode 100644 index 0000000..bfb2b3e --- /dev/null +++ b/.config/hypr/hyprland.lua @@ -0,0 +1,8 @@ +require("lua/monitors") +require("lua/autostart") +require("lua/env") +require("lua/permissions") +require("lua/theme") +require("lua/input") +require("lua/binds") +require("lua/window_rules") diff --git a/.config/hypr/lua/autostart.lua b/.config/hypr/lua/autostart.lua new file mode 100644 index 0000000..7d228d0 --- /dev/null +++ b/.config/hypr/lua/autostart.lua @@ -0,0 +1,19 @@ +------------------- +---- AUTOSTART ---- +------------------- + +-- See https://wiki.hypr.land/Configuring/Basics/Autostart/ + +-- Autostart necessary processes (like notifications daemons, status bars, etc.) +-- Or execute your favorite apps at launch like this: +-- +local utils = require("lua/utils") + +hl.on("hyprland.start", function () + hl.exec_cmd(utils.uwsm("nm-applet")) + hl.exec_cmd(utils.uwsm("qs -c noctalia-shell")) + hl.exec_cmd(utils.uwsm("batsignal -b -e -w 30 -c 20 -d 10 -f 100")) + hl.exec_cmd(utils.uwsm("blueman-applet")) + hl.exec_cmd(utils.uwsm("udiskie --tray")) + hl.exec_cmd(utils.uwsm("xwaylandvideobridge")) +end) diff --git a/.config/hypr/lua/binds.lua b/.config/hypr/lua/binds.lua new file mode 100644 index 0000000..a9b9c6d --- /dev/null +++ b/.config/hypr/lua/binds.lua @@ -0,0 +1,89 @@ +--------------------- +---- KEYBINDINGS ---- +--------------------- +local defaults = require("lua/defaults") +local utils = require("lua/utils") + +local mainMod = "SUPER" -- Sets "Windows" key as main modifier + +-- Example binds, see https://wiki.hypr.land/Configuring/Basics/Binds/ for more +hl.bind(mainMod .. " + Q", hl.dsp.exec_cmd(utils.uwsm(defaults.apps.terminal))) +hl.bind(mainMod .. " + C", hl.dsp.window.close()) +hl.bind(mainMod .. " + M", hl.dsp.exec_cmd(utils.uwsm(defaults.apps.messenger))) +--hl.bind(mainMod .. " + M", hl.dsp.exec_cmd("command -v hyprshutdown >/dev/null 2>&1 && hyprshutdown || hyprctl dispatch 'hl.dsp.exit()'")) +hl.bind(mainMod .. " + E", hl.dsp.exec_cmd(utils.uwsm(defaults.apps.fileManager))) +hl.bind(mainMod .. " + W", hl.dsp.exec_cmd(utils.uwsm(defaults.apps.browser))) +hl.bind(mainMod .. "+ SHIFT + W", hl.dsp.exec_cmd(utils.noctalia_ipc("wallpaper toggle"))) +hl.bind(mainMod .. " + S", hl.dsp.exec_cmd(utils.uwsm("sh -c 'IMG=$(xdg-user-dir PICTURES)/Screenshots/$(date +'%s_grim.png') && grim $IMG && wl-copy < $IMG'"))) +hl.bind(mainMod .. "+ SHIFT + S", hl.dsp.exec_cmd(utils.uwsm("sh -c 'IMG=$(xdg-user-dir PICTURES)/Screenshots/$(date +'%s_grim.png') && grim -g \"$(slurp)\" $IMG && wl-copy < $IMG'"))) +hl.bind("PRINT", hl.dsp.exec_cmd(utils.uwsm("pkill slurp; sh -c 'IMG=$(xdg-user-dir PICTURES)/Screenshots/$(date +'%s_grim.png') && grim -g \"$(slurp)\" $IMG && wl-copy < $IMG'"))) +hl.bind(mainMod .. " + R", hl.dsp.exec_cmd(utils.noctalia_ipc("launcher toggle"))) +hl.bind(mainMod .. " + T", hl.dsp.window.float({ action = "toggle" })) +hl.bind(mainMod .. " + P", hl.dsp.window.pseudo()) +hl.bind(mainMod .. " + J", hl.dsp.layout("togglesplit")) -- dwindle only +hl.bind(mainMod .. " + F", hl.dsp.window.fullscreen({ action = "toggle" })) + +-- Move focus with mainMod + arrow keys +hl.bind(mainMod .. " + left", hl.dsp.focus({ direction = "left" })) +hl.bind(mainMod .. " + right", hl.dsp.focus({ direction = "right" })) +hl.bind(mainMod .. " + up", hl.dsp.focus({ direction = "up" })) +hl.bind(mainMod .. " + down", hl.dsp.focus({ direction = "down" })) + +-- 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" })) + +-- Switch workspaces with mainMod + [0-9] +-- Move active window to a workspace with mainMod + SHIFT + [0-9] +for i = 1, 10 do + local key = i % 10 -- 10 maps to key 0 + hl.bind(mainMod .. " + " .. key, hl.dsp.focus({ workspace = i})) + hl.bind(mainMod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = i })) +end + +-- Example special workspace (scratchpad) +-- hl.bind(mainMod .. " + S", hl.dsp.workspace.toggle_special("magic")) +-- hl.bind(mainMod .. " + SHIFT + S", hl.dsp.window.move({ workspace = "special:magic" })) + +-- Scroll through existing workspaces with mainMod + scroll +hl.bind(mainMod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" })) +hl.bind(mainMod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" })) + +-- 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 }) +hl.bind("SUPER + ALT + mouse:272", hl.dsp.window.resize(), { mouse = true }) + +hl.bind(mainMod .. "+ SHIFT + l", hl.dsp.window.resize({x=10, y=0, relative = true}), { repeating = true }) +hl.bind(mainMod .. "+ SHIFT + h", hl.dsp.window.resize({x=-10, y=0, relative = true}), { repeating = true }) +hl.bind(mainMod .. "+ SHIFT + k", hl.dsp.window.resize({x=0, y=-10, relative = true}), { repeating = true }) +hl.bind(mainMod .. "+ SHIFT + j", hl.dsp.window.resize({x=0, y=10, relative = true}), { repeating = true }) + +-- +-- Laptop multimedia keys for volume and LCD brightness +hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd(utils.noctalia_ipc("volume increase")), { locked = true, repeating = true }) +hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd(utils.noctalia_ipc("volume decrease")), { locked = true, repeating = true }) + +-- Mic volume +hl.bind(mainMod .. " + XF86AudioRaiseVolume", hl.dsp.exec_cmd("amixer -q set Dmic0 3%+"), { locked = true, repeating = true }) +hl.bind(mainMod .. " + XF86AudioLowerVolume", hl.dsp.exec_cmd("amixer -q set Dmic0 3%-"), { locked = true, repeating = true }) + +hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd(utils.noctalia_ipc("volume decrease")), { locked = true, repeating = true }) +hl.bind("XF86AudioMute", hl.dsp.exec_cmd(utils.noctalia_ipc("volume muteOutput")), { locked = true, repeating = true }) +hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd(utils.noctalia_ipc("brightness increase")), { locked = true, repeating = true }) +hl.bind("XF86MonBrightnessDown",hl.dsp.exec_cmd(utils.noctalia_ipc("brightness decrease")), { locked = true, repeating = true }) +hl.bind("XF86MonBrightnessDown",hl.dsp.exec_cmd(utils.noctalia_ipc("brightness decrease")),{ locked = true, repeating = true }) + +-- Noctalia shutdown menu +hl.bind(mainMod .. " + Delete",hl.dsp.exec_cmd(utils.noctalia_ipc("sessionMenu toggle")),{ locked = false, repeating = false }) +-- Noctalia settings menu +hl.bind(mainMod .. " + HOME",hl.dsp.exec_cmd(utils.noctalia_ipc("settings toggle")),{ locked = false, repeating = false }) +-- Do not disturb +hl.bind("XF86NotificationCenter",hl.dsp.exec_cmd(utils.noctalia_ipc("notifications toggleDND")),{ locked = false, repeating = false }) + +-- Media controls (requires playerctl) +hl.bind("XF86Favorites", hl.dsp.exec_cmd("playerctl next"), { locked = true }) +hl.bind("XF86HangupPhone", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true }) +hl.bind("XF86PickupPhone", hl.dsp.exec_cmd("playerctl previous"), { locked = true }) diff --git a/.config/hypr/lua/defaults.lua b/.config/hypr/lua/defaults.lua new file mode 100644 index 0000000..919911a --- /dev/null +++ b/.config/hypr/lua/defaults.lua @@ -0,0 +1,8 @@ +return { + apps = { + terminal = "wezterm", + fileManager = "nautilus --new-window", + browser = "zen-browser", + messenger = "Telegram", + }, +} diff --git a/.config/hypr/lua/env.lua b/.config/hypr/lua/env.lua new file mode 100644 index 0000000..684f8d9 --- /dev/null +++ b/.config/hypr/lua/env.lua @@ -0,0 +1,9 @@ +------------------------------- +---- ENVIRONMENT VARIABLES ---- +------------------------------- + +-- See https://wiki.hypr.land/Configuring/Advanced-and-Cool/Environment-variables/ + +hl.env("XCURSOR_SIZE", "24") +hl.env("HYPRCURSOR_SIZE", "24") +hl.env("HYPRCURSOR_THEME", "macOS_hyprcursor") diff --git a/.config/hypr/lua/input.lua b/.config/hypr/lua/input.lua new file mode 100644 index 0000000..8917924 --- /dev/null +++ b/.config/hypr/lua/input.lua @@ -0,0 +1,42 @@ +--------------- +---- INPUT ---- +--------------- + +hl.config({ + input = { + kb_layout = "us", + kb_variant = "altgr-intl", + kb_model = "", + kb_options = "altwin:swap_lalt_lwin,ctrl:nocaps,shift:both_capslock", + -- kb_options description (ordered): + -- swap left alt and meta keys + -- set caps lock to ctrl + -- press both shifts to enab + + kb_rules = "", + + follow_mouse = 1, + + sensitivity = 0, -- -1.0 - 1.0, 0 means no modification. + accel_profile = "flat", + + touchpad = { + natural_scroll = true, + }, + + }, +}) + +hl.gesture({ + fingers = 3, + direction = "horizontal", + action = "workspace" +}) + +-- Example per-device config +-- See https://wiki.hypr.land/Configuring/Advanced-and-Cool/Devices/ for more +hl.device({ + name = "tpps/2-elan-trackpoint", + sensitivity = 0, +}) + diff --git a/.config/hypr/lua/monitors.lua b/.config/hypr/lua/monitors.lua new file mode 100644 index 0000000..5a8302f --- /dev/null +++ b/.config/hypr/lua/monitors.lua @@ -0,0 +1,10 @@ +------------------ +---- MONITORS ---- +------------------ +-- See https://wiki.hypr.land/Configuring/Basics/Monitors/ +hl.monitor({ + output = "eDP-1", + mode = "1920x1200@60", + position = "auto", + scale = "1.20", +}) diff --git a/.config/hypr/lua/permissions.lua b/.config/hypr/lua/permissions.lua new file mode 100644 index 0000000..56776cc --- /dev/null +++ b/.config/hypr/lua/permissions.lua @@ -0,0 +1,18 @@ +----------------------- +----- PERMISSIONS ----- +----------------------- + +-- See https://wiki.hypr.land/Configuring/Advanced-and-Cool/Permissions/ +-- Please note permission changes here require a Hyprland restart and are not applied on-the-fly +-- for security reasons + +hl.config({ + ecosystem = { + enforce_permissions = true, + }, +}) + +hl.permission("/usr/(bin|local/bin)/grim", "screencopy", "allow") +hl.permission("/usr/(bin|local/bin)/hyprlock", "screencopy", "allow") +hl.permission("/usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland", "screencopy", "allow") +hl.permission("/usr/(bin|local/bin)/hyprpm", "plugin", "allow") diff --git a/.config/hypr/lua/theme.lua b/.config/hypr/lua/theme.lua new file mode 100644 index 0000000..13249d6 --- /dev/null +++ b/.config/hypr/lua/theme.lua @@ -0,0 +1,140 @@ +----------------------- +---- LOOK AND FEEL ---- +----------------------- + +hl.config({ + xwayland = { + force_zero_scaling = true + } +}) + +-- Refer to https://wiki.hypr.land/Configuring/Basics/Variables/ +hl.config({ + general = { + gaps_in = 2.5, + gaps_out = 4.5, + + border_size = 1, + + col = { + active_border = { colors = {"rgba(33ccffee)", "rgba(00ff99ee)"}, angle = 45 }, + inactive_border = "rgba(595959aa)", + }, + + -- Set to true to enable resizing windows by clicking and dragging on borders and gaps + resize_on_border = false, + + -- Please see https://wiki.hypr.land/Configuring/Advanced-and-Cool/Tearing/ before you turn this on + allow_tearing = false, + + layout = "dwindle", + }, + + decoration = { + rounding = 10, + rounding_power = 2, + + -- Change transparency of focused and unfocused windows + active_opacity = 1.0, + inactive_opacity = 1.0, + + shadow = { + enabled = true, + range = 4, + render_power = 3, + color = 0xee1a1a1a, + }, + + blur = { + enabled = true, + size = 5, + passes = 2, + vibrancy = 0.1696, + }, + }, + + animations = { + enabled = true, + }, +}) + +-- 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 = "quick", style = "fade" }) +hl.animation({ leaf = "workspacesOut", enabled = true, speed = 1.94, bezier = "quick", style = "fade" }) +hl.animation({ leaf = "zoomFactor", enabled = true, speed = 7, bezier = "quick" }) + +-- Ref https://wiki.hypr.land/Configuring/Basics/Workspace-Rules/ +-- "Smart gaps" / "No gaps when only" +-- uncomment all if you wish to use that. +-- 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, +-- }) + +-- See https://wiki.hypr.land/Configuring/Layouts/Dwindle-Layout/ for more +hl.config({ + dwindle = { + preserve_split = true, -- You probably want this + }, +}) + +-- See https://wiki.hypr.land/Configuring/Layouts/Master-Layout/ for more +hl.config({ + master = { + new_status = "master", + }, +}) + +-- See https://wiki.hypr.land/Configuring/Layouts/Scrolling-Layout/ for more +hl.config({ + scrolling = { + fullscreen_on_one_column = true, + }, +}) + +hl.config({ + misc = { + force_default_wallpaper = 0, -- Set to 0 or 1 to disable the anime mascot wallpapers + disable_hyprland_logo = true, -- If true disables the random hyprland logo / anime girl background. :( + focus_on_activate = true, + }, +}) + +hl.config({ + ecosystem = { + no_donation_nag = true, + }, +}) diff --git a/.config/hypr/lua/utils.lua b/.config/hypr/lua/utils.lua new file mode 100644 index 0000000..320766e --- /dev/null +++ b/.config/hypr/lua/utils.lua @@ -0,0 +1,10 @@ +return { + uwsm = function(cmd) + assert(cmd, "uwsm() -> cmd is required") + return "uwsm-app -- " .. cmd + end, + noctalia_ipc = function(cmd) + assert(cmd, "noctalia_ipc() -> cmd is required") + return "qs -c noctalia-shell ipc call " .. cmd + end +} diff --git a/.config/hypr/lua/window_rules.lua b/.config/hypr/lua/window_rules.lua new file mode 100644 index 0000000..43d0a25 --- /dev/null +++ b/.config/hypr/lua/window_rules.lua @@ -0,0 +1,113 @@ +-------------------------------- +---- WINDOWS AND WORKSPACES ---- +-------------------------------- + +-- See https://wiki.hypr.land/Configuring/Basics/Window-Rules/ +-- and https://wiki.hypr.land/Configuring/Basics/Workspace-Rules/ + +-- Ignore maximize requests from all apps. You'll probably like this. +hl.window_rule({ + name = "suppress-maximize-events", + match = { class = ".*" }, + + suppress_event = "maximize", +}) + +-- Fix some dragging issues with XWayland +hl.window_rule({ + name = "fix-xwayland-drags", + match = { + class = "^$", + title = "^$", + xwayland = true, + float = true, + fullscreen = false, + pin = false, + }, + + no_focus = true, +}) + +-- xwaylandvideobridge fix +hl.window_rule({ + match = { class = "^(xwaylandvideobridge)$" }, + float = true, + opacity = "0.0 override", + no_anim = true, + no_initial_focus = true, + max_size = { 1, 1 }, + no_blur = true, + no_focus = true, +}) + +-- Gnome calculator is floating +hl.window_rule({ + match = { class = "^(org.gnome.Calculator)$" }, + float = true +}) + +-- Telegram rules +hl.window_rule({ + match = { class = "^(org.telegram.desktop)$" }, + float = true, + size = { "(monitor_w*0.3)", "(monitor_h*0.955)" }, + move = { "((monitor_w*1)-window_w-(monitor_w*0.004))", "((monitor_h*0.04))" }, +}) + +-- Dnspy force tiling +hl.window_rule({ match = { class = "^(dnspy.exe)$" }, tile = true }) + +-- IDA +hl.window_rule({ match = { class = "^(IDA)$" }, focus_on_activate = false }) + +-- Thunderbird (compose new mail popup should be floating) +hl.window_rule({ + match = { class = "(thunderbird)", title = "(Write.*)" }, + float = true, + size = { 1000, 800 } +}) + +-- MATLAB +hl.window_rule({ + match = { title = "(MATLAB [%w%d]* - academic use)$" }, + tile = true, +}) +hl.window_rule({ + match = { class = "^(MATLAB [%w%d]* - academic use)$", title = "^(Command HistoryWindow)$" }, + no_focus = true, + border_size = 0, + opacity = "1.0 override" +}) +hl.window_rule({ + match = { class = "^(MATLAB [%w%d]* - academic use)$", title = "^(DefaultOverlayManager\\.JWindow)$" }, + no_focus = true, +}) + +-- Rofi blur +hl.layer_rule({ + name = "rofi-blur", + match = { namespace = "rofi" }, + blur = true, + ignore_alpha = 0, + dim_around = true, + enabled = false, +}) + +-- Waybar blur +hl.layer_rule({ + name = "waybar-blur", + match = { namespace = "waybar" }, + blur = true, + ignore_alpha = 0, + enabled = false, +}) + +-- Notifications blur with slide animation +hl.layer_rule({ + name = "notifications-blur", + match = { namespace = "notifications" }, + blur = true, + animation = "slide", + ignore_alpha = 0, + enabled = false, +}) diff --git a/.config/hypr/windows_rules.conf b/.config/hypr/windows_rules.conf deleted file mode 100644 index f5a5602..0000000 --- a/.config/hypr/windows_rules.conf +++ /dev/null @@ -1,49 +0,0 @@ -# Example windowrule v1 -# windowrule = float, ^(kitty)$ -# Example windowrule v2 -# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ -# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more - -# Gnome calulator is floating -windowrule = float on, match:class ^(org.gnome.Calculator)$ - -# Telegram is a floating -windowrule = float on, size (monitor_w*0.3) (monitor_h*0.945), move ((monitor_w*1)-window_w-(monitor_w*0.008)) ((monitor_h*0.04)), match:class ^(org.telegram.desktop)$ - -# dnSpy needs to be tiled -windowrule = tile on, match:class ^(dnspy.exe)$ - -# jetbrains ide fix -windowrule = no_focus on, match:class ^jetbrains-(?!toolbox), match:float 1, match:title ^win\d+$ - -# xwaylandvideobridge fix -windowrule = opacity 0.0 override, no_anim on, no_initial_focus on, max_size 1 1, no_blur on, no_focus on, match:class ^(xwaylandvideobridge)$ - -# ida window rule for tiling -windowrule = focus_on_activate 0, match:class ^(IDA)$ - -# Thunderbird compose new mail is floating -windowrule = float on, size 1000 800, match:class (thunderbird), match:title (Write.*) - -# gdb pwntools window rule to open on the right -#windowrule=tile,title:gdb-pwntools - -windowrule = opacity 0.9 override 0.8 override, match:class ^(kitty)$ # set opacity to 0.9 active and 0.8 inactive for kitty - -# MATLAB -windowrule = tile on, match:title (MATLAB [\w\d]* - academic use)$ -windowrule = no_focus on, border_size 0, opacity 1.0 override, match:class ^(MATLAB [\w\d]* - academic use)$, match:title ^(Command HistoryWindow)$ - -#windowrule = no_focus on, border_size 0, opacity 1.0 override, match:class ^(MATLAB [\w\d]* - academic use)$, match:title ^(TabCompletionPopup)$ -#windowrule = no_focus on, border_size 0, opacity 1.0 override, match:class ^(MATLAB [\w\d]* - academic use)$, match:title ^(FunctionHints)$ - -windowrule = no_focus on, match:class ^(MATLAB [\w\d]* - academic use)$, match:title ^(DefaultOverlayManager\.JWindow)$ - -# Rofi blur -layerrule = blur on, ignore_alpha 0, dim_around on, match:namespace rofi - -# Waybar blur -layerrule = blur on, ignore_alpha 0, match:namespace waybar - -layerrule = blur on, animation slide, ignore_alpha 0, match:namespace notifications -