From 5506a7966731cb9b6d188a31e4baea424102f3ba Mon Sep 17 00:00:00 2001 From: AramJonghu Date: Mon, 4 May 2026 19:53:56 +0200 Subject: [PATCH] initial setup for hyprlang -> lua --- .luarc.json | 10 +++++ hyprland.lua | 6 +++ modules/binds.lua | 77 +++++++++++++++++++++++++++++++++++++ modules/env.conf | 2 +- modules/env.lua | 32 ++++++++++++++++ modules/executes.lua | 8 ++++ modules/macchiato.lua | 51 +++++++++++++++++++++++++ modules/monitors.lua | 18 +++++++++ modules/settings.lua | 84 +++++++++++++++++++++++++++++++++++++++++ modules/windowrules.lua | 34 +++++++++++++++++ 10 files changed, 321 insertions(+), 1 deletion(-) create mode 100644 .luarc.json create mode 100644 hyprland.lua create mode 100644 modules/binds.lua create mode 100644 modules/env.lua create mode 100644 modules/executes.lua create mode 100644 modules/macchiato.lua create mode 100644 modules/monitors.lua create mode 100644 modules/settings.lua create mode 100644 modules/windowrules.lua diff --git a/.luarc.json b/.luarc.json new file mode 100644 index 0000000..62faf36 --- /dev/null +++ b/.luarc.json @@ -0,0 +1,10 @@ +{ + "workspace": { + "library": [ + "/usr/share/hypr/stubs" + ] + }, + "diagnostics": { + "globals": ["hl"] + } +} diff --git a/hyprland.lua b/hyprland.lua new file mode 100644 index 0000000..7d64cc3 --- /dev/null +++ b/hyprland.lua @@ -0,0 +1,6 @@ +require("binds") +require("env") +require("executes") +require("monitors") +require("settings") +require("windowrules") diff --git a/modules/binds.lua b/modules/binds.lua new file mode 100644 index 0000000..fa7b1f3 --- /dev/null +++ b/modules/binds.lua @@ -0,0 +1,77 @@ +hl.bind("SUPER + mouse:272", hl.dsp.window.drag(), { mouse = true }) +hl.bind("SUPER + mouse:273", hl.dsp.window.resize(), { mouse = true }) + +hl.bind("SUPER + RETURN", hl.dsp.exec_cmd("foot")) +hl.bind("SUPER + Q", hl.dsp.killactive()) +hl.bind("SUPER + M", hl.dsp.exit()) +hl.bind("SUPER + E", hl.dsp.exec_cmd("dolphin")) +hl.bind("SUPER + S", hl.dsp.togglefloating()) +hl.bind("SUPER + P", hl.dsp.pseudo()) +hl.bind("SUPER + B", hl.dsp.exec_cmd("firefox")) + +hl.bind("SUPER + H", hl.dsp.movefocus("l")) +hl.bind("SUPER + L", hl.dsp.movefocus("r")) +hl.bind("SUPER + K", hl.dsp.movefocus("u")) +hl.bind("SUPER + J", hl.dsp.movefocus("d")) +hl.bind("SUPER + SHIFT + L", hl.dsp.resizeactive("50 0"), { repeating = true }) +hl.bind("SUPER + SHIFT + H", hl.dsp.resizeactive("-50 0"), { repeating = true }) +hl.bind("SUPER + SHIFT + K", hl.dsp.resizeactive("0 -50"), { repeating = true }) +hl.bind("SUPER + SHIFT + J", hl.dsp.resizeactive("0 50"), { repeating = true }) + +hl.bind("SUPER + 1", hl.dsp.workspace("1")) +hl.bind("SUPER + 2", hl.dsp.workspace("2")) +hl.bind("SUPER + 3", hl.dsp.workspace("3")) +hl.bind("SUPER + 4", hl.dsp.workspace("4")) +hl.bind("SUPER + 5", hl.dsp.workspace("5")) +hl.bind("SUPER + 6", hl.dsp.workspace("6")) +hl.bind("SUPER + 7", hl.dsp.workspace("7")) +hl.bind("SUPER + 8", hl.dsp.workspace("8")) +hl.bind("SUPER + 9", hl.dsp.workspace("9")) +hl.bind("SUPER + 0", hl.dsp.workspace("10")) +hl.bind("ALT + 1", hl.dsp.movetoworkspace("1")) +hl.bind("ALT + 2", hl.dsp.movetoworkspace("2")) +hl.bind("ALT + 3", hl.dsp.movetoworkspace("3")) +hl.bind("ALT + 4", hl.dsp.movetoworkspace("4")) +hl.bind("ALT + 5", hl.dsp.movetoworkspace("5")) +hl.bind("ALT + 6", hl.dsp.movetoworkspace("6")) +hl.bind("ALT + 7", hl.dsp.movetoworkspace("7")) +hl.bind("ALT + 8", hl.dsp.movetoworkspace("8")) +hl.bind("ALT + 9", hl.dsp.movetoworkspace("9")) +hl.bind("ALT + 0", hl.dsp.movetoworkspace("10")) +hl.bind("SUPER + mouse_down", hl.dsp.workspace("e+1")) +hl.bind("SUPER + mouse_up", hl.dsp.workspace("e-1")) +hl.bind("SUPER + G", hl.dsp.togglegroup()) +hl.bind("SUPER + TAB", hl.dsp.changegroupactive()) + +hl.bind("SUPER + F", hl.dsp.fullscreen()) +hl.bind("SUPER + D", hl.dsp.exec_cmd("fuzzel")) +hl.bind( + "XF86AudioRaiseVolume", + hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"), + { repeating = true, locked = true } +) +hl.bind( + "XF86AudioLowerVolume", + hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), + { repeating = true, locked = true } +) +hl.bind( + "XF86AudioMute", + hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), + { repeating = true, locked = true } +) +hl.bind("F14", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), { repeating = true, locked = true }) +hl.bind("F15", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { repeating = true, locked = true }) +hl.bind("F17", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 5%+"), { repeating = true, locked = true }) +hl.bind("F16", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 5%-"), { repeating = true, 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 }) +hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true }) + +hl.bind("PRINT", hl.dsp.global("zshell:screenshotFreeze")) +hl.bind("SUPER + R", hl.dsp.global("zshell:toggle-launcher")) +hl.bind("SUPER + A", hl.dsp.global("zshell:toggle-nc")) +hl.bind("SUPER + V", hl.dsp.global("zshell:toggle-drawing")) +hl.bind("SUPER + F1", hl.dsp.global("zshell:lock")) +hl.bind("SUPER + F2", hl.dsp.global("zshell:toggle-settings")) diff --git a/modules/env.conf b/modules/env.conf index 594086f..73ae89e 100644 --- a/modules/env.conf +++ b/modules/env.conf @@ -7,7 +7,7 @@ env = EDITOR,nvim env = HYPRCURSOR_THEME,catppuccin-macchiato-light-cursors env = HYPRCURSOR_SIZE,24 -ent = ELECTRON_OZONE_PLATFORM_HINT,auto +env = ELECTRON_OZONE_PLATFORM_HINT,auto env = QT_AUTO_SCREEN_SCALE_FACTOR,1 env = QT_QPA_PLATFORM,wayland env = QT_QPA_PLATFORMTHEME,qt6ct diff --git a/modules/env.lua b/modules/env.lua new file mode 100644 index 0000000..ff9b7d4 --- /dev/null +++ b/modules/env.lua @@ -0,0 +1,32 @@ +hl.env("ZSH,/usr/share/oh-my-zsh/") +hl.env("BROWSER,firefox") +hl.env("TERM,tmux-256color") +hl.env("VISUAL,nvim") +hl.env("EDITOR,nvim") + +hl.env("HYPRCURSOR_THEME,catppuccin-macchiato-light-cursors") +hl.env("HYPRCURSOR_SIZE,24") + +hl.env("ELECTRON_OZONE_PLATFORM_HINT,auto") +hl.env("QT_AUTO_SCREEN_SCALE_FACTOR,1") +hl.env("QT_QPA_PLATFORM,wayland") +hl.env("QT_QPA_PLATFORMTHEME,qt6ct") +hl.env("QT_WAYLAND_DISABLE_WINDOWDECORATION,1") + +hl.env("XDG_SESSION_DESKTOP,Hyprland") +hl.env("XDG_SESSION_TYPE,wayland") +hl.env("CLUTTER_BACKEND,wayland") +hl.env("GDK_BACKEND,wayland") +hl.env("SDL_VIDEODRIVER,wayland") + +hl.env("XDG_CONFIG_HOME,$HOME/.config") +hl.env("XDG_CACHE_HOME,$HOME/.cache") +hl.env("XDG_DATA_HOME,$HOME/.local/share") +hl.env("XDG_PICTRES_HOME,$HOME/Pictures") +hl.env("HYPRSHOT_DIR,$HOME/Pictures/Screenshots") + +hl.env("RUSTICL_ENABLE,radeonsi") +hl.env("AMD_VULKAN_ICD,RADV") + +hl.env("HSA_OVERRIDE_GFX_VERSION,12.0.1") +hl.env("HCC_AMDGPU_TARGET,gfx1201") diff --git a/modules/executes.lua b/modules/executes.lua new file mode 100644 index 0000000..d4b5824 --- /dev/null +++ b/modules/executes.lua @@ -0,0 +1,8 @@ +hl.on("hyprland.start", function() + hl.exec.cmd("zshell-cli shell start") + hl.exec.cmd("nm-applet") + hl.exec.cmd("fcitx5") + hl.exec.cmd("wl-paste --type text --watch cliphist store") + hl.exec.cmd("wl-paste --type image --watch cliphist store") + hl.exec.cmd("hyprsunset -i") +end) diff --git a/modules/macchiato.lua b/modules/macchiato.lua new file mode 100644 index 0000000..a66cb9d --- /dev/null +++ b/modules/macchiato.lua @@ -0,0 +1,51 @@ +local rosewaterAlpha = rgb(f4dbd6) + +local flamingoAlpha = rgb(f0c6c6) + +local pinkAlpha = rgb(f5bde6) + +local mauveAlpha = rgb(c6a0f6) + +local redAlpha = rgb(ed8796) + +local maroonAlpha = rgb(ee99a0) + +local peachAlpha = rgb(f5a97f) + +local yellowAlpha = rgb(eed49f) + +local greenAlpha = rgb(a6da95) + +local tealAlpha = rgb(8bd5ca) + +local skyAlpha = rgb(91d7e3) + +local sapphireAlpha = rgb(7dc4e4) + +local blueAlpha = rgb(8aadf4) + +local lavenderAlpha = rgb(b7bdf8) + +local textAlpha = rgb(cad3f5) + +local subtext1Alpha = rgb(b8c0e0) + +local subtext0Alpha = rgb(a5adcb) + +local overlay2Alpha = rgb(939ab7) + +local overlay1Alpha = rgb(8087a2) + +local overlay0Alpha = rgb(6e738d) + +local surface2Alpha = rgb(5b6078) + +local surface1Alpha = rgb(494d64) + +local surface0Alpha = rgb(363a4f) + +local baseAlpha = rgb(24273a) + +local mantleAlpha = rgb(1e2030) + +local crustAlpha = rgb(181926) diff --git a/modules/monitors.lua b/modules/monitors.lua new file mode 100644 index 0000000..7256cea --- /dev/null +++ b/modules/monitors.lua @@ -0,0 +1,18 @@ +hl.monitor({ + output = "DP-2", + mode = "2560x1440@240", + position = "1728x0", + scale = 1, + bitdepth = 10, + cm = "srgb", +}) + +hl.monitor({ + output = "DP-3", + mode = "3840x2160@60", + position = "0x0", + scale = 1.25, + bitdepth = 10, + cm = "srgb", + transform = 1, +}) diff --git a/modules/settings.lua b/modules/settings.lua new file mode 100644 index 0000000..3da600f --- /dev/null +++ b/modules/settings.lua @@ -0,0 +1,84 @@ +require "macchiato" + +hl.layer_rule({ + name = "blur_popups_bar", + blur = true, + match = { namespace = "ZShell-Bar" }, + ignore_alpha = 0.5, +}, + { + name = "blur_popups_auth", + blur = true, + match = { namespace = "ZShell-Auth" }, + ignore_alpha = 0.5, +}) + + +hl.input ({ + kb_layout = "us", + kb_variant = "intl", + kb_options = "fkeys:basic_13-24", + sensitivity = 0, + accel_profile = "flat", + follow_mouse = 1, +}) + +hl.general ({ + gaps_in = 2, + gaps_out = 2, + border_size = 1, + col.active_border = { colors = { mauveAlpha, greenAlpha, sapphireAlpha, lavenderAlpha }, angle? = 90 }, + col.inactive_border = { surface1Alpha, angle? = 90}, +}) + +hl.decoration ({ + rounding = 1, + hl.shadow ({ + enabled = false, + range = 6, + render_power = 6, + color = baseAlpha, + color_inactive = mantleAlpha, + }), + hl.blur ({ + enabled = false, + size = 2, + passes = 2, + new_optimizations = true, + ignore_opacity = true, + contrast = 1.0, + brightness = 1.0, + vibrancy = 0, + vibrancy_darkness = 0, + xray = false, + noise = 0.05, + popups = true, + input_methods = true, + }), +}) + +hl.curve({ type = "brezier", points = { {0, 13}, {0, 99}, {0, 29}, {1, 1}}}) +hl.animation({ leaf = "windows", enabled = true, speed = 4, spring= "overshot", style = "slide" }) +hl.animation({ leaf = "fade", enabled = true, speed = 4, }) +hl.animation({ leaf = "border", enabled = true, speed = 4, }) +hl.animation({ leaf = "workspaces", enabled = true, speed = 4, spring = "overshot", style = "slide" }) + +hl.config({ + dwindle = { + pseudotile = true, + preserve_split = true, + }, +}) + +hl.ecosystem ({ + no_donation_nag = true, + no_update_news = true, +}) + +hl.misc ({ + disable_hyprland_logo = true, +}) + +hl.debug ({ + full_cm_proto = true, +}) diff --git a/modules/windowrules.lua b/modules/windowrules.lua new file mode 100644 index 0000000..409a73d --- /dev/null +++ b/modules/windowrules.lua @@ -0,0 +1,34 @@ +hl.windowrule({ + name = "xwayland", + opacity = "0.0 override", + no_anim = true, + no_initial_focus = true, + max_size = { 1, 1 }, + no_blur = true, + no_focus = true, + match = { class = "^(xwaylandvideobridge)$" }, +}) + +hl.windowrule({ + name = "fullscreen_idling", + idle_inhibit = "fullscreen", + match = { class = ".*" }, +}) + +hl.windowrule({ + name = "video_idling", + idle_inhibit = "always", + match = { content = "video" }, +}) + +hl.windowrule({ + name = "game_idling", + idle_inhibit = "always", + match = { content = "game" }, +}) + +hl.windowrule({ + name = "match_fullscreen", + idle_inhibit = "always", + match = { fullscreen_state_internal = 2, fullscreen_state_client = 2 }, +})