From 8587f9d2e0e104399fc689ad6baa214d86fde8a2 Mon Sep 17 00:00:00 2001 From: "Gu://em_" Date: Tue, 4 Aug 2026 11:15:48 +0200 Subject: [PATCH] Migrated hyprland config to lua --- .config/colors/hyprland.lua | 4 + .config/hypr/config/appearance.lua | 337 +++++++++++++++++++++++++ .config/hypr/config/colors.lua | 1 + .config/hypr/config/environment.lua | 81 ++++++ .config/hypr/config/input.lua | 188 ++++++++++++++ .config/hypr/config/kb_layouts/fr.lua | 32 +++ .config/hypr/config/kb_layouts/us.lua | 31 +++ .config/hypr/config/monitors/perso.lua | 37 +++ .config/hypr/hyprland.lua | 5 + 9 files changed, 716 insertions(+) create mode 100644 .config/colors/hyprland.lua create mode 100644 .config/hypr/config/appearance.lua create mode 120000 .config/hypr/config/colors.lua create mode 100644 .config/hypr/config/environment.lua create mode 100644 .config/hypr/config/input.lua create mode 100644 .config/hypr/config/kb_layouts/fr.lua create mode 100644 .config/hypr/config/kb_layouts/us.lua create mode 100644 .config/hypr/config/monitors/perso.lua create mode 100644 .config/hypr/hyprland.lua diff --git a/.config/colors/hyprland.lua b/.config/colors/hyprland.lua new file mode 100644 index 0000000..b103f90 --- /dev/null +++ b/.config/colors/hyprland.lua @@ -0,0 +1,4 @@ +-- active_color = "rgba(f55c20ff)" +active_color = "rgba(de3c3cff)" +inactive_color = "rgba(595959aa)" + diff --git a/.config/hypr/config/appearance.lua b/.config/hypr/config/appearance.lua new file mode 100644 index 0000000..d2adfdf --- /dev/null +++ b/.config/hypr/config/appearance.lua @@ -0,0 +1,337 @@ +-- Refer to https://wiki.hyprland.org/Configuring/Variables/ + +local colors = require("config/colors") + +-- https://wiki.hyprland.org/Configuring/Variables/#general + +hl.config({ + general = { + gaps_in = 1, + gaps_out = 1, + border_size = 1, + -- https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors + -- Resizing windows by clicking and dragging on borders and gaps + resize_on_border = true, + -- Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on + allow_tearing = false, + layout = "dwindle", + col = { + active_border = active_color, + inactive_border = inactive_color, + }, + }, +}) + +-- https://wiki.hyprland.org/Configuring/Variables/#decoration +hl.config({ + decoration = { + rounding = 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 = "rgba(1a1a1aee)", + }, + -- https://wiki.hyprland.org/Configuring/Variables/#blur + blur = { + enabled = true, + size = 6, + passes = 4, + vibrancy = 0.1696, + }, + }, +}) + +-- Layer rules + +hl.layer_rule({ + match = { + namespace = "^(swaync-control-center)$", + }, + blur = true, + ignore_alpha = 0.2, + animation = "slide right", + dim_around = true, +}) + +hl.layer_rule({ + match = { + namespace = "^(rofi)$", + }, + blur = false, + animation = "popin 90%", +}) + +hl.layer_rule({ + match = { + namespace = "^(waybar)$", + }, + blur = false, + animation = "slide up", +}) + +hl.layer_rule({ + match = { + namespace = "^(selection)$", + }, + blur = false, + animation = "fade", +}) + +hl.layer_rule({ + match = { + namespace = "^(hyprpicker)$", + }, + blur = false, + animation = "fade", +}) + +------------------- +---- ANIMATIONS --- +------------------- + +hl.config({ + animations = { + enabled = true, + }, +}) + +-- Bezier curves +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}, { 0, 1 } } }) +hl.curve( "almostLinear", { type = "bezier", points = { {0.5, 0.5}, { 0.75, 1.0} } }) +hl.curve( "quick", { type = "bezier", points = { {0.15, 0}, { 0.1, 1} } }) +hl.curve( "easeInOutExpo", { type = "bezier", points = { {0.87, 0}, { 0.13, 1} } }) + +hl.animation({ leaf="global", enabled=true, speed=10, bezier="default" }) +hl.animation({ leaf="border", enabled=true, speed=4, bezier="easeOutQuint" }) + +hl.animation({ leaf="windows", enabled=true, speed=3.5, bezier="easeOutQuint" }) +hl.animation({ leaf="windowsIn", enabled=true, speed=3.1, bezier="easeOutQuint", 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="easeOutQuint" }) +hl.animation({ leaf="fadeOut", enabled=true, speed=1.46, bezier="easeOutQuint" }) +hl.animation({ leaf="fade", enabled=true, speed=3.03, bezier="easeOutQuint" }) + +hl.animation({ leaf="layers", enabled=true, speed=3, bezier="easeOutQuint" }) +hl.animation({ leaf="layersIn", enabled=true, speed=2.4, bezier="easeOutQuint", style="fade" }) +hl.animation({ leaf="layersOut", enabled=true, speed=2.4, bezier="easeOutQuint", style="fade" }) +hl.animation({ leaf="fadeLayersIn", enabled=true, speed=2, bezier="easeOutQuint" }) +hl.animation({ leaf="fadeLayersOut", enabled=true, speed=2, bezier="easeOutQuint" }) + +hl.animation({ leaf="workspaces", enabled=true, speed=2.8, bezier="easeOutQuint", style="slidefadevert" }) +hl.animation({ leaf="workspacesIn", enabled=true, speed=2.6, bezier="easeOutQuint", style="slide" }) +hl.animation({ leaf="workspacesOut", enabled=true, speed=2.6, bezier="easeOutQuint", style="slide" }) + +-- Ref https://wiki.hyprland.org/Configuring/Workspace-Rules/ + +-- "Smart gaps" / "No gaps when only" +-- uncomment all if you wish to use that. +-- workspace = w[tv1], gapsout:0, gapsin:0 +-- workspace = f[1], gapsout:0, gapsin:0 +-- windowrulev2 = bordersize 0, floating:0, onworkspace:w[tv1] +-- windowrulev2 = rounding 0, floating:0, onworkspace:w[tv1] +-- windowrulev2 = bordersize 0, floating:0, onworkspace:f[1] +-- windowrulev2 = rounding 0, floating:0, onworkspace:f[1] + +-- See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more +hl.config({ + dwindle = { + preserve_split = true, + -- You probably want this + }, +}) + +-- See https://wiki.hyprland.org/Configuring/Master-Layout/ for more +hl.config({ + master = { + new_status = "master", + }, +}) + +-- https://wiki.hyprland.org/Configuring/Variables/#misc +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. :( + disable_splash_rendering = true, -- Disable default wallpapers rendering + }, +}) + + +------------------------------- +---- WINDOWS AND WORKSPACES --- +------------------------------- + +-- See https://wiki.hyprland.org/Configuring/Window-Rules/ for more +-- See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules + +-- Ignore maximize requests from 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({ + -- Fix some dragging issues with XWayland + name = "fix-xwayland-drags", + match = { + class = "^$", + title = "^$", + xwayland = true, + float = true, + fullscreen = false, + pin = false, + }, + + no_focus = true, +}) + + +-- Albert + +hl.window_rule({ + name = "albert", + match = { + class = "^(albert)$", + }, + border_size = 0, + no_blur = true, + no_shadow = true, + float = true, + stay_focused = true, + no_dim = true, +}) + +-- Prism Launcher + +hl.window_rule({ + name = "prismlauncher-all", + match = { + class = "(org.prismlauncher.PrismLauncher)", + }, + pseudo = true, +}) + +hl.window_rule({ + name = "prismlauncher-main", + match = { + class = "(org.prismlauncher.PrismLauncher)", + title = "^(Prism Launcher.*)$", + }, + size = { "(monitor_w*0.65)", "(monitor_h*0.7)" }, +}) + +-- Nautilus + +hl.window_rule({ + name = "nautilus-main", + match = { + class = "(org.gnome.Nautilus)", + }, + pseudo = true, + size = { "(monitor_w*0.65)", "(monitor_h*0.7)" }, +}) + +-- GTK file picker + +hl.window_rule({ + name = "gtk-file-picker", + match = { + class = "(xdg-desktop-portal-gtk)", + }, + float = true, + size = { "(monitor_w*0.65)", "(monitor_h*0.7)" }, +}) + +-- Vivado + +--# Loading screen + +hl.window_rule({ + name = "vivado-loading-screen", + match = { + class = "(ui-PlanAhead)", + }, + float = true, + center = true, +}) + +hl.window_rule({ + name = "vivado-loading-screen-2", + match = { + class = "(ui-PlanAhead) title:^(win0)$", + }, + size = { 397, 295 }, +}) + +--# Main window + +hl.window_rule({ + name = "vivado-main", + match = { + class = "(Vivado)", + }, + tile = true, +}) + +-- Kdenlive + +hl.window_rule({ + name = "kdenlive-all", + match = { + class = "(org.kde.kdenlive)", + }, + pseudo = true, +}) + +hl.window_rule({ + name = "kdenlive-welcome", + match = { + class = "(org.kde.kdenlive)", + }, + size = { "(512)", "(544)" }, +}) + +-- Gnome characters + +hl.window_rule({ + name = "gnome-characters", + match = { + class = "(org.gnome.Characters)", + }, + float = true, + size = { "(849)", "(566)" }, +}) + + +-- Legacy disabled code + +-- Mullvad VPN +-- hl.window_rule({ +-- name = "mullvad-vpn", +-- float = "on", +-- size = (320) (568), +-- # move = "{ (monitor_w - window_w - 4), (monitor_h - window_h - 4) }", +-- match:class = (Mullvad VPN), +-- }) + +-- TODO Automatically fullscreen single apps +-- - Seems impossible for now (try mixing with workspace rules) + +-- Default size for floating windows +--# TODO +--windowrulev2 = size 100 100,floating:1 + +-- Increase gaps for single apps +--# Usless since I changed the default gap but may be useful if you decide to reset it to 0 +--workspace=w[t1], gapsout:2 diff --git a/.config/hypr/config/colors.lua b/.config/hypr/config/colors.lua new file mode 120000 index 0000000..28eb258 --- /dev/null +++ b/.config/hypr/config/colors.lua @@ -0,0 +1 @@ +../../colors/hyprland.lua \ No newline at end of file diff --git a/.config/hypr/config/environment.lua b/.config/hypr/config/environment.lua new file mode 100644 index 0000000..ee70077 --- /dev/null +++ b/.config/hypr/config/environment.lua @@ -0,0 +1,81 @@ +----------------- +---- PROGRAMS --- +----------------- + +terminal = "foot" +fileManager = "nautilus" +menu = "rofi -show drun" +notificationManager = "swaync-client -t" + +------------------ +---- AUTOSTART --- +------------------ + +-- Autostart necessary processes (like notifications daemons, status bars, etc.) + +hl.on("hyprland.start", function() + hl.exec_cmd("~/.config/hypr/scripts/autostart.sh") + -- Testing clipboard managers + hl.exec_cmd("wl-paste --type text --watch cliphist store") -- Stores only text data + hl.exec_cmd("wl-paste --type image --watch cliphist store") -- Stores only image data + -- SSH Agent + hl.exec_cmd("ssh-agent") +end) + + +-------------------- +---- 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, + }, +}) + + +------------------------------ +---- ENVIRONMENT VARIABLES --- +------------------------------ + +-- See https://wiki.hyprland.org/Configuring/Environment-variables/ + +-- HyprCursor +hl.env("HYPRCURSOR_THEME", "VolantesCursors") +hl.env("XCURSOR_THEME", "VolantesCursors") +hl.env("XCURSOR_SIZE", 24) +hl.env("HYPRCURSOR_SIZE", 24) + +-- XDG Desktop Portal +hl.env("XDG_SESSION_DESKTOP", "Hyprland") +hl.env("XDG_CURRENT_DESKTOP", "Hyprland") + +-- Experimental + +-- GTK +-- env = GTK_USE_PORTAL,1 +-- env = GDK_SCALE,2 - Xwayland scale +-- Qt +-- env = QT_WAYLAND_DISABLE_WINDOWDECORATION, +-- Firefox +-- env = MOZ_ENABLE_WAYLAND,1 +-- env = MOZ_USE_XINPUT2,1 +-- WLRoots +-- env = WLR_NO_HARDWARE_CURSORS,1 +-- env = WLR_RENDERER,vulkan +-- SDL +-- env = SDL_VIDEODRIVER,wayland +-- env = QT_QPA_PLATFORMTHEME,hyprqt6engine +hl.env("QT_QPA_PLATFORMTHEME", "qt6ct") +-- Nvidia +-- GBM backend +-- env = GBM_BACKEND,nvidia-drm +-- env = __GLX_VENDOR_LIBRARY_NAME,nvidia +-- Hardware acceleration +-- env = LIBVA_DRIVER_NAME,nvidia +-- env = NVD_BACKEND,direct + diff --git a/.config/hypr/config/input.lua b/.config/hypr/config/input.lua new file mode 100644 index 0000000..1b7fddb --- /dev/null +++ b/.config/hypr/config/input.lua @@ -0,0 +1,188 @@ +-------------- +---- INPUT --- +-------------- + +-- https://wiki.hyprland.org/Configuring/Variables/#input + +hl.config({ + input = { + numlock_by_default = true, + follow_mouse = 1, + sensitivity = 0.1, -- -1.0 - 1.0, 0 means no modification. + touchpad = { + natural_scroll = true, + disable_while_typing = false, + }, + }, +}) + +-- https://wiki.hyprland.org/Configuring/Variables/#gestures +-- TODO port to lua +-- gesture = 3, "horizontal", "workspace" + +-- Example per-device config +-- See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more +hl.device({ + name = "epic-mouse-v1", + sensitivity = -0.5, +}) + + +-------------------- +---- KEYBINDINGS --- +-------------------- + +-- See https://wiki.hyprland.org/Configuring/Keywords/ +mainMod = "SUPER" -- Sets "Windows" key as main modifier + +-- Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more + +-- TODO use the ones defined in envuronment.lua +local terminal = "foot" +local fileManager = "nautilus" +local menu = "rofi -show drun" +local notificationManager = "swaync-client -t" + +-- Main desktop controls +hl.bind(mainMod .. " + Q" , hl.dsp.window.close()) +hl.bind(mainMod .. " + R" , hl.dsp.exec_cmd(menu)) -- Omnibar +hl.bind(mainMod .. " + D" , hl.dsp.exec_cmd(menu)) -- Legacy menu shortcut +hl.bind(mainMod .. " + I" , hl.dsp.exec_cmd("hyprlock")) -- Lockscreen +hl.bind(mainMod .. " + B" , hl.dsp.exec_cmd("~/.config/hypr/scripts/toggle-waybar.sh")) -- Toggle sidebar +hl.bind(mainMod .. " + SHIFT + R", hl.dsp.exec_cmd("~/.config/hypr/scripts/reload.sh")) -- Reload desktop +hl.bind(mainMod .. " + F11" , hl.dsp.exec_cmd("~/.config/hypr/scripts/gamemode.sh")) -- Gamemode +hl.bind(mainMod .. " + F10" , hl.dsp.exec_cmd("~/.config/hypr/scripts/sharp_mode.sh")) -- Sharp mode +hl.bind(mainMod .. " + SHIFT + M", hl.dsp.exit()) -- Exit desktop session + +-- Shortcuts +hl.bind(mainMod .. " + RETURN", hl.dsp.exec_cmd(terminal)) +hl.bind(mainMod .. " + X" , hl.dsp.exec_cmd(terminal)) -- Absolutely not because I dislocated my arm +hl.bind(mainMod .. " + SPACE" , hl.dsp.exec_cmd(menu)) +hl.bind(mainMod .. " + E" , hl.dsp.exec_cmd(fileManager)) +hl.bind(mainMod .. " + A" , hl.dsp.exec_cmd(notificationManager)) +-- TODO Replace by default editor +hl.bind("XF86Launch1" , hl.dsp.exec_cmd(terminal .. " hx ~/.config/hypr/config")) + +-- 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 + hjkl (vim keybinds) +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 windows with mainMod + shift + arrow keys +hl.bind(mainMod .. " + SHIFT + left" , hl.dsp.window.move{ direction = "left" }) +hl.bind(mainMod .. " + SHIFT + right", hl.dsp.window.move{ direction = "right" }) +hl.bind(mainMod .. " + SHIFT + up" , hl.dsp.window.move{ direction = "up" }) +hl.bind(mainMod .. " + SHIFT + down" , hl.dsp.window.move{ direction = "down" }) + +-- Layout +hl.bind(mainMod .. " + " .. "F", hl.dsp.window.fullscreen()) +hl.bind(mainMod .. " + " .. "V", hl.dsp.layout("togglesplit")) + +-- Horizontal/vertical split +hl.bind(mainMod .. " + " .. "T", hl.dsp.window.float()) +hl.bind(mainMod .. " + " .. "Y", hl.dsp.window.pseudo()) -- Toggle pseudo-tiling + +-- Switch workspaces with mainMod + [0-9] +hl.bind(mainMod .. " + 1", hl.dsp.focus({ workspace = 1 })) +hl.bind(mainMod .. " + 2", hl.dsp.focus({ workspace = 2 })) +hl.bind(mainMod .. " + 3", hl.dsp.focus({ workspace = 3 })) +hl.bind(mainMod .. " + 4", hl.dsp.focus({ workspace = 4 })) +hl.bind(mainMod .. " + 5", hl.dsp.focus({ workspace = 5 })) +hl.bind(mainMod .. " + 6", hl.dsp.focus({ workspace = 6 })) +hl.bind(mainMod .. " + 7", hl.dsp.focus({ workspace = 7 })) +hl.bind(mainMod .. " + 8", hl.dsp.focus({ workspace = 8 })) +hl.bind(mainMod .. " + 9", hl.dsp.focus({ workspace = 9 })) +hl.bind(mainMod .. " + 0", hl.dsp.focus({ workspace = 10 })) + +-- Move active window to a workspace with mainMod + SHIFT + [0-9] +hl.bind(mainMod .. " + SHIFT + 1", hl.dsp.window.move({ workspace = 1 })) +hl.bind(mainMod .. " + SHIFT + 2", hl.dsp.window.move({ workspace = 2 })) +hl.bind(mainMod .. " + SHIFT + 3", hl.dsp.window.move({ workspace = 3 })) +hl.bind(mainMod .. " + SHIFT + 4", hl.dsp.window.move({ workspace = 4 })) +hl.bind(mainMod .. " + SHIFT + 5", hl.dsp.window.move({ workspace = 5 })) +hl.bind(mainMod .. " + SHIFT + 6", hl.dsp.window.move({ workspace = 6 })) +hl.bind(mainMod .. " + SHIFT + 7", hl.dsp.window.move({ workspace = 7 })) +hl.bind(mainMod .. " + SHIFT + 8", hl.dsp.window.move({ workspace = 8 })) +hl.bind(mainMod .. " + SHIFT + 9", hl.dsp.window.move({ workspace = 9 })) +hl.bind(mainMod .. " + SHIFT + 0", hl.dsp.window.move({ workspace = 10 })) + +-- TODO more concise notation for workspaces +-- for i = 0, 10 do +-- 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" })) + +-- Minimize function (uses scratchpad) +-- For testing, may be removed in future releases +hl.bind(mainMod .. " + N", hl.dsp.workspace.toggle_special("magic")) +-- TODO fix +-- hl.bind(mainMod .. " + N", hl.dsp.window.move({ direction = "+0" })) +hl.bind(mainMod .. " + N", hl.dsp.workspace.toggle_special("magic")) +hl.bind(mainMod .. " + N", hl.dsp.window.move({ workspace = "special:magic" })) +hl.bind(mainMod .. " + N", hl.dsp.workspace.toggle_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 }) + + +-- Function keys + +--- Volume +hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), { locked = true }) +hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { locked = true }) +hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { locked = true }) +hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), { locked = true }) + +--- Brightness +hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl s 5%+"), { locked = true }) +hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl s 5%-"), { locked = true }) +hl.bind("SHIFT" .. " + XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl s 1%+"), { locked = true }) +hl.bind("SHIFT" .. " + XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl s 1%-"), { locked = true }) + +--- Player controls +hl.bind("XF86AudioNext" , hl.dsp.exec_cmd("playerctl next") , { locked = true }) +hl.bind("XF86AudioPause", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true }) +hl.bind("XF86AudioPlay" , hl.dsp.exec_cmd("playerctl play-pause"), { locked = true }) +hl.bind("XF86AudioPrev" , hl.dsp.exec_cmd("playerctl previous") , { locked = true }) + +--- Screenshot +hl.bind("Print", hl.dsp.exec_cmd("~/.config/hypr/scripts/screenshot.sh")) +hl.bind("SHIFT" .. " + " .. "Print", hl.dsp.exec_cmd("~/.config/hypr/scripts/screenshot.sh --fullscreen")) + +-- Color picker +hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. "C", hl.dsp.exec_cmd("hyprpicker -a")) + +--- Touchpad toggle +hl.bind("XF86TouchpadToggle", hl.dsp.exec_cmd("~/.config/hypr/scripts/toggle-touchpad.sh"), { locked = true }) +---- On galaxy books, pressing the disable touchpad key also triggers SUPER and +---- CONTROL keys, this is why there are present here +hl.bind("SUPER + CONTROL" .. " + " .. "XF86TouchpadToggle", hl.dsp.exec_cmd("~/.config/hypr/scripts/toggle-touchpad.sh")) + +--- Keyboard layout toggle +---- Only works between AZERTY and QWERTY because of differences in the numbers row +---- that prevent using the default way provided by hyprland +hl.bind(mainMod .. " + " .. "CONTROL" .. " + " .. "SPACE", hl.dsp.exec_cmd("~/.config/hypr/scripts/change-kb-layout.sh")) + +-- Lock laptop on lid close +hl.bind("switch:off:Lid Switch", hl.dsp.exec_cmd("hyprlock --immediate"), { locked = true }) + +--- Testing +--bind = $mainMod, TAB, overview:toggle, toggle diff --git a/.config/hypr/config/kb_layouts/fr.lua b/.config/hypr/config/kb_layouts/fr.lua new file mode 100644 index 0000000..95f02e9 --- /dev/null +++ b/.config/hypr/config/kb_layouts/fr.lua @@ -0,0 +1,32 @@ +--# Overrides inputs for AZERTY layout +hl.config({ + input = { + kb_layout = "fr", + }, +}) + +--# Keybindings + +--# Switch workspaces with mainMod + [0-9] +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 })) + +--# Move active window to a workspace with mainMod + SHIFT + [0-9] +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 })) diff --git a/.config/hypr/config/kb_layouts/us.lua b/.config/hypr/config/kb_layouts/us.lua new file mode 100644 index 0000000..d2cce73 --- /dev/null +++ b/.config/hypr/config/kb_layouts/us.lua @@ -0,0 +1,31 @@ +--# Overrides inputs for QWERTY layout +hl.config({ + input = { + kb_layout = "fr", + kb_variant = "us", + }, +}) + +-- Switch workspaces with mainMod + [0-9] +hl.bind(mainMod .. " + 1", hl.dsp.focus({ workspace = 1 })) +hl.bind(mainMod .. " + 2", hl.dsp.focus({ workspace = 2 })) +hl.bind(mainMod .. " + 3", hl.dsp.focus({ workspace = 3 })) +hl.bind(mainMod .. " + 4", hl.dsp.focus({ workspace = 4 })) +hl.bind(mainMod .. " + 5", hl.dsp.focus({ workspace = 5 })) +hl.bind(mainMod .. " + 6", hl.dsp.focus({ workspace = 6 })) +hl.bind(mainMod .. " + 7", hl.dsp.focus({ workspace = 7 })) +hl.bind(mainMod .. " + 8", hl.dsp.focus({ workspace = 8 })) +hl.bind(mainMod .. " + 9", hl.dsp.focus({ workspace = 9 })) +hl.bind(mainMod .. " + 0", hl.dsp.focus({ workspace = 10 })) + +-- Move active window to a workspace with mainMod + SHIFT + [0-9] +hl.bind(mainMod .. " + SHIFT + 1", hl.dsp.window.move({ workspace = 1 })) +hl.bind(mainMod .. " + SHIFT + 2", hl.dsp.window.move({ workspace = 2 })) +hl.bind(mainMod .. " + SHIFT + 3", hl.dsp.window.move({ workspace = 3 })) +hl.bind(mainMod .. " + SHIFT + 4", hl.dsp.window.move({ workspace = 4 })) +hl.bind(mainMod .. " + SHIFT + 5", hl.dsp.window.move({ workspace = 5 })) +hl.bind(mainMod .. " + SHIFT + 6", hl.dsp.window.move({ workspace = 6 })) +hl.bind(mainMod .. " + SHIFT + 7", hl.dsp.window.move({ workspace = 7 })) +hl.bind(mainMod .. " + SHIFT + 8", hl.dsp.window.move({ workspace = 8 })) +hl.bind(mainMod .. " + SHIFT + 9", hl.dsp.window.move({ workspace = 9 })) +hl.bind(mainMod .. " + SHIFT + 0", hl.dsp.window.move({ workspace = 10 })) diff --git a/.config/hypr/config/monitors/perso.lua b/.config/hypr/config/monitors/perso.lua new file mode 100644 index 0000000..28e590b --- /dev/null +++ b/.config/hypr/config/monitors/perso.lua @@ -0,0 +1,37 @@ +-- See https://wiki.hyprland.org/Configuring/Monitors/ + +-- Default +hl.monitor({ + output = "", + mode = "preferred", + position = "auto-up", + scale = "auto", +}) + +-- Laptop screen + +hl.monitor({ + output = "eDP-1", + mode = "preferred", + position = "auto-down", + scale = 1, + -- supports_wide_color = 1 + -- supports_hdr = 1 + -- bitdepth = 10 +}) + +-- HP home monitor +hl.monitor({ + output = "DP-*", + mode = "preferred", + position = "auto-up", + scale = 1, +}) + +-- Dell monitor +hl.monitor({ + output = "HDMI-A-1", + mode = "preferred", + position = "auto-up", + scale = 1, +}) diff --git a/.config/hypr/hyprland.lua b/.config/hypr/hyprland.lua new file mode 100644 index 0000000..b3e6c14 --- /dev/null +++ b/.config/hypr/hyprland.lua @@ -0,0 +1,5 @@ +require("config.monitors.perso") +require("config.environment") +require("config.input") +require("config.kb_layouts.us") +require("config.appearance")