From 7e6403133c8e6de5a4de5d39f5161de47bc247e8 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sun, 10 May 2026 01:45:05 -0400 Subject: [PATCH 1/9] Prevent lsp complaining --- .luarc.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .luarc.json diff --git a/.luarc.json b/.luarc.json new file mode 100644 index 00000000..ff0e3599 --- /dev/null +++ b/.luarc.json @@ -0,0 +1,11 @@ +{ + "workspace": { + "library": [ + "/usr/share/hypr/stubs" + ], + "checkThirdParty": false + }, + "diagnostics": { + "globals": ["hl"] + } +} From b93650991fe0f401fc898dff9c03d495122b1284 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sun, 10 May 2026 02:00:02 -0400 Subject: [PATCH 2/9] Swap configs to lua --- config/hypr/.luarc.json | 11 ++++++++ config/hypr/autostart.conf | 2 -- config/hypr/autostart.lua | 4 +++ config/hypr/bindings.conf | 40 --------------------------- config/hypr/bindings.lua | 40 +++++++++++++++++++++++++++ config/hypr/hyprland.conf | 26 ------------------ config/hypr/hyprland.lua | 42 +++++++++++++++++++++++++++++ config/hypr/input.conf | 53 ------------------------------------ config/hypr/input.lua | 55 ++++++++++++++++++++++++++++++++++++++ config/hypr/looknfeel.conf | 40 --------------------------- config/hypr/looknfeel.lua | 50 ++++++++++++++++++++++++++++++++++ config/hypr/monitors.conf | 13 --------- config/hypr/monitors.lua | 25 +++++++++++++++++ 13 files changed, 227 insertions(+), 174 deletions(-) create mode 100644 config/hypr/.luarc.json delete mode 100644 config/hypr/autostart.conf create mode 100644 config/hypr/autostart.lua delete mode 100644 config/hypr/bindings.conf create mode 100644 config/hypr/bindings.lua delete mode 100644 config/hypr/hyprland.conf create mode 100644 config/hypr/hyprland.lua delete mode 100644 config/hypr/input.conf create mode 100644 config/hypr/input.lua delete mode 100644 config/hypr/looknfeel.conf create mode 100644 config/hypr/looknfeel.lua delete mode 100644 config/hypr/monitors.conf create mode 100644 config/hypr/monitors.lua diff --git a/config/hypr/.luarc.json b/config/hypr/.luarc.json new file mode 100644 index 00000000..ff0e3599 --- /dev/null +++ b/config/hypr/.luarc.json @@ -0,0 +1,11 @@ +{ + "workspace": { + "library": [ + "/usr/share/hypr/stubs" + ], + "checkThirdParty": false + }, + "diagnostics": { + "globals": ["hl"] + } +} diff --git a/config/hypr/autostart.conf b/config/hypr/autostart.conf deleted file mode 100644 index 708b3a29..00000000 --- a/config/hypr/autostart.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Extra autostart processes -# exec-once = uwsm-app -- my-service diff --git a/config/hypr/autostart.lua b/config/hypr/autostart.lua new file mode 100644 index 00000000..5f444bb1 --- /dev/null +++ b/config/hypr/autostart.lua @@ -0,0 +1,4 @@ +-- Extra autostart processes. +-- hl.on("hyprland.start", function() +-- hl.exec_cmd("uwsm-app -- my-service") +-- end) diff --git a/config/hypr/bindings.conf b/config/hypr/bindings.conf deleted file mode 100644 index e7eb692d..00000000 --- a/config/hypr/bindings.conf +++ /dev/null @@ -1,40 +0,0 @@ -# Application bindings -bindd = SUPER, RETURN, Terminal, exec, uwsm-app -- xdg-terminal-exec --dir="$(omarchy-cmd-terminal-cwd)" -bindd = SUPER ALT, RETURN, Tmux, exec, uwsm-app -- xdg-terminal-exec --dir="$(omarchy-cmd-terminal-cwd)" bash -c "tmux attach || tmux new -s Work" -bindd = SUPER SHIFT, RETURN, Browser, exec, omarchy-launch-browser -bindd = SUPER SHIFT, F, File manager, exec, uwsm-app -- nautilus --new-window -bindd = SUPER ALT SHIFT, F, File manager (cwd), exec, uwsm-app -- nautilus --new-window "$(omarchy-cmd-terminal-cwd)" -bindd = SUPER SHIFT, B, Browser, exec, omarchy-launch-browser -bindd = SUPER SHIFT ALT, B, Browser (private), exec, omarchy-launch-browser --private -bindd = SUPER SHIFT, M, Music, exec, omarchy-launch-or-focus spotify -bindd = SUPER SHIFT ALT, M, Music TUI, exec, omarchy-launch-or-focus-tui cliamp -bindd = SUPER SHIFT, N, Editor, exec, omarchy-launch-editor -bindd = SUPER SHIFT, D, Docker, exec, omarchy-launch-tui lazydocker -bindd = SUPER SHIFT, G, Signal, exec, omarchy-launch-or-focus ^signal$ "uwsm-app -- signal-desktop" -bindd = SUPER SHIFT, O, Obsidian, exec, omarchy-launch-or-focus ^obsidian$ "uwsm-app -- obsidian" -bindd = SUPER SHIFT, W, Typora, exec, uwsm-app -- typora --enable-wayland-ime -bindd = SUPER SHIFT, SLASH, Passwords, exec, uwsm-app -- 1password - -# If your web app url contains #, type it as ## to prevent hyprland treating it as a comment -bindd = SUPER SHIFT, A, ChatGPT, exec, omarchy-launch-webapp "https://chatgpt.com" -bindd = SUPER SHIFT ALT, A, Grok, exec, omarchy-launch-webapp "https://grok.com" -bindd = SUPER SHIFT, C, Calendar, exec, omarchy-launch-webapp "https://app.hey.com/calendar/weeks/" -bindd = SUPER SHIFT, E, Email, exec, omarchy-launch-webapp "https://app.hey.com" -bindd = SUPER SHIFT, Y, YouTube, exec, omarchy-launch-webapp "https://youtube.com/" -bindd = SUPER SHIFT ALT, G, WhatsApp, exec, omarchy-launch-or-focus-webapp WhatsApp "https://web.whatsapp.com/" -bindd = SUPER SHIFT CTRL, G, Google Messages, exec, omarchy-launch-or-focus-webapp "Google Messages" "https://messages.google.com/web/conversations" -bindd = SUPER SHIFT, P, Google Photos, exec, omarchy-launch-or-focus-webapp "Google Photos" "https://photos.google.com/" -bindd = SUPER SHIFT, X, X, exec, omarchy-launch-webapp "https://x.com/" -bindd = SUPER SHIFT ALT, X, X Post, exec, omarchy-launch-webapp "https://x.com/compose/post" - -# Add extra bindings -# bind = SUPER SHIFT, R, exec, alacritty -e ssh your-server - -# Overwrite existing bindings, like putting Omarchy Menu on Super + Space -# unbind = SUPER, SPACE -# bindd = SUPER, SPACE, Omarchy menu, exec, omarchy-menu - -# Logitech MX Keys -# bind = SUPER SHIFT, S, exec, omarchy-capture-screenshot # Print Screen Button -# bind = SUPER, H, exec, voxtype record toggle # Dictation Button -# bind = SUPER, PERIOD, exec, omarchy-launch-walker -m symbols # Emoji Button diff --git a/config/hypr/bindings.lua b/config/hypr/bindings.lua new file mode 100644 index 00000000..ed04cc42 --- /dev/null +++ b/config/hypr/bindings.lua @@ -0,0 +1,40 @@ +-- Application bindings. +hl.bind("SUPER + RETURN", hl.dsp.exec_cmd([[uwsm-app -- xdg-terminal-exec --dir="$(omarchy-cmd-terminal-cwd)"]]), { description = "Terminal" }) +hl.bind("SUPER + ALT + RETURN", hl.dsp.exec_cmd([[uwsm-app -- xdg-terminal-exec --dir="$(omarchy-cmd-terminal-cwd)" bash -c "tmux attach || tmux new -s Work"]]), { description = "Tmux" }) +hl.bind("SUPER + SHIFT + RETURN", hl.dsp.exec_cmd("omarchy-launch-browser"), { description = "Browser" }) +hl.bind("SUPER + SHIFT + F", hl.dsp.exec_cmd("uwsm-app -- nautilus --new-window"), { description = "File manager" }) +hl.bind("SUPER + ALT + SHIFT + F", hl.dsp.exec_cmd([[uwsm-app -- nautilus --new-window "$(omarchy-cmd-terminal-cwd)"]]), { description = "File manager (cwd)" }) +hl.bind("SUPER + SHIFT + B", hl.dsp.exec_cmd("omarchy-launch-browser"), { description = "Browser" }) +hl.bind("SUPER + SHIFT + ALT + B", hl.dsp.exec_cmd("omarchy-launch-browser --private"), { description = "Browser (private)" }) +hl.bind("SUPER + SHIFT + M", hl.dsp.exec_cmd("omarchy-launch-or-focus spotify"), { description = "Music" }) +hl.bind("SUPER + SHIFT + ALT + M", hl.dsp.exec_cmd("omarchy-launch-or-focus-tui cliamp"), { description = "Music TUI" }) +hl.bind("SUPER + SHIFT + N", hl.dsp.exec_cmd("omarchy-launch-editor"), { description = "Editor" }) +hl.bind("SUPER + SHIFT + D", hl.dsp.exec_cmd("omarchy-launch-tui lazydocker"), { description = "Docker" }) +hl.bind("SUPER + SHIFT + G", hl.dsp.exec_cmd([[omarchy-launch-or-focus ^signal$ "uwsm-app -- signal-desktop"]]), { description = "Signal" }) +hl.bind("SUPER + SHIFT + O", hl.dsp.exec_cmd([[omarchy-launch-or-focus ^obsidian$ "uwsm-app -- obsidian"]]), { description = "Obsidian" }) +hl.bind("SUPER + SHIFT + W", hl.dsp.exec_cmd("uwsm-app -- typora --enable-wayland-ime"), { description = "Typora" }) +hl.bind("SUPER + SHIFT + SLASH", hl.dsp.exec_cmd("uwsm-app -- 1password"), { description = "Passwords" }) + +-- Web app bindings. +hl.bind("SUPER + SHIFT + A", hl.dsp.exec_cmd([[omarchy-launch-webapp "https://chatgpt.com"]]), { description = "ChatGPT" }) +hl.bind("SUPER + SHIFT + ALT + A", hl.dsp.exec_cmd([[omarchy-launch-webapp "https://grok.com"]]), { description = "Grok" }) +hl.bind("SUPER + SHIFT + C", hl.dsp.exec_cmd([[omarchy-launch-webapp "https://app.hey.com/calendar/weeks/"]]), { description = "Calendar" }) +hl.bind("SUPER + SHIFT + E", hl.dsp.exec_cmd([[omarchy-launch-webapp "https://app.hey.com"]]), { description = "Email" }) +hl.bind("SUPER + SHIFT + Y", hl.dsp.exec_cmd([[omarchy-launch-webapp "https://youtube.com/"]]), { description = "YouTube" }) +hl.bind("SUPER + SHIFT + ALT + G", hl.dsp.exec_cmd([[omarchy-launch-or-focus-webapp WhatsApp "https://web.whatsapp.com/"]]), { description = "WhatsApp" }) +hl.bind("SUPER + SHIFT + CTRL + G", hl.dsp.exec_cmd([[omarchy-launch-or-focus-webapp "Google Messages" "https://messages.google.com/web/conversations"]]), { description = "Google Messages" }) +hl.bind("SUPER + SHIFT + P", hl.dsp.exec_cmd([[omarchy-launch-or-focus-webapp "Google Photos" "https://photos.google.com/"]]), { description = "Google Photos" }) +hl.bind("SUPER + SHIFT + X", hl.dsp.exec_cmd([[omarchy-launch-webapp "https://x.com/"]]), { description = "X" }) +hl.bind("SUPER + SHIFT + ALT + X", hl.dsp.exec_cmd([[omarchy-launch-webapp "https://x.com/compose/post"]]), { description = "X Post" }) + +-- Add extra bindings below. +-- hl.bind("SUPER + SHIFT + R", hl.dsp.exec_cmd("alacritty -e ssh your-server"), { description = "SSH" }) + +-- Overwrite existing bindings with hl.unbind() first if needed. +-- hl.unbind("SUPER + SPACE") +-- hl.bind("SUPER + SPACE", hl.dsp.exec_cmd("omarchy-menu"), { description = "Omarchy menu" }) + +-- Logitech MX Keys examples: +-- hl.bind("SUPER + SHIFT + S", hl.dsp.exec_cmd("omarchy-capture-screenshot")) +-- hl.bind("SUPER + H", hl.dsp.exec_cmd("voxtype record toggle")) +-- hl.bind("SUPER + PERIOD", hl.dsp.exec_cmd("omarchy-launch-walker -m symbols")) diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf deleted file mode 100644 index cf4f9ad0..00000000 --- a/config/hypr/hyprland.conf +++ /dev/null @@ -1,26 +0,0 @@ -# Learn how to configure Hyprland: https://wiki.hypr.land/Configuring/ - -# Use defaults Omarchy defaults (but don't edit these directly!) -source = ~/.local/share/omarchy/default/hypr/autostart.conf -source = ~/.local/share/omarchy/default/hypr/bindings/media.conf -source = ~/.local/share/omarchy/default/hypr/bindings/clipboard.conf -source = ~/.local/share/omarchy/default/hypr/bindings/tiling-v2.conf -source = ~/.local/share/omarchy/default/hypr/bindings/utilities.conf -source = ~/.local/share/omarchy/default/hypr/envs.conf -source = ~/.local/share/omarchy/default/hypr/looknfeel.conf -source = ~/.local/share/omarchy/default/hypr/input.conf -source = ~/.local/share/omarchy/default/hypr/windows.conf -source = ~/.config/omarchy/current/theme/hyprland.conf - -# Change your own setup in these files (and overwrite any settings from defaults!) -source = ~/.config/hypr/monitors.conf -source = ~/.config/hypr/input.conf -source = ~/.config/hypr/bindings.conf -source = ~/.config/hypr/looknfeel.conf -source = ~/.config/hypr/autostart.conf - -# Toggle config flags dynamically -source = ~/.local/state/omarchy/toggles/hypr/*.conf - -# Add any other personal Hyprland configuration below -# windowrule = workspace 5, match:class qemu diff --git a/config/hypr/hyprland.lua b/config/hypr/hyprland.lua new file mode 100644 index 00000000..af2ce6db --- /dev/null +++ b/config/hypr/hyprland.lua @@ -0,0 +1,42 @@ +-- Learn how to configure Hyprland: https://wiki.hypr.land/Configuring/Start/ + +local home = os.getenv("HOME") or "" + +-- Hyprland recommends require() for split Lua configs. These two roots let us +-- load user modules from ~/.config and Omarchy defaults from $OMARCHY_PATH. +package.path = home .. "/.config/?.lua;" .. (os.getenv("OMARCHY_PATH") or (home .. "/.local/share/omarchy")) .. "/?.lua;" .. package.path + +local paths = require("default.hypr.paths") + +-- Use Omarchy defaults, but don't edit these directly. +require("default.hypr.autostart") +require("default.hypr.bindings.media") +require("default.hypr.bindings.clipboard") +require("default.hypr.bindings.tiling-v2") +require("default.hypr.bindings.utilities") +require("default.hypr.envs") +require("default.hypr.looknfeel") +require("default.hypr.input") +require("default.hypr.windows") + +-- Current theme overrides. +do + local theme = io.open(paths.config_home .. "/omarchy/current/theme/hyprland.lua", "r") + if theme then + theme:close() + require("omarchy.current.theme.hyprland") + end +end + +-- Change your own setup in these files and override defaults. +require("hypr.monitors") +require("hypr.input") +require("hypr.bindings") +require("hypr.looknfeel") +require("hypr.autostart") + +-- Toggle config flags dynamically. +require("default.hypr.toggles") + +-- Add any other personal Hyprland configuration below. +-- hl.window_rule({ match = { class = "qemu" }, workspace = "5" }) diff --git a/config/hypr/input.conf b/config/hypr/input.conf deleted file mode 100644 index ad15ddaf..00000000 --- a/config/hypr/input.conf +++ /dev/null @@ -1,53 +0,0 @@ -# Control your input devices -# See https://wiki.hypr.land/Configuring/Basics/Variables/#input -input { - # Use multiple keyboard layouts and switch between them with Left Alt + Right Alt - # kb_layout = us,dk,eu - - # Use a specific keyboard variant if needed (e.g. intl for international keyboards) - # kb_variant = intl - - kb_options = compose:caps # ,grp:alts_toggle - - # Change speed of keyboard repeat - repeat_rate = 40 - repeat_delay = 250 - - # Start with numlock on by default - numlock_by_default = true - - # Increase sensitivity for mouse/trackpad (default: 0) - # sensitivity = 0.35 - - # Turn off mouse acceleration (default: adaptive) - # accel_profile = flat - - touchpad { - # Use natural (inverse) scrolling - # natural_scroll = true - - # Use two-finger clicks for right-click instead of lower-right corner - clickfinger_behavior = true - - # Control the speed of your scrolling - scroll_factor = 0.4 - - # Enable the touchpad while typing - # disable_while_typing = false - - # Left-click-and-drag with three fingers - # drag_3fg = 1 - } -} - -# Scroll nicely in the terminal -windowrule = match:class (Alacritty|kitty|foot), scroll_touchpad 1.5 -windowrule = match:class com.mitchellh.ghostty, scroll_touchpad 0.2 - -# Enable touchpad gestures for changing workspaces -# See https://wiki.hypr.land/Configuring/Advanced-and-Cool/Gestures/ -# gesture = 3, horizontal, workspace - -# Enable touchpad gestures for moving focus (helpful on scrolling layout) -# gesture = 3, left, dispatcher, movefocus, l -# gesture = 3, right, dispatcher, movefocus, r diff --git a/config/hypr/input.lua b/config/hypr/input.lua new file mode 100644 index 00000000..d3ef0d20 --- /dev/null +++ b/config/hypr/input.lua @@ -0,0 +1,55 @@ +-- Control your input devices. +-- See https://wiki.hypr.land/Configuring/Basics/Variables/#input +hl.config({ + input = { + -- Use multiple keyboard layouts and switch between them with Left Alt + Right Alt. + -- kb_layout = "us,dk,eu", + + -- Use a specific keyboard variant if needed (e.g. intl for international keyboards). + -- kb_variant = "intl", + + kb_options = "compose:caps", -- ,grp:alts_toggle + + -- Change speed of keyboard repeat. + repeat_rate = 40, + repeat_delay = 250, + + -- Start with numlock on by default. + numlock_by_default = true, + + -- Increase sensitivity for mouse/trackpad (default: 0). + -- sensitivity = 0.35, + + -- Turn off mouse acceleration (default: adaptive). + -- accel_profile = "flat", + + touchpad = { + -- Use natural (inverse) scrolling. + -- natural_scroll = true, + + -- Use two-finger clicks for right-click instead of lower-right corner. + clickfinger_behavior = true, + + -- Control the speed of your scrolling. + scroll_factor = 0.4, + + -- Enable the touchpad while typing. + -- disable_while_typing = false, + + -- Left-click-and-drag with three fingers. + -- drag_3fg = 1, + }, + }, +}) + +-- Scroll nicely in the terminal. +hl.window_rule({ match = { class = "(Alacritty|kitty|foot)" }, scroll_touchpad = 1.5 }) +hl.window_rule({ match = { class = "com.mitchellh.ghostty" }, scroll_touchpad = 0.2 }) + +-- Enable touchpad gestures for changing workspaces. +-- See https://wiki.hypr.land/Configuring/Advanced-and-Cool/Gestures/ +-- hl.gesture({ fingers = 3, direction = "horizontal", action = "workspace" }) + +-- Enable touchpad gestures for moving focus (helpful on scrolling layout). +-- hl.gesture({ fingers = 3, direction = "left", action = function() hl.dispatch(hl.dsp.focus({ direction = "l" })) end }) +-- hl.gesture({ fingers = 3, direction = "right", action = function() hl.dispatch(hl.dsp.focus({ direction = "r" })) end }) diff --git a/config/hypr/looknfeel.conf b/config/hypr/looknfeel.conf deleted file mode 100644 index ea30461d..00000000 --- a/config/hypr/looknfeel.conf +++ /dev/null @@ -1,40 +0,0 @@ -# Change the default Omarchy look'n'feel - -# https://wiki.hypr.land/Configuring/Basics/Variables/#general -general { - # No gaps between windows or borders - # gaps_in = 0 - # gaps_out = 0 - # border_size = 0 - - # Change to niri-like side-scrolling layout - # layout = scrolling -} - -# https://wiki.hypr.land/Configuring/Basics/Variables/#decoration -decoration { - # Use round window corners - # rounding = 8 - - # Dim unfocused windows (0.0 = no dim, 1.0 = fully dimmed) - # dim_inactive = true - # dim_strength = 0.15 -} - -# https://wiki.hypr.land/Configuring/Basics/Variables/#animations -animations { - # Disable all animations - # enabled = no -} - -# https://wiki.hypr.land/Configuring/Basics/Variables/#layout -layout { - # Avoid overly wide single-window layouts on wide screens - # single_window_aspect_ratio = 1 1 -} - -# https://wiki.hypr.land/Configuring/Layouts/Scrolling-Layout/ -scrolling { - # See only one column per screen instead of two - # column_width = 0.97 -} diff --git a/config/hypr/looknfeel.lua b/config/hypr/looknfeel.lua new file mode 100644 index 00000000..a86d053e --- /dev/null +++ b/config/hypr/looknfeel.lua @@ -0,0 +1,50 @@ +-- Change the default Omarchy look'n'feel. + +-- https://wiki.hypr.land/Configuring/Basics/Variables/#general +-- hl.config({ +-- general = { +-- -- No gaps between windows or borders. +-- gaps_in = 0, +-- gaps_out = 0, +-- border_size = 0, +-- +-- -- Change to niri-like side-scrolling layout. +-- layout = "scrolling", +-- }, +-- }) + +-- https://wiki.hypr.land/Configuring/Basics/Variables/#decoration +-- hl.config({ +-- decoration = { +-- -- Use round window corners. +-- rounding = 8, +-- +-- -- Dim unfocused windows (0.0 = no dim, 1.0 = fully dimmed). +-- dim_inactive = true, +-- dim_strength = 0.15, +-- }, +-- }) + +-- https://wiki.hypr.land/Configuring/Basics/Variables/#animations +-- hl.config({ +-- animations = { +-- -- Disable all animations. +-- enabled = false, +-- }, +-- }) + +-- https://wiki.hypr.land/Configuring/Basics/Variables/#layout +-- hl.config({ +-- layout = { +-- -- Avoid overly wide single-window layouts on wide screens. +-- single_window_aspect_ratio = { 1, 1 }, +-- }, +-- }) + +-- https://wiki.hypr.land/Configuring/Layouts/Scrolling-Layout/ +-- hl.config({ +-- scrolling = { +-- -- See only one column per screen instead of two. +-- column_width = 0.97, +-- }, +-- }) diff --git a/config/hypr/monitors.conf b/config/hypr/monitors.conf deleted file mode 100644 index badc9b28..00000000 --- a/config/hypr/monitors.conf +++ /dev/null @@ -1,13 +0,0 @@ -# See https://wiki.hypr.land/Configuring/Basics/Monitors/ -# List current monitors and resolutions possible: hyprctl monitors -# Format: monitor = [port], resolution, position, scale - -# Default configuration -env = GDK_SCALE,2 -monitor=,preferred,auto,auto - -# Portrait/rotated secondary monitor (transform: 1 = 90°, 3 = 270°) -# monitor = DP-2, preferred, auto, 1, transform, 1 - -# Disable the second ghost monitor on an Apple 6K XDR over Thunderbolt -# monitor=DP-2,disable diff --git a/config/hypr/monitors.lua b/config/hypr/monitors.lua new file mode 100644 index 00000000..b51a5820 --- /dev/null +++ b/config/hypr/monitors.lua @@ -0,0 +1,25 @@ +-- See https://wiki.hypr.land/Configuring/Basics/Monitors/ +-- List current monitors and resolutions possible: hyprctl monitors all + +-- Optimized for retina-class 2x displays, like 13" 2.8K, 27" 5K, 32" 6K. +hl.env("GDK_SCALE", "2") +hl.monitor({ output = "", mode = "preferred", position = "auto", scale = "auto" }) + +-- Good compromise for 27" or 32" 4K monitors (but fractional!) +-- hl.env("GDK_SCALE", "1.75") +-- hl.monitor({ output = "", mode = "preferred", position = "auto", scale = 1.6 }) + +-- Straight 1x setup for low-resolution displays like 1080p or 1440p. +-- Or for ultrawide monitors like 34" 3440x1440 or 49" 5120x1440. +-- hl.env("GDK_SCALE", "1") +-- hl.monitor({ output = "", mode = "preferred", position = "auto", scale = 1 }) + +-- Portrait/rotated secondary monitor (transform: 1 = 90°, 3 = 270°) +-- hl.monitor({ output = "DP-2", mode = "preferred", position = "auto", scale = 1, transform = 1 }) + +-- Example for Framework 13 w/ 6K XDR Apple display. +-- hl.monitor({ output = "DP-5", mode = "6016x3384@60", position = "auto", scale = 2 }) +-- hl.monitor({ output = "eDP-1", mode = "2880x1920@120", position = "auto", scale = 2 }) + +-- Disable the second ghost monitor on an Apple 6K XDR over Thunderbolt. +-- hl.monitor({ output = "DP-2", disabled = true }) From c7b6a7f8c4e977b2c0c5bc096477233fbfd6a989 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sun, 10 May 2026 02:00:15 -0400 Subject: [PATCH 3/9] Swap defaults to lua --- default/hypr/apps.conf | 19 --- default/hypr/apps.lua | 5 + default/hypr/apps/1password.conf | 2 - default/hypr/apps/1password.lua | 2 + default/hypr/apps/bitwarden.conf | 6 - default/hypr/apps/bitwarden.lua | 6 + default/hypr/apps/browser.conf | 19 --- default/hypr/apps/browser.lua | 19 +++ default/hypr/apps/davinci-resolve.conf | 2 - default/hypr/apps/davinci-resolve.lua | 2 + default/hypr/apps/geforce.conf | 5 - default/hypr/apps/geforce.lua | 5 + default/hypr/apps/hyprshot.conf | 2 - default/hypr/apps/hyprshot.lua | 2 + default/hypr/apps/jetbrains.conf | 6 - default/hypr/apps/jetbrains.lua | 6 + default/hypr/apps/localsend.conf | 4 - default/hypr/apps/localsend.lua | 4 + default/hypr/apps/moonlight.conf | 6 - default/hypr/apps/moonlight.lua | 6 + default/hypr/apps/pip.conf | 10 -- default/hypr/apps/pip.lua | 10 ++ default/hypr/apps/qemu.conf | 2 - default/hypr/apps/qemu.lua | 2 + default/hypr/apps/retroarch.conf | 4 - default/hypr/apps/retroarch.lua | 4 + default/hypr/apps/steam.conf | 8 - default/hypr/apps/steam.lua | 8 + default/hypr/apps/system.conf | 23 --- default/hypr/apps/system.lua | 23 +++ default/hypr/apps/telegram.conf | 2 - default/hypr/apps/telegram.lua | 2 + default/hypr/apps/terminals.conf | 4 - default/hypr/apps/terminals.lua | 4 + default/hypr/apps/typora.conf | 2 - default/hypr/apps/typora.lua | 2 + default/hypr/apps/walker.conf | 2 - default/hypr/apps/walker.lua | 2 + default/hypr/apps/webcam-overlay.conf | 6 - default/hypr/apps/webcam-overlay.lua | 6 + default/hypr/autostart.conf | 16 -- default/hypr/autostart.lua | 18 +++ default/hypr/bindings.conf | 16 -- default/hypr/bindings.lua | 4 + default/hypr/bindings/clipboard.conf | 5 - default/hypr/bindings/clipboard.lua | 4 + default/hypr/bindings/media.conf | 30 ---- default/hypr/bindings/media.lua | 29 ++++ default/hypr/bindings/tiling-v2.conf | 143 ----------------- default/hypr/bindings/tiling-v2.lua | 93 +++++++++++ default/hypr/bindings/tiling.conf | 74 --------- default/hypr/bindings/utilities.conf | 80 ---------- default/hypr/bindings/utilities.lua | 72 +++++++++ default/hypr/envs.conf | 33 ---- default/hypr/envs.lua | 42 +++++ default/hypr/input.conf | 21 --- default/hypr/input.lua | 21 +++ default/hypr/looknfeel.conf | 144 ------------------ default/hypr/looknfeel.lua | 129 ++++++++++++++++ default/hypr/paths.lua | 12 ++ default/hypr/plain-bindings.conf | 16 -- default/hypr/plain-bindings.lua | 13 ++ default/hypr/require_all.lua | 33 ++++ default/hypr/toggles.lua | 7 + default/hypr/toggles/flags.conf | 2 - default/hypr/toggles/flags.lua | 2 + .../toggles/single-window-aspect-ratio.conf | 5 - .../toggles/single-window-aspect-ratio.lua | 6 + default/hypr/toggles/window-no-gaps.conf | 10 -- default/hypr/toggles/window-no-gaps.lua | 12 ++ default/hypr/windows.conf | 15 -- default/hypr/windows.lua | 25 +++ 72 files changed, 642 insertions(+), 744 deletions(-) delete mode 100644 default/hypr/apps.conf create mode 100644 default/hypr/apps.lua delete mode 100644 default/hypr/apps/1password.conf create mode 100644 default/hypr/apps/1password.lua delete mode 100644 default/hypr/apps/bitwarden.conf create mode 100644 default/hypr/apps/bitwarden.lua delete mode 100644 default/hypr/apps/browser.conf create mode 100644 default/hypr/apps/browser.lua delete mode 100644 default/hypr/apps/davinci-resolve.conf create mode 100644 default/hypr/apps/davinci-resolve.lua delete mode 100644 default/hypr/apps/geforce.conf create mode 100644 default/hypr/apps/geforce.lua delete mode 100644 default/hypr/apps/hyprshot.conf create mode 100644 default/hypr/apps/hyprshot.lua delete mode 100644 default/hypr/apps/jetbrains.conf create mode 100644 default/hypr/apps/jetbrains.lua delete mode 100644 default/hypr/apps/localsend.conf create mode 100644 default/hypr/apps/localsend.lua delete mode 100644 default/hypr/apps/moonlight.conf create mode 100644 default/hypr/apps/moonlight.lua delete mode 100644 default/hypr/apps/pip.conf create mode 100644 default/hypr/apps/pip.lua delete mode 100644 default/hypr/apps/qemu.conf create mode 100644 default/hypr/apps/qemu.lua delete mode 100644 default/hypr/apps/retroarch.conf create mode 100644 default/hypr/apps/retroarch.lua delete mode 100644 default/hypr/apps/steam.conf create mode 100644 default/hypr/apps/steam.lua delete mode 100644 default/hypr/apps/system.conf create mode 100644 default/hypr/apps/system.lua delete mode 100644 default/hypr/apps/telegram.conf create mode 100644 default/hypr/apps/telegram.lua delete mode 100644 default/hypr/apps/terminals.conf create mode 100644 default/hypr/apps/terminals.lua delete mode 100644 default/hypr/apps/typora.conf create mode 100644 default/hypr/apps/typora.lua delete mode 100644 default/hypr/apps/walker.conf create mode 100644 default/hypr/apps/walker.lua delete mode 100644 default/hypr/apps/webcam-overlay.conf create mode 100644 default/hypr/apps/webcam-overlay.lua delete mode 100644 default/hypr/autostart.conf create mode 100644 default/hypr/autostart.lua delete mode 100644 default/hypr/bindings.conf create mode 100644 default/hypr/bindings.lua delete mode 100644 default/hypr/bindings/clipboard.conf create mode 100644 default/hypr/bindings/clipboard.lua delete mode 100644 default/hypr/bindings/media.conf create mode 100644 default/hypr/bindings/media.lua delete mode 100644 default/hypr/bindings/tiling-v2.conf create mode 100644 default/hypr/bindings/tiling-v2.lua delete mode 100644 default/hypr/bindings/tiling.conf delete mode 100644 default/hypr/bindings/utilities.conf create mode 100644 default/hypr/bindings/utilities.lua delete mode 100644 default/hypr/envs.conf create mode 100644 default/hypr/envs.lua delete mode 100644 default/hypr/input.conf create mode 100644 default/hypr/input.lua delete mode 100644 default/hypr/looknfeel.conf create mode 100644 default/hypr/looknfeel.lua create mode 100644 default/hypr/paths.lua delete mode 100644 default/hypr/plain-bindings.conf create mode 100644 default/hypr/plain-bindings.lua create mode 100644 default/hypr/require_all.lua create mode 100644 default/hypr/toggles.lua delete mode 100644 default/hypr/toggles/flags.conf create mode 100644 default/hypr/toggles/flags.lua delete mode 100644 default/hypr/toggles/single-window-aspect-ratio.conf create mode 100644 default/hypr/toggles/single-window-aspect-ratio.lua delete mode 100644 default/hypr/toggles/window-no-gaps.conf create mode 100644 default/hypr/toggles/window-no-gaps.lua delete mode 100644 default/hypr/windows.conf create mode 100644 default/hypr/windows.lua diff --git a/default/hypr/apps.conf b/default/hypr/apps.conf deleted file mode 100644 index f64c6e39..00000000 --- a/default/hypr/apps.conf +++ /dev/null @@ -1,19 +0,0 @@ -# App-specific tweaks -source = ~/.local/share/omarchy/default/hypr/apps/1password.conf -source = ~/.local/share/omarchy/default/hypr/apps/bitwarden.conf -source = ~/.local/share/omarchy/default/hypr/apps/browser.conf -source = ~/.local/share/omarchy/default/hypr/apps/hyprshot.conf -source = ~/.local/share/omarchy/default/hypr/apps/jetbrains.conf -source = ~/.local/share/omarchy/default/hypr/apps/localsend.conf -source = ~/.local/share/omarchy/default/hypr/apps/pip.conf -source = ~/.local/share/omarchy/default/hypr/apps/qemu.conf -source = ~/.local/share/omarchy/default/hypr/apps/retroarch.conf -source = ~/.local/share/omarchy/default/hypr/apps/steam.conf -source = ~/.local/share/omarchy/default/hypr/apps/geforce.conf -source = ~/.local/share/omarchy/default/hypr/apps/moonlight.conf -source = ~/.local/share/omarchy/default/hypr/apps/system.conf -source = ~/.local/share/omarchy/default/hypr/apps/telegram.conf -source = ~/.local/share/omarchy/default/hypr/apps/typora.conf -source = ~/.local/share/omarchy/default/hypr/apps/terminals.conf -source = ~/.local/share/omarchy/default/hypr/apps/walker.conf -source = ~/.local/share/omarchy/default/hypr/apps/webcam-overlay.conf diff --git a/default/hypr/apps.lua b/default/hypr/apps.lua new file mode 100644 index 00000000..c2301594 --- /dev/null +++ b/default/hypr/apps.lua @@ -0,0 +1,5 @@ +-- App-specific tweaks. +local paths = require("default.hypr.paths") +local require_all = require("default.hypr.require_all") + +require_all.files(paths.omarchy_path .. "/default/hypr/apps", "default.hypr.apps") diff --git a/default/hypr/apps/1password.conf b/default/hypr/apps/1password.conf deleted file mode 100644 index a666430c..00000000 --- a/default/hypr/apps/1password.conf +++ /dev/null @@ -1,2 +0,0 @@ -windowrule = no_screen_share on, match:class ^(1[p|P]assword)$ -windowrule = tag +floating-window, match:class ^(1[p|P]assword)$ diff --git a/default/hypr/apps/1password.lua b/default/hypr/apps/1password.lua new file mode 100644 index 00000000..0cb083b4 --- /dev/null +++ b/default/hypr/apps/1password.lua @@ -0,0 +1,2 @@ +hl.window_rule({ match = { class = "^(1[p|P]assword)$" }, no_screen_share = true }) +hl.window_rule({ match = { class = "^(1[p|P]assword)$" }, tag = "+floating-window" }) diff --git a/default/hypr/apps/bitwarden.conf b/default/hypr/apps/bitwarden.conf deleted file mode 100644 index 8ffb5688..00000000 --- a/default/hypr/apps/bitwarden.conf +++ /dev/null @@ -1,6 +0,0 @@ -windowrule = no_screen_share on, match:class ^(Bitwarden)$ -windowrule = tag +floating-window, match:class ^(Bitwarden)$ - -# Bitwarden Chrome Extension -windowrule = no_screen_share on, match:class chrome-nngceckbapebfimnlniiiahkandclblb-Default -windowrule = tag +floating-window, match:class chrome-nngceckbapebfimnlniiiahkandclblb-Default diff --git a/default/hypr/apps/bitwarden.lua b/default/hypr/apps/bitwarden.lua new file mode 100644 index 00000000..817d78ab --- /dev/null +++ b/default/hypr/apps/bitwarden.lua @@ -0,0 +1,6 @@ +hl.window_rule({ match = { class = "^(Bitwarden)$" }, no_screen_share = true }) +hl.window_rule({ match = { class = "^(Bitwarden)$" }, tag = "+floating-window" }) + +-- Bitwarden Chrome Extension. +hl.window_rule({ match = { class = "chrome-nngceckbapebfimnlniiiahkandclblb-Default" }, no_screen_share = true }) +hl.window_rule({ match = { class = "chrome-nngceckbapebfimnlniiiahkandclblb-Default" }, tag = "+floating-window" }) diff --git a/default/hypr/apps/browser.conf b/default/hypr/apps/browser.conf deleted file mode 100644 index 53acc6df..00000000 --- a/default/hypr/apps/browser.conf +++ /dev/null @@ -1,19 +0,0 @@ -# Browser types -windowrule = tag +chromium-based-browser, match:class ((google-)?[cC]hrom(e|ium)|[bB]rave-browser|[mM]icrosoft-edge|Vivaldi-stable|helium) -windowrule = tag +firefox-based-browser, match:class ([fF]irefox|zen|librewolf) -windowrule = tag -default-opacity, match:tag chromium-based-browser -windowrule = tag -default-opacity, match:tag firefox-based-browser - -# Video apps: remove chromium browser tag so they don't get opacity applied -windowrule = tag -chromium-based-browser, match:class (chrome-youtube.com__-Default|chrome-app.zoom.us__wc_home-Default) -windowrule = tag -default-opacity, match:class (chrome-youtube.com__-Default|chrome-app.zoom.us__wc_home-Default) - -# Force chromium-based browsers into a tile to deal with --app bug -windowrule = tile on, match:tag chromium-based-browser - -# Only a subtle opacity change, but not for video sites -windowrule = opacity 1.0 0.97, match:tag chromium-based-browser -windowrule = opacity 1.0 0.97, match:tag firefox-based-browser - -# Hide the screen-sharing notification bar (the "Hide" button on it is broken on Wayland) -windowrule = workspace special silent, match:title .*is sharing.* diff --git a/default/hypr/apps/browser.lua b/default/hypr/apps/browser.lua new file mode 100644 index 00000000..4fc73a33 --- /dev/null +++ b/default/hypr/apps/browser.lua @@ -0,0 +1,19 @@ +-- Browser types. +hl.window_rule({ match = { class = "((google-)?[cC]hrom(e|ium)|[bB]rave-browser|[mM]icrosoft-edge|Vivaldi-stable|helium)" }, tag = "+chromium-based-browser" }) +hl.window_rule({ match = { class = "([fF]irefox|zen|librewolf)" }, tag = "+firefox-based-browser" }) +hl.window_rule({ match = { tag = "chromium-based-browser" }, tag = "-default-opacity" }) +hl.window_rule({ match = { tag = "firefox-based-browser" }, tag = "-default-opacity" }) + +-- Video apps: remove chromium browser tag so they don't get opacity applied. +hl.window_rule({ match = { class = "(chrome-youtube.com__-Default|chrome-app.zoom.us__wc_home-Default)" }, tag = "-chromium-based-browser" }) +hl.window_rule({ match = { class = "(chrome-youtube.com__-Default|chrome-app.zoom.us__wc_home-Default)" }, tag = "-default-opacity" }) + +-- Force chromium-based browsers into a tile to deal with --app bug. +hl.window_rule({ match = { tag = "chromium-based-browser" }, tile = true }) + +-- Only a subtle opacity change, but not for video sites. +hl.window_rule({ match = { tag = "chromium-based-browser" }, opacity = "1.0 0.97" }) +hl.window_rule({ match = { tag = "firefox-based-browser" }, opacity = "1.0 0.97" }) + +-- Hide the screen-sharing notification bar (the "Hide" button on it is broken on Wayland). +hl.window_rule({ match = { title = ".*is sharing.*" }, workspace = "special silent" }) diff --git a/default/hypr/apps/davinci-resolve.conf b/default/hypr/apps/davinci-resolve.conf deleted file mode 100644 index 9067fdf6..00000000 --- a/default/hypr/apps/davinci-resolve.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Focus floating DaVinci Resolve dialog windows -windowrule = stay_focused on, match:class .*[Rr]esolve.*, match:float 1 diff --git a/default/hypr/apps/davinci-resolve.lua b/default/hypr/apps/davinci-resolve.lua new file mode 100644 index 00000000..637d51bd --- /dev/null +++ b/default/hypr/apps/davinci-resolve.lua @@ -0,0 +1,2 @@ +-- Focus floating DaVinci Resolve dialog windows. +hl.window_rule({ match = { class = ".*[Rr]esolve.*", float = true }, stay_focused = true }) diff --git a/default/hypr/apps/geforce.conf b/default/hypr/apps/geforce.conf deleted file mode 100644 index fb2e5a30..00000000 --- a/default/hypr/apps/geforce.conf +++ /dev/null @@ -1,5 +0,0 @@ -windowrule { - name = geforce - match:class = GeForceNOW - idle_inhibit = fullscreen -} diff --git a/default/hypr/apps/geforce.lua b/default/hypr/apps/geforce.lua new file mode 100644 index 00000000..feb7e885 --- /dev/null +++ b/default/hypr/apps/geforce.lua @@ -0,0 +1,5 @@ +hl.window_rule({ + name = "geforce", + match = { class = "GeForceNOW" }, + idle_inhibit = "fullscreen", +}) diff --git a/default/hypr/apps/hyprshot.conf b/default/hypr/apps/hyprshot.conf deleted file mode 100644 index 795ac396..00000000 --- a/default/hypr/apps/hyprshot.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Remove 1px border around hyprshot screenshots -layerrule = no_anim on, match:namespace selection diff --git a/default/hypr/apps/hyprshot.lua b/default/hypr/apps/hyprshot.lua new file mode 100644 index 00000000..409f2605 --- /dev/null +++ b/default/hypr/apps/hyprshot.lua @@ -0,0 +1,2 @@ +-- Remove 1px border around hyprshot screenshots. +hl.layer_rule({ match = { namespace = "selection" }, no_anim = true }) diff --git a/default/hypr/apps/jetbrains.conf b/default/hypr/apps/jetbrains.conf deleted file mode 100644 index b1eea6a0..00000000 --- a/default/hypr/apps/jetbrains.conf +++ /dev/null @@ -1,6 +0,0 @@ -# Disable mouse focus (see https://github.com/basecamp/omarchy/pull/5183#issuecomment-4189299971) -windowrule { - name = jetbrains-focus - no_follow_mouse = on - match:class = ^(jetbrains-.*)$ -} diff --git a/default/hypr/apps/jetbrains.lua b/default/hypr/apps/jetbrains.lua new file mode 100644 index 00000000..f48d150f --- /dev/null +++ b/default/hypr/apps/jetbrains.lua @@ -0,0 +1,6 @@ +-- Disable mouse focus (see https://github.com/basecamp/omarchy/pull/5183#issuecomment-4189299971). +hl.window_rule({ + name = "jetbrains-focus", + match = { class = "^(jetbrains-.*)$" }, + no_follow_mouse = true, +}) diff --git a/default/hypr/apps/localsend.conf b/default/hypr/apps/localsend.conf deleted file mode 100644 index c4f6a552..00000000 --- a/default/hypr/apps/localsend.conf +++ /dev/null @@ -1,4 +0,0 @@ -# Float LocalSend and fzf file picker -windowrule = float on, match:class (Share|localsend) -windowrule = center on, match:class (Share|localsend) -windowrule = size 1100 700, match:class localsend diff --git a/default/hypr/apps/localsend.lua b/default/hypr/apps/localsend.lua new file mode 100644 index 00000000..e670fd7f --- /dev/null +++ b/default/hypr/apps/localsend.lua @@ -0,0 +1,4 @@ +-- Float LocalSend and fzf file picker. +hl.window_rule({ match = { class = "(Share|localsend)" }, float = true }) +hl.window_rule({ match = { class = "(Share|localsend)" }, center = true }) +hl.window_rule({ match = { class = "localsend" }, size = { 1100, 700 } }) diff --git a/default/hypr/apps/moonlight.conf b/default/hypr/apps/moonlight.conf deleted file mode 100644 index 271a11c1..00000000 --- a/default/hypr/apps/moonlight.conf +++ /dev/null @@ -1,6 +0,0 @@ -windowrule { - name = moonlight - match:class = com.moonlight_stream.Moonlight - fullscreen = 1 - idle_inhibit = fullscreen -} diff --git a/default/hypr/apps/moonlight.lua b/default/hypr/apps/moonlight.lua new file mode 100644 index 00000000..2774d77c --- /dev/null +++ b/default/hypr/apps/moonlight.lua @@ -0,0 +1,6 @@ +hl.window_rule({ + name = "moonlight", + match = { class = "com.moonlight_stream.Moonlight" }, + fullscreen = true, + idle_inhibit = "fullscreen", +}) diff --git a/default/hypr/apps/pip.conf b/default/hypr/apps/pip.conf deleted file mode 100644 index 417edc91..00000000 --- a/default/hypr/apps/pip.conf +++ /dev/null @@ -1,10 +0,0 @@ -# Picture-in-picture overlays -windowrule = tag +pip, match:title (Picture.?in.?[Pp]icture) -windowrule = tag -default-opacity, match:tag pip -windowrule = float on, match:tag pip -windowrule = pin on, match:tag pip -windowrule = size 600 338, match:tag pip -windowrule = keep_aspect_ratio on, match:tag pip -windowrule = border_size 0, match:tag pip -windowrule = opacity 1 1, match:tag pip -windowrule = move (monitor_w-window_w-40) (monitor_h*0.04), match:tag pip diff --git a/default/hypr/apps/pip.lua b/default/hypr/apps/pip.lua new file mode 100644 index 00000000..6158fa9b --- /dev/null +++ b/default/hypr/apps/pip.lua @@ -0,0 +1,10 @@ +-- Picture-in-picture overlays. +hl.window_rule({ match = { title = "(Picture.?in.?[Pp]icture)" }, tag = "+pip" }) +hl.window_rule({ match = { tag = "pip" }, tag = "-default-opacity" }) +hl.window_rule({ match = { tag = "pip" }, float = true }) +hl.window_rule({ match = { tag = "pip" }, pin = true }) +hl.window_rule({ match = { tag = "pip" }, size = { 600, 338 } }) +hl.window_rule({ match = { tag = "pip" }, keep_aspect_ratio = true }) +hl.window_rule({ match = { tag = "pip" }, border_size = 0 }) +hl.window_rule({ match = { tag = "pip" }, opacity = "1 1" }) +hl.window_rule({ match = { tag = "pip" }, move = { "(monitor_w-window_w-40)", "(monitor_h*0.04)" } }) diff --git a/default/hypr/apps/qemu.conf b/default/hypr/apps/qemu.conf deleted file mode 100644 index 6dcce0e0..00000000 --- a/default/hypr/apps/qemu.conf +++ /dev/null @@ -1,2 +0,0 @@ -windowrule = tag -default-opacity, match:class qemu -windowrule = opacity 1 1, match:class qemu diff --git a/default/hypr/apps/qemu.lua b/default/hypr/apps/qemu.lua new file mode 100644 index 00000000..e9334c1c --- /dev/null +++ b/default/hypr/apps/qemu.lua @@ -0,0 +1,2 @@ +hl.window_rule({ match = { class = "qemu" }, tag = "-default-opacity" }) +hl.window_rule({ match = { class = "qemu" }, opacity = "1 1" }) diff --git a/default/hypr/apps/retroarch.conf b/default/hypr/apps/retroarch.conf deleted file mode 100644 index 556f0fd8..00000000 --- a/default/hypr/apps/retroarch.conf +++ /dev/null @@ -1,4 +0,0 @@ -windowrule = fullscreen on, match:class com.libretro.RetroArch -windowrule = tag -default-opacity, match:class com.libretro.RetroArch -windowrule = opacity 1 1, match:class com.libretro.RetroArch -windowrule = idle_inhibit fullscreen, match:class com.libretro.RetroArch diff --git a/default/hypr/apps/retroarch.lua b/default/hypr/apps/retroarch.lua new file mode 100644 index 00000000..01b3f8b5 --- /dev/null +++ b/default/hypr/apps/retroarch.lua @@ -0,0 +1,4 @@ +hl.window_rule({ match = { class = "com.libretro.RetroArch" }, fullscreen = true }) +hl.window_rule({ match = { class = "com.libretro.RetroArch" }, tag = "-default-opacity" }) +hl.window_rule({ match = { class = "com.libretro.RetroArch" }, opacity = "1 1" }) +hl.window_rule({ match = { class = "com.libretro.RetroArch" }, idle_inhibit = "fullscreen" }) diff --git a/default/hypr/apps/steam.conf b/default/hypr/apps/steam.conf deleted file mode 100644 index a42a6e68..00000000 --- a/default/hypr/apps/steam.conf +++ /dev/null @@ -1,8 +0,0 @@ -# Float Steam -windowrule = float on, match:class steam -windowrule = center on, match:class steam, match:title Steam -windowrule = tag -default-opacity, match:class steam.* -windowrule = opacity 1 1, match:class steam.* -windowrule = size 1100 700, match:class steam, match:title Steam -windowrule = size 460 800, match:class steam, match:title Friends List -windowrule = idle_inhibit fullscreen, match:class steam diff --git a/default/hypr/apps/steam.lua b/default/hypr/apps/steam.lua new file mode 100644 index 00000000..05bb75d8 --- /dev/null +++ b/default/hypr/apps/steam.lua @@ -0,0 +1,8 @@ +-- Float Steam. +hl.window_rule({ match = { class = "steam" }, float = true }) +hl.window_rule({ match = { class = "steam", title = "Steam" }, center = true }) +hl.window_rule({ match = { class = "steam.*" }, tag = "-default-opacity" }) +hl.window_rule({ match = { class = "steam.*" }, opacity = "1 1" }) +hl.window_rule({ match = { class = "steam", title = "Steam" }, size = { 1100, 700 } }) +hl.window_rule({ match = { class = "steam", title = "Friends List" }, size = { 460, 800 } }) +hl.window_rule({ match = { class = "steam" }, idle_inhibit = "fullscreen" }) diff --git a/default/hypr/apps/system.conf b/default/hypr/apps/system.conf deleted file mode 100644 index 6f82aa35..00000000 --- a/default/hypr/apps/system.conf +++ /dev/null @@ -1,23 +0,0 @@ -# Floating windows -windowrule = float on, match:tag floating-window -windowrule = center on, match:tag floating-window -windowrule = size 875 600, match:tag floating-window - -windowrule = tag +floating-window, match:class (org.omarchy.bluetui|org.omarchy.impala|org.omarchy.wiremix|org.omarchy.btop|org.omarchy.terminal|org.omarchy.bash|org.codeberg.dnkl.foot|org.gnome.NautilusPreviewer|org.gnome.Evince|com.gabm.satty|Omarchy|About|TUI.float|imv|mpv) -windowrule = tag +floating-window, match:class (xdg-desktop-portal-gtk|sublime_text|DesktopEditors|org.gnome.Nautilus), match:title ^(Open.*Files?|Open [F|f]older.*|Save.*Files?|Save.*As|Save|All Files|.*wants to [open|save].*|[C|c]hoose.*) -windowrule = float on, match:class org.gnome.Calculator - -# Fullscreen screensaver -windowrule = fullscreen on, match:class org.omarchy.screensaver -windowrule = float on, match:class org.omarchy.screensaver -windowrule = animation slide, match:class org.omarchy.screensaver - -# No transparency on media windows -windowrule = tag -default-opacity, match:class ^(zoom|vlc|mpv|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta|imv|org.gnome.NautilusPreviewer)$ -windowrule = opacity 1 1, match:class ^(zoom|vlc|mpv|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta|imv|org.gnome.NautilusPreviewer)$ - -# Popped window rounding -windowrule = rounding 8, match:tag pop - -# Prevent idle while open -windowrule = idle_inhibit always, match:tag noidle diff --git a/default/hypr/apps/system.lua b/default/hypr/apps/system.lua new file mode 100644 index 00000000..71e828fe --- /dev/null +++ b/default/hypr/apps/system.lua @@ -0,0 +1,23 @@ +-- Floating windows. +hl.window_rule({ match = { tag = "floating-window" }, float = true }) +hl.window_rule({ match = { tag = "floating-window" }, center = true }) +hl.window_rule({ match = { tag = "floating-window" }, size = { 875, 600 } }) + +hl.window_rule({ match = { class = "(org.omarchy.bluetui|org.omarchy.impala|org.omarchy.wiremix|org.omarchy.btop|org.omarchy.terminal|org.omarchy.bash|org.codeberg.dnkl.foot|org.gnome.NautilusPreviewer|org.gnome.Evince|com.gabm.satty|Omarchy|About|TUI.float|imv|mpv)" }, tag = "+floating-window" }) +hl.window_rule({ match = { class = "(xdg-desktop-portal-gtk|sublime_text|DesktopEditors|org.gnome.Nautilus)", title = "^(Open.*Files?|Open [F|f]older.*|Save.*Files?|Save.*As|Save|All Files|.*wants to [open|save].*|[C|c]hoose.*)" }, tag = "+floating-window" }) +hl.window_rule({ match = { class = "org.gnome.Calculator" }, float = true }) + +-- Fullscreen screensaver. +hl.window_rule({ match = { class = "org.omarchy.screensaver" }, fullscreen = true }) +hl.window_rule({ match = { class = "org.omarchy.screensaver" }, float = true }) +hl.window_rule({ match = { class = "org.omarchy.screensaver" }, animation = "slide" }) + +-- No transparency on media windows. +hl.window_rule({ match = { class = "^(zoom|vlc|mpv|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta|imv|org.gnome.NautilusPreviewer)$" }, tag = "-default-opacity" }) +hl.window_rule({ match = { class = "^(zoom|vlc|mpv|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta|imv|org.gnome.NautilusPreviewer)$" }, opacity = "1 1" }) + +-- Popped window rounding. +hl.window_rule({ match = { tag = "pop" }, rounding = 8 }) + +-- Prevent idle while open. +hl.window_rule({ match = { tag = "noidle" }, idle_inhibit = "always" }) diff --git a/default/hypr/apps/telegram.conf b/default/hypr/apps/telegram.conf deleted file mode 100644 index 5a621fdb..00000000 --- a/default/hypr/apps/telegram.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Prevent Telegram from stealing focus on new messages -windowrule = focus_on_activate off, match:class org.telegram.desktop diff --git a/default/hypr/apps/telegram.lua b/default/hypr/apps/telegram.lua new file mode 100644 index 00000000..e1509516 --- /dev/null +++ b/default/hypr/apps/telegram.lua @@ -0,0 +1,2 @@ +-- Prevent Telegram from stealing focus on new messages. +hl.window_rule({ match = { class = "org.telegram.desktop" }, focus_on_activate = false }) diff --git a/default/hypr/apps/terminals.conf b/default/hypr/apps/terminals.conf deleted file mode 100644 index b4940720..00000000 --- a/default/hypr/apps/terminals.conf +++ /dev/null @@ -1,4 +0,0 @@ -# Define terminal tag to style them uniformly -windowrule = tag +terminal, match:class (Alacritty|kitty|com.mitchellh.ghostty|foot) -windowrule = tag -default-opacity, match:tag terminal -windowrule = opacity 0.97 0.9, match:tag terminal diff --git a/default/hypr/apps/terminals.lua b/default/hypr/apps/terminals.lua new file mode 100644 index 00000000..0a1d403e --- /dev/null +++ b/default/hypr/apps/terminals.lua @@ -0,0 +1,4 @@ +-- Define terminal tag to style them uniformly. +hl.window_rule({ match = { class = "(Alacritty|kitty|com.mitchellh.ghostty|foot)" }, tag = "+terminal" }) +hl.window_rule({ match = { tag = "terminal" }, tag = "-default-opacity" }) +hl.window_rule({ match = { tag = "terminal" }, opacity = "0.97 0.9" }) diff --git a/default/hypr/apps/typora.conf b/default/hypr/apps/typora.conf deleted file mode 100644 index 873c82e6..00000000 --- a/default/hypr/apps/typora.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Float Typora print dialog -windowrule = match:class ^Typora$, match:title ^Print$, float on, center on diff --git a/default/hypr/apps/typora.lua b/default/hypr/apps/typora.lua new file mode 100644 index 00000000..a8af36a3 --- /dev/null +++ b/default/hypr/apps/typora.lua @@ -0,0 +1,2 @@ +-- Float Typora print dialog. +hl.window_rule({ match = { class = "^Typora$", title = "^Print$" }, float = true, center = true }) diff --git a/default/hypr/apps/walker.conf b/default/hypr/apps/walker.conf deleted file mode 100644 index 127e3b42..00000000 --- a/default/hypr/apps/walker.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Application-specific animation -layerrule = no_anim on, match:namespace walker diff --git a/default/hypr/apps/walker.lua b/default/hypr/apps/walker.lua new file mode 100644 index 00000000..1d6f167b --- /dev/null +++ b/default/hypr/apps/walker.lua @@ -0,0 +1,2 @@ +-- Application-specific animation. +hl.layer_rule({ match = { namespace = "walker" }, no_anim = true }) diff --git a/default/hypr/apps/webcam-overlay.conf b/default/hypr/apps/webcam-overlay.conf deleted file mode 100644 index 307d6864..00000000 --- a/default/hypr/apps/webcam-overlay.conf +++ /dev/null @@ -1,6 +0,0 @@ -# Webcam overlay for screen recording -windowrule = float on, match:title WebcamOverlay -windowrule = pin on, match:title WebcamOverlay -windowrule = no_initial_focus on, match:title WebcamOverlay -windowrule = no_dim on, match:title WebcamOverlay -windowrule = move (monitor_w-window_w-40) (monitor_h-window_h-40), match:title WebcamOverlay diff --git a/default/hypr/apps/webcam-overlay.lua b/default/hypr/apps/webcam-overlay.lua new file mode 100644 index 00000000..42f7acde --- /dev/null +++ b/default/hypr/apps/webcam-overlay.lua @@ -0,0 +1,6 @@ +-- Webcam overlay for screen recording. +hl.window_rule({ match = { title = "WebcamOverlay" }, float = true }) +hl.window_rule({ match = { title = "WebcamOverlay" }, pin = true }) +hl.window_rule({ match = { title = "WebcamOverlay" }, no_initial_focus = true }) +hl.window_rule({ match = { title = "WebcamOverlay" }, no_dim = true }) +hl.window_rule({ match = { title = "WebcamOverlay" }, move = { "(monitor_w-window_w-40)", "(monitor_h-window_h-40)" } }) diff --git a/default/hypr/autostart.conf b/default/hypr/autostart.conf deleted file mode 100644 index 0a226db1..00000000 --- a/default/hypr/autostart.conf +++ /dev/null @@ -1,16 +0,0 @@ -exec-once = uwsm-app -- hypridle -exec-once = uwsm-app -- mako -exec-once = ! omarchy-toggle-enabled waybar-off && uwsm-app -- waybar -exec-once = uwsm-app -- fcitx5 --disable notificationitem -exec-once = uwsm-app -- swaybg -i ~/.config/omarchy/current/background -m fill -exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 -exec-once = omarchy-first-run -exec-once = omarchy-powerprofiles-init -exec-once = uwsm-app -- omarchy-hyprland-monitor-watch - -# Slow app launch fix -- set systemd vars -exec-once = systemctl --user import-environment $(env | cut -d'=' -f 1) -exec-once = dbus-update-activation-environment --systemd --all - -# Run post-boot hooks after startup config has loaded -exec-once = sleep 2 && omarchy-hook post-boot diff --git a/default/hypr/autostart.lua b/default/hypr/autostart.lua new file mode 100644 index 00000000..7eed5fbb --- /dev/null +++ b/default/hypr/autostart.lua @@ -0,0 +1,18 @@ +hl.on("hyprland.start", function() + hl.exec_cmd("uwsm-app -- hypridle") + hl.exec_cmd("uwsm-app -- mako") + hl.exec_cmd("! omarchy-toggle-enabled waybar-off && uwsm-app -- waybar") + hl.exec_cmd("uwsm-app -- fcitx5 --disable notificationitem") + hl.exec_cmd("uwsm-app -- swaybg -i ~/.config/omarchy/current/background -m fill") + hl.exec_cmd("/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1") + hl.exec_cmd("omarchy-first-run") + hl.exec_cmd("omarchy-powerprofiles-init") + hl.exec_cmd("uwsm-app -- omarchy-hyprland-monitor-watch") + + -- Slow app launch fix -- set systemd vars. + hl.exec_cmd("systemctl --user import-environment $(env | cut -d'=' -f 1)") + hl.exec_cmd("dbus-update-activation-environment --systemd --all") + + -- Run post-boot hooks after startup config has loaded. + hl.exec_cmd("sleep 2 && omarchy-hook post-boot") +end) diff --git a/default/hypr/bindings.conf b/default/hypr/bindings.conf deleted file mode 100644 index 4daf95a0..00000000 --- a/default/hypr/bindings.conf +++ /dev/null @@ -1,16 +0,0 @@ -# Deprecated bindings file. New installations include everything directly. - -bindd = SUPER, RETURN, Terminal, exec, $terminal -bindd = SUPER, F, File manager, exec, $fileManager -bindd = SUPER, B, Web browser, exec, $browser -bindd = SUPER, M, Music player, exec, $music -bindd = SUPER, N, Neovim, exec, $terminal -e nvim -bindd = SUPER, T, Top, exec, $terminal -e btop -bindd = SUPER, D, Lazy Docker, exec, $terminal -e lazydocker -bindd = SUPER, G, Messenger, exec, $messenger -bindd = SUPER, O, Obsidian, exec, obsidian -bindd = SUPER, SLASH, Password manager, exec, $passwordManager - -source = ~/.local/share/omarchy/default/hypr/bindings/media.conf -source = ~/.local/share/omarchy/default/hypr/bindings/tiling.conf -source = ~/.local/share/omarchy/default/hypr/bindings/utilities.conf diff --git a/default/hypr/bindings.lua b/default/hypr/bindings.lua new file mode 100644 index 00000000..405d8449 --- /dev/null +++ b/default/hypr/bindings.lua @@ -0,0 +1,4 @@ +local paths = require("default.hypr.paths") +local require_all = require("default.hypr.require_all") + +require_all.files(paths.omarchy_path .. "/default/hypr/bindings", "default.hypr.bindings") diff --git a/default/hypr/bindings/clipboard.conf b/default/hypr/bindings/clipboard.conf deleted file mode 100644 index ffaede7a..00000000 --- a/default/hypr/bindings/clipboard.conf +++ /dev/null @@ -1,5 +0,0 @@ -# Copy / Paste -bindd = SUPER, C, Universal copy, sendshortcut, CTRL, Insert, -bindd = SUPER, V, Universal paste, sendshortcut, SHIFT, Insert, -bindd = SUPER, X, Universal cut, sendshortcut, CTRL, X, -bindd = SUPER CTRL, V, Clipboard manager, exec, omarchy-launch-walker -m clipboard diff --git a/default/hypr/bindings/clipboard.lua b/default/hypr/bindings/clipboard.lua new file mode 100644 index 00000000..7a874145 --- /dev/null +++ b/default/hypr/bindings/clipboard.lua @@ -0,0 +1,4 @@ +hl.bind("SUPER + C", hl.dsp.send_shortcut({ mods = "CTRL", key = "Insert" }), { description = "Universal copy" }) +hl.bind("SUPER + V", hl.dsp.send_shortcut({ mods = "SHIFT", key = "Insert" }), { description = "Universal paste" }) +hl.bind("SUPER + X", hl.dsp.send_shortcut({ mods = "CTRL", key = "X" }), { description = "Universal cut" }) +hl.bind("SUPER + CTRL + V", hl.dsp.exec_cmd("omarchy-launch-walker -m clipboard"), { description = "Clipboard manager" }) diff --git a/default/hypr/bindings/media.conf b/default/hypr/bindings/media.conf deleted file mode 100644 index d18f5aa5..00000000 --- a/default/hypr/bindings/media.conf +++ /dev/null @@ -1,30 +0,0 @@ -# Laptop multimedia keys for volume and LCD brightness (with OSD) -bindeld = ,XF86AudioRaiseVolume, Volume up, exec, omarchy-swayosd-client --output-volume raise -bindeld = ,XF86AudioLowerVolume, Volume down, exec, omarchy-swayosd-client --output-volume lower -bindeld = ,XF86AudioMute, Mute, exec, omarchy-swayosd-client --output-volume mute-toggle -bindeld = ,XF86AudioMicMute, Mute microphone, exec, omarchy-audio-input-mute -bindeld = ,XF86MonBrightnessUp, Brightness up, exec, omarchy-brightness-display +5% -bindeld = ,XF86MonBrightnessDown, Brightness down, exec, omarchy-brightness-display 5%- -bindeld = SHIFT, XF86MonBrightnessUp, Brightness maximum, exec, omarchy-brightness-display 100% -bindeld = SHIFT, XF86MonBrightnessDown, Brightness minimum, exec, omarchy-brightness-display 1% -bindeld = ,XF86KbdBrightnessUp, Keyboard brightness up, exec, omarchy-brightness-keyboard up -bindeld = ,XF86KbdBrightnessDown, Keyboard brightness down, exec, omarchy-brightness-keyboard down -bindld = ,XF86KbdLightOnOff, Keyboard backlight cycle, exec, omarchy-brightness-keyboard cycle -bindld = ,XF86TouchpadToggle, Toggle touchpad, exec, omarchy-toggle-touchpad -bindld = ,XF86TouchpadOn, Enable touchpad, exec, omarchy-toggle-touchpad on -bindld = ,XF86TouchpadOff, Disable touchpad, exec, omarchy-toggle-touchpad off - -# Precise 1% multimedia adjustments with Alt modifier -bindeld = ALT, XF86AudioRaiseVolume, Volume up precise, exec, omarchy-swayosd-client --output-volume +1 -bindeld = ALT, XF86AudioLowerVolume, Volume down precise, exec, omarchy-swayosd-client --output-volume -1 -bindeld = ALT, XF86MonBrightnessUp, Brightness up precise, exec, omarchy-brightness-display +1% -bindeld = ALT, XF86MonBrightnessDown, Brightness down precise, exec, omarchy-brightness-display 1%- - -# Requires playerctl -bindld = , XF86AudioNext, Next track, exec, omarchy-swayosd-client --playerctl next -bindld = , XF86AudioPause, Pause, exec, omarchy-swayosd-client --playerctl play-pause -bindld = , XF86AudioPlay, Play, exec, omarchy-swayosd-client --playerctl play-pause -bindld = , XF86AudioPrev, Previous track, exec, omarchy-swayosd-client --playerctl previous - -# Switch audio output with Super + Mute -bindld = SUPER, XF86AudioMute, Switch audio output, exec, omarchy-audio-output-switch diff --git a/default/hypr/bindings/media.lua b/default/hypr/bindings/media.lua new file mode 100644 index 00000000..9b6a54be --- /dev/null +++ b/default/hypr/bindings/media.lua @@ -0,0 +1,29 @@ +-- Volume, brightness, keyboard backlight, and touchpad controls. +hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("omarchy-swayosd-client --output-volume raise"), { locked = true, repeating = true, description = "Volume up" }) +hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("omarchy-swayosd-client --output-volume lower"), { locked = true, repeating = true, description = "Volume down" }) +hl.bind("XF86AudioMute", hl.dsp.exec_cmd("omarchy-swayosd-client --output-volume mute-toggle"), { locked = true, repeating = true, description = "Mute" }) +hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("omarchy-audio-input-mute"), { locked = true, repeating = true, description = "Mute microphone" }) +hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("omarchy-brightness-display +5%"), { locked = true, repeating = true, description = "Brightness up" }) +hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("omarchy-brightness-display 5%-"), { locked = true, repeating = true, description = "Brightness down" }) +hl.bind("SHIFT + XF86MonBrightnessUp", hl.dsp.exec_cmd("omarchy-brightness-display 100%"), { locked = true, repeating = true, description = "Brightness maximum" }) +hl.bind("SHIFT + XF86MonBrightnessDown", hl.dsp.exec_cmd("omarchy-brightness-display 1%"), { locked = true, repeating = true, description = "Brightness minimum" }) +hl.bind("XF86KbdBrightnessUp", hl.dsp.exec_cmd("omarchy-brightness-keyboard up"), { locked = true, repeating = true, description = "Keyboard brightness up" }) +hl.bind("XF86KbdBrightnessDown", hl.dsp.exec_cmd("omarchy-brightness-keyboard down"), { locked = true, repeating = true, description = "Keyboard brightness down" }) +hl.bind("XF86KbdLightOnOff", hl.dsp.exec_cmd("omarchy-brightness-keyboard cycle"), { locked = true, description = "Keyboard backlight cycle" }) +hl.bind("XF86TouchpadToggle", hl.dsp.exec_cmd("omarchy-toggle-touchpad"), { locked = true, description = "Toggle touchpad" }) +hl.bind("XF86TouchpadOn", hl.dsp.exec_cmd("omarchy-toggle-touchpad on"), { locked = true, description = "Enable touchpad" }) +hl.bind("XF86TouchpadOff", hl.dsp.exec_cmd("omarchy-toggle-touchpad off"), { locked = true, description = "Disable touchpad" }) + +-- Precise volume and brightness controls. +hl.bind("ALT + XF86AudioRaiseVolume", hl.dsp.exec_cmd("omarchy-swayosd-client --output-volume +1"), { locked = true, repeating = true, description = "Volume up precise" }) +hl.bind("ALT + XF86AudioLowerVolume", hl.dsp.exec_cmd("omarchy-swayosd-client --output-volume -1"), { locked = true, repeating = true, description = "Volume down precise" }) +hl.bind("ALT + XF86MonBrightnessUp", hl.dsp.exec_cmd("omarchy-brightness-display +1%"), { locked = true, repeating = true, description = "Brightness up precise" }) +hl.bind("ALT + XF86MonBrightnessDown", hl.dsp.exec_cmd("omarchy-brightness-display 1%-"), { locked = true, repeating = true, description = "Brightness down precise" }) + +-- Media controls. +hl.bind("XF86AudioNext", hl.dsp.exec_cmd("omarchy-swayosd-client --playerctl next"), { locked = true, description = "Next track" }) +hl.bind("XF86AudioPause", hl.dsp.exec_cmd("omarchy-swayosd-client --playerctl play-pause"), { locked = true, description = "Pause" }) +hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("omarchy-swayosd-client --playerctl play-pause"), { locked = true, description = "Play" }) +hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("omarchy-swayosd-client --playerctl previous"), { locked = true, description = "Previous track" }) + +hl.bind("SUPER + XF86AudioMute", hl.dsp.exec_cmd("omarchy-audio-output-switch"), { locked = true, description = "Switch audio output" }) diff --git a/default/hypr/bindings/tiling-v2.conf b/default/hypr/bindings/tiling-v2.conf deleted file mode 100644 index 5ddf7572..00000000 --- a/default/hypr/bindings/tiling-v2.conf +++ /dev/null @@ -1,143 +0,0 @@ -# Close windows -bindd = SUPER, W, Close window, killactive, -bindd = CTRL ALT, DELETE, Close all windows, exec, omarchy-hyprland-window-close-all - -# Control tiling -bindd = SUPER, J, Toggle window split, layoutmsg, togglesplit -bindd = SUPER, P, Pseudo window, pseudo, # dwindle -bindd = SUPER, T, Toggle window floating/tiling, togglefloating, -bindd = SUPER, F, Full screen, fullscreen, 0 -bindd = SUPER CTRL, F, Tiled full screen, fullscreenstate, 0 2 -bindd = SUPER ALT, F, Full width, fullscreen, 1 -bindd = SUPER, O, Pop window out (float & pin), exec, omarchy-hyprland-window-pop -bindd = SUPER, L, Toggle workspace layout, exec, omarchy-hyprland-workspace-layout-toggle - -# Move focus with SUPER + arrow keys -bindd = SUPER, LEFT, Focus on left window, movefocus, l -bindd = SUPER, RIGHT, Focus on right window, movefocus, r -bindd = SUPER, UP, Focus on above window, movefocus, u -bindd = SUPER, DOWN, Focus on below window, movefocus, d - -# Switch workspaces with SUPER + [1-9; 0] -bindd = SUPER, code:10, Switch to workspace 1, workspace, 1 -bindd = SUPER, code:11, Switch to workspace 2, workspace, 2 -bindd = SUPER, code:12, Switch to workspace 3, workspace, 3 -bindd = SUPER, code:13, Switch to workspace 4, workspace, 4 -bindd = SUPER, code:14, Switch to workspace 5, workspace, 5 -bindd = SUPER, code:15, Switch to workspace 6, workspace, 6 -bindd = SUPER, code:16, Switch to workspace 7, workspace, 7 -bindd = SUPER, code:17, Switch to workspace 8, workspace, 8 -bindd = SUPER, code:18, Switch to workspace 9, workspace, 9 -bindd = SUPER, code:19, Switch to workspace 10, workspace, 10 - -# Move active window to a workspace with SUPER + SHIFT + [1-9; 0] -bindd = SUPER SHIFT, code:10, Move window to workspace 1, movetoworkspace, 1 -bindd = SUPER SHIFT, code:11, Move window to workspace 2, movetoworkspace, 2 -bindd = SUPER SHIFT, code:12, Move window to workspace 3, movetoworkspace, 3 -bindd = SUPER SHIFT, code:13, Move window to workspace 4, movetoworkspace, 4 -bindd = SUPER SHIFT, code:14, Move window to workspace 5, movetoworkspace, 5 -bindd = SUPER SHIFT, code:15, Move window to workspace 6, movetoworkspace, 6 -bindd = SUPER SHIFT, code:16, Move window to workspace 7, movetoworkspace, 7 -bindd = SUPER SHIFT, code:17, Move window to workspace 8, movetoworkspace, 8 -bindd = SUPER SHIFT, code:18, Move window to workspace 9, movetoworkspace, 9 -bindd = SUPER SHIFT, code:19, Move window to workspace 10, movetoworkspace, 10 - -# Move active window silently to a workspace with SUPER + SHIFT + ALT + [1-9; 0] -bindd = SUPER SHIFT ALT, code:10, Move window silently to workspace 1, movetoworkspacesilent, 1 -bindd = SUPER SHIFT ALT, code:11, Move window silently to workspace 2, movetoworkspacesilent, 2 -bindd = SUPER SHIFT ALT, code:12, Move window silently to workspace 3, movetoworkspacesilent, 3 -bindd = SUPER SHIFT ALT, code:13, Move window silently to workspace 4, movetoworkspacesilent, 4 -bindd = SUPER SHIFT ALT, code:14, Move window silently to workspace 5, movetoworkspacesilent, 5 -bindd = SUPER SHIFT ALT, code:15, Move window silently to workspace 6, movetoworkspacesilent, 6 -bindd = SUPER SHIFT ALT, code:16, Move window silently to workspace 7, movetoworkspacesilent, 7 -bindd = SUPER SHIFT ALT, code:17, Move window silently to workspace 8, movetoworkspacesilent, 8 -bindd = SUPER SHIFT ALT, code:18, Move window silently to workspace 9, movetoworkspacesilent, 9 -bindd = SUPER SHIFT ALT, code:19, Move window silently to workspace 10, movetoworkspacesilent, 10 - -# Control scratchpad -bindd = SUPER, S, Toggle scratchpad, togglespecialworkspace, scratchpad -bindd = SUPER ALT, S, Move window to scratchpad, movetoworkspacesilent, special:scratchpad - -# TAB between workspaces -bindd = SUPER, TAB, Next workspace, workspace, e+1 -bindd = SUPER SHIFT, TAB, Previous workspace, workspace, e-1 -bindd = SUPER CTRL, TAB, Former workspace, workspace, previous - -# Move workspaces to other monitors -bindd = SUPER SHIFT ALT, LEFT, Move workspace to left monitor, movecurrentworkspacetomonitor, l -bindd = SUPER SHIFT ALT, RIGHT, Move workspace to right monitor, movecurrentworkspacetomonitor, r -bindd = SUPER SHIFT ALT, UP, Move workspace to up monitor, movecurrentworkspacetomonitor, u -bindd = SUPER SHIFT ALT, DOWN, Move workspace to down monitor, movecurrentworkspacetomonitor, d - -# Swap active window with the one next to it with SUPER + SHIFT + arrow keys -bindd = SUPER SHIFT, LEFT, Swap window to the left, swapwindow, l -bindd = SUPER SHIFT, RIGHT, Swap window to the right, swapwindow, r -bindd = SUPER SHIFT, UP, Swap window up, swapwindow, u -bindd = SUPER SHIFT, DOWN, Swap window down, swapwindow, d - -# Cycle through applications on active workspace -bindd = ALT, TAB, Focus on next window, cyclenext -bindd = ALT SHIFT, TAB, Focus on previous window, cyclenext, prev -bindd = ALT, TAB, Reveal active window on top, bringactivetotop -bindd = ALT SHIFT, TAB, Reveal active window on top, bringactivetotop - -# Cycle through monitors -bindd = CTRL ALT, TAB, Focus on next monitor, focusmonitor, +1 -bindd = CTRL ALT SHIFT, TAB, Focus on previous monitor, focusmonitor, -1 - -# Resize active window -bindd = SUPER, code:20, Expand window left, resizeactive, -100 0 # - key -bindd = SUPER, code:21, Shrink window left, resizeactive, 100 0 # = key -bindd = SUPER SHIFT, code:20, Shrink window up, resizeactive, 0 -100 -bindd = SUPER SHIFT, code:21, Expand window down, resizeactive, 0 100 - -bindd = SUPER ALT, code:20, Expand window left a little, resizeactive, -25 0 -bindd = SUPER ALT, code:21, Shrink window left a little, resizeactive, 25 0 -bindd = SUPER SHIFT ALT, code:20, Shrink window up a little, resizeactive, 0 -25 -bindd = SUPER SHIFT ALT, code:21, Expand window down a little, resizeactive, 0 25 - -bindd = SUPER CTRL, code:20, Expand window left a lot, resizeactive, -300 0 -bindd = SUPER CTRL, code:21, Shrink window left a lot, resizeactive, 300 0 -bindd = SUPER CTRL SHIFT, code:20, Shrink window up a lot, resizeactive, 0 -300 -bindd = SUPER CTRL SHIFT, code:21, Expand window down a lot, resizeactive, 0 300 - -# Scroll through existing workspaces with SUPER + scroll -bindd = SUPER, mouse_down, Scroll active workspace forward, workspace, e+1 -bindd = SUPER, mouse_up, Scroll active workspace backward, workspace, e-1 - -# Move/resize windows with mainMod + LMB/RMB and dragging -bindmd = SUPER, mouse:272, Move window, movewindow -bindmd = SUPER, mouse:273, Resize window, resizewindow - -# Toggle groups -bindd = SUPER, G, Toggle window grouping, togglegroup -bindd = SUPER ALT, G, Move active window out of group, moveoutofgroup - -# Join groups -bindd = SUPER ALT, LEFT, Move window to group on left, moveintogroup, l -bindd = SUPER ALT, RIGHT, Move window to group on right, moveintogroup, r -bindd = SUPER ALT, UP, Move window to group on top, moveintogroup, u -bindd = SUPER ALT, DOWN, Move window to group on bottom, moveintogroup, d - -# Navigate a single set of grouped windows -bindd = SUPER ALT, TAB, Next window in group, changegroupactive, f -bindd = SUPER ALT SHIFT, TAB, Previous window in group, changegroupactive, b - -# Window navigation for grouped windows -bindd = SUPER CTRL, LEFT, Move grouped window focus left, changegroupactive, b -bindd = SUPER CTRL, RIGHT, Move grouped window focus right, changegroupactive, f - -# Scroll through a set of grouped windows with SUPER + ALT + scroll -bindd = SUPER ALT, mouse_down, Next window in group, changegroupactive, f -bindd = SUPER ALT, mouse_up, Previous window in group, changegroupactive, b - -# Activate window in a group by number -bindd = SUPER ALT, code:10, Switch to group window 1, changegroupactive, 1 -bindd = SUPER ALT, code:11, Switch to group window 2, changegroupactive, 2 -bindd = SUPER ALT, code:12, Switch to group window 3, changegroupactive, 3 -bindd = SUPER ALT, code:13, Switch to group window 4, changegroupactive, 4 -bindd = SUPER ALT, code:14, Switch to group window 5, changegroupactive, 5 - -# Cycle monitor scaling with SUPER + / -bindd = SUPER, code:61, Cycle monitor scaling, exec, omarchy-hyprland-monitor-scaling-cycle -bindd = SUPER ALT, code:61, Cycle monitor scaling backwards, exec, omarchy-hyprland-monitor-scaling-cycle --reverse diff --git a/default/hypr/bindings/tiling-v2.lua b/default/hypr/bindings/tiling-v2.lua new file mode 100644 index 00000000..8a12b78b --- /dev/null +++ b/default/hypr/bindings/tiling-v2.lua @@ -0,0 +1,93 @@ +hl.bind("SUPER + W", hl.dsp.window.close(), { description = "Close window" }) +hl.bind("CTRL + ALT + DELETE", hl.dsp.exec_cmd("omarchy-hyprland-window-close-all"), { description = "Close all windows" }) + +hl.bind("SUPER + J", hl.dsp.layout("togglesplit"), { description = "Toggle window split" }) +hl.bind("SUPER + P", hl.dsp.window.pseudo(), { description = "Pseudo window" }) +hl.bind("SUPER + T", hl.dsp.window.float({ action = "toggle" }), { description = "Toggle window floating/tiling" }) +hl.bind("SUPER + F", hl.dsp.window.fullscreen({ mode = "fullscreen" }), { description = "Full screen" }) +hl.bind("SUPER + CTRL + F", hl.dsp.window.fullscreen_state({ internal = 0, client = 2 }), { description = "Tiled full screen" }) +hl.bind("SUPER + ALT + F", hl.dsp.window.fullscreen({ mode = "maximized" }), { description = "Full width" }) +hl.bind("SUPER + O", hl.dsp.exec_cmd("omarchy-hyprland-window-pop"), { description = "Pop window out (float & pin)" }) +hl.bind("SUPER + L", hl.dsp.exec_cmd("omarchy-hyprland-workspace-layout-toggle"), { description = "Toggle workspace layout" }) + +hl.bind("SUPER + LEFT", hl.dsp.focus({ direction = "l" }), { description = "Focus on left window" }) +hl.bind("SUPER + RIGHT", hl.dsp.focus({ direction = "r" }), { description = "Focus on right window" }) +hl.bind("SUPER + UP", hl.dsp.focus({ direction = "u" }), { description = "Focus on above window" }) +hl.bind("SUPER + DOWN", hl.dsp.focus({ direction = "d" }), { description = "Focus on below window" }) + +for workspace = 1, 10 do + local key = "code:" .. tostring(workspace + 9) + hl.bind("SUPER + " .. key, hl.dsp.focus({ workspace = tostring(workspace) }), { description = "Switch to workspace " .. workspace }) + hl.bind("SUPER + SHIFT + " .. key, hl.dsp.window.move({ workspace = tostring(workspace) }), { description = "Move window to workspace " .. workspace }) + hl.bind("SUPER + SHIFT + ALT + " .. key, hl.dsp.window.move({ workspace = tostring(workspace), follow = false }), { description = "Move window silently to workspace " .. workspace }) +end + +hl.bind("SUPER + S", hl.dsp.workspace.toggle_special("scratchpad"), { description = "Toggle scratchpad" }) +hl.bind("SUPER + ALT + S", hl.dsp.window.move({ workspace = "special:scratchpad", follow = false }), { description = "Move window to scratchpad" }) + +hl.bind("SUPER + TAB", hl.dsp.focus({ workspace = "e+1" }), { description = "Next workspace" }) +hl.bind("SUPER + SHIFT + TAB", hl.dsp.focus({ workspace = "e-1" }), { description = "Previous workspace" }) +hl.bind("SUPER + CTRL + TAB", hl.dsp.focus({ workspace = "previous" }), { description = "Former workspace" }) + +hl.bind("SUPER + SHIFT + ALT + LEFT", hl.dsp.workspace.move({ monitor = "l" }), { description = "Move workspace to left monitor" }) +hl.bind("SUPER + SHIFT + ALT + RIGHT", hl.dsp.workspace.move({ monitor = "r" }), { description = "Move workspace to right monitor" }) +hl.bind("SUPER + SHIFT + ALT + UP", hl.dsp.workspace.move({ monitor = "u" }), { description = "Move workspace to up monitor" }) +hl.bind("SUPER + SHIFT + ALT + DOWN", hl.dsp.workspace.move({ monitor = "d" }), { description = "Move workspace to down monitor" }) + +hl.bind("SUPER + SHIFT + LEFT", hl.dsp.window.swap({ direction = "l" }), { description = "Swap window to the left" }) +hl.bind("SUPER + SHIFT + RIGHT", hl.dsp.window.swap({ direction = "r" }), { description = "Swap window to the right" }) +hl.bind("SUPER + SHIFT + UP", hl.dsp.window.swap({ direction = "u" }), { description = "Swap window up" }) +hl.bind("SUPER + SHIFT + DOWN", hl.dsp.window.swap({ direction = "d" }), { description = "Swap window down" }) + +hl.bind("ALT + TAB", hl.dsp.window.cycle_next(), { description = "Focus on next window" }) +hl.bind("ALT + SHIFT + TAB", hl.dsp.window.cycle_next({ next = false }), { description = "Focus on previous window" }) +hl.bind("ALT + TAB", hl.dsp.window.bring_to_top(), { description = "Reveal active window on top" }) +hl.bind("ALT + SHIFT + TAB", hl.dsp.window.bring_to_top(), { description = "Reveal active window on top" }) + +hl.bind("CTRL + ALT + TAB", hl.dsp.focus({ monitor = "+1" }), { description = "Focus on next monitor" }) +hl.bind("CTRL + ALT + SHIFT + TAB", hl.dsp.focus({ monitor = "-1" }), { description = "Focus on previous monitor" }) + +hl.bind("SUPER + code:20", hl.dsp.window.resize({ x = -100, y = 0, relative = true }), { description = "Expand window left" }) +hl.bind("SUPER + code:21", hl.dsp.window.resize({ x = 100, y = 0, relative = true }), { description = "Shrink window left" }) +hl.bind("SUPER + SHIFT + code:20", hl.dsp.window.resize({ x = 0, y = -100, relative = true }), { description = "Shrink window up" }) +hl.bind("SUPER + SHIFT + code:21", hl.dsp.window.resize({ x = 0, y = 100, relative = true }), { description = "Expand window down" }) + +hl.bind("SUPER + ALT + code:20", hl.dsp.window.resize({ x = -25, y = 0, relative = true }), { description = "Expand window left a little" }) +hl.bind("SUPER + ALT + code:21", hl.dsp.window.resize({ x = 25, y = 0, relative = true }), { description = "Shrink window left a little" }) +hl.bind("SUPER + SHIFT + ALT + code:20", hl.dsp.window.resize({ x = 0, y = -25, relative = true }), { description = "Shrink window up a little" }) +hl.bind("SUPER + SHIFT + ALT + code:21", hl.dsp.window.resize({ x = 0, y = 25, relative = true }), { description = "Expand window down a little" }) + +hl.bind("SUPER + CTRL + code:20", hl.dsp.window.resize({ x = -300, y = 0, relative = true }), { description = "Expand window left a lot" }) +hl.bind("SUPER + CTRL + code:21", hl.dsp.window.resize({ x = 300, y = 0, relative = true }), { description = "Shrink window left a lot" }) +hl.bind("SUPER + CTRL + SHIFT + code:20", hl.dsp.window.resize({ x = 0, y = -300, relative = true }), { description = "Shrink window up a lot" }) +hl.bind("SUPER + CTRL + SHIFT + code:21", hl.dsp.window.resize({ x = 0, y = 300, relative = true }), { description = "Expand window down a lot" }) + +hl.bind("SUPER + mouse_down", hl.dsp.focus({ workspace = "e+1" }), { description = "Scroll active workspace forward" }) +hl.bind("SUPER + mouse_up", hl.dsp.focus({ workspace = "e-1" }), { description = "Scroll active workspace backward" }) + +hl.bind("SUPER + mouse:272", hl.dsp.window.drag(), { mouse = true, description = "Move window" }) +hl.bind("SUPER + mouse:273", hl.dsp.window.resize(), { mouse = true, description = "Resize window" }) + +hl.bind("SUPER + G", hl.dsp.group.toggle(), { description = "Toggle window grouping" }) +hl.bind("SUPER + ALT + G", hl.dsp.window.move({ out_of_group = true }), { description = "Move active window out of group" }) + +hl.bind("SUPER + ALT + LEFT", hl.dsp.window.move({ into_group = "l" }), { description = "Move window to group on left" }) +hl.bind("SUPER + ALT + RIGHT", hl.dsp.window.move({ into_group = "r" }), { description = "Move window to group on right" }) +hl.bind("SUPER + ALT + UP", hl.dsp.window.move({ into_group = "u" }), { description = "Move window to group on top" }) +hl.bind("SUPER + ALT + DOWN", hl.dsp.window.move({ into_group = "d" }), { description = "Move window to group on bottom" }) + +hl.bind("SUPER + ALT + TAB", hl.dsp.group.next(), { description = "Next window in group" }) +hl.bind("SUPER + ALT + SHIFT + TAB", hl.dsp.group.prev(), { description = "Previous window in group" }) + +hl.bind("SUPER + CTRL + LEFT", hl.dsp.group.prev(), { description = "Move grouped window focus left" }) +hl.bind("SUPER + CTRL + RIGHT", hl.dsp.group.next(), { description = "Move grouped window focus right" }) + +hl.bind("SUPER + ALT + mouse_down", hl.dsp.group.next(), { description = "Next window in group" }) +hl.bind("SUPER + ALT + mouse_up", hl.dsp.group.prev(), { description = "Previous window in group" }) + +for index = 1, 5 do + hl.bind("SUPER + ALT + code:" .. tostring(index + 9), hl.dsp.group.active({ index = index }), { description = "Switch to group window " .. index }) +end + +hl.bind("SUPER + code:61", hl.dsp.exec_cmd("omarchy-hyprland-monitor-scaling-cycle"), { description = "Cycle monitor scaling" }) +hl.bind("SUPER + ALT + code:61", hl.dsp.exec_cmd("omarchy-hyprland-monitor-scaling-cycle --reverse"), { description = "Cycle monitor scaling backwards" }) diff --git a/default/hypr/bindings/tiling.conf b/default/hypr/bindings/tiling.conf deleted file mode 100644 index b1dc65cc..00000000 --- a/default/hypr/bindings/tiling.conf +++ /dev/null @@ -1,74 +0,0 @@ -# This is now a deprecated file meant for those who did not wish to learn the latest Omarchy hotkeys. -# Do not make changes here, but bring them to tiling-v2.conf instead. - -# Close windows -bindd = SUPER, W, Close window, killactive, -bindd = CTRL ALT, DELETE, Close all windows, exec, omarchy-hyprland-window-close-all - -# Control tiling -bindd = SUPER, J, Toggle window split, togglesplit, # dwindle -bindd = SUPER, P, Pseudo window, pseudo, # dwindle -bindd = SUPER SHIFT, V, Toggle window floating/tiling, togglefloating, -bindd = SHIFT, F11, Force full screen, fullscreen, 0 -bindd = ALT, F11, Full width, fullscreen, 1 - -# Move focus with SUPER + arrow keys -bindd = SUPER, LEFT, Move focus left, movefocus, l -bindd = SUPER, RIGHT, Move focus right, movefocus, r -bindd = SUPER, UP, Move focus up, movefocus, u -bindd = SUPER, DOWN, Move focus down, movefocus, d - -# Switch workspaces with SUPER + [0-9] -bindd = SUPER, code:10, Switch to workspace 1, workspace, 1 -bindd = SUPER, code:11, Switch to workspace 2, workspace, 2 -bindd = SUPER, code:12, Switch to workspace 3, workspace, 3 -bindd = SUPER, code:13, Switch to workspace 4, workspace, 4 -bindd = SUPER, code:14, Switch to workspace 5, workspace, 5 -bindd = SUPER, code:15, Switch to workspace 6, workspace, 6 -bindd = SUPER, code:16, Switch to workspace 7, workspace, 7 -bindd = SUPER, code:17, Switch to workspace 8, workspace, 8 -bindd = SUPER, code:18, Switch to workspace 9, workspace, 9 -bindd = SUPER, code:19, Switch to workspace 10, workspace, 10 - -# Move active window to a workspace with SUPER + SHIFT + [0-9] -bindd = SUPER SHIFT, code:10, Move window to workspace 1, movetoworkspace, 1 -bindd = SUPER SHIFT, code:11, Move window to workspace 2, movetoworkspace, 2 -bindd = SUPER SHIFT, code:12, Move window to workspace 3, movetoworkspace, 3 -bindd = SUPER SHIFT, code:13, Move window to workspace 4, movetoworkspace, 4 -bindd = SUPER SHIFT, code:14, Move window to workspace 5, movetoworkspace, 5 -bindd = SUPER SHIFT, code:15, Move window to workspace 6, movetoworkspace, 6 -bindd = SUPER SHIFT, code:16, Move window to workspace 7, movetoworkspace, 7 -bindd = SUPER SHIFT, code:17, Move window to workspace 8, movetoworkspace, 8 -bindd = SUPER SHIFT, code:18, Move window to workspace 9, movetoworkspace, 9 -bindd = SUPER SHIFT, code:19, Move window to workspace 10, movetoworkspace, 10 - -# TAB between workspaces -bindd = SUPER, TAB, Next workspace, workspace, e+1 -bindd = SUPER SHIFT, TAB, Previous workspace, workspace, e-1 -bindd = SUPER CTRL, TAB, Former workspace, workspace, previous - -# Swap active window with the one next to it with SUPER + SHIFT + arrow keys -bindd = SUPER SHIFT, LEFT, Swap window to the left, swapwindow, l -bindd = SUPER SHIFT, RIGHT, Swap window to the right, swapwindow, r -bindd = SUPER SHIFT, UP, Swap window up, swapwindow, u -bindd = SUPER SHIFT, DOWN, Swap window down, swapwindow, d - -# Cycle through applications on active workspace -bindd = ALT, TAB, Cycle to next window, cyclenext -bindd = ALT SHIFT, TAB, Cycle to prev window, cyclenext, prev -bindd = ALT, TAB, Reveal active window on top, bringactivetotop -bindd = ALT SHIFT, TAB, Reveal active window on top, bringactivetotop - -# Resize active window -bindd = SUPER, code:20, Expand window left, resizeactive, -100 0 # - key -bindd = SUPER, code:21, Shrink window left, resizeactive, 100 0 # = key -bindd = SUPER SHIFT, code:20, Shrink window up, resizeactive, 0 -100 -bindd = SUPER SHIFT, code:21, Expand window down, resizeactive, 0 100 - -# Scroll through existing workspaces with SUPER + scroll -bindd = SUPER, MOUSE_DOWN, Scroll active workspace forward, workspace, e+1 -bindd = SUPER, MOUSE_UP, Scroll active workspace backward, workspace, e-1 - -# Move/resize windows with mainMod + LMB/RMB and dragging -bindmd = SUPER, mouse:272, Move window, movewindow -bindmd = SUPER, mouse:273, Resize window, resizewindow diff --git a/default/hypr/bindings/utilities.conf b/default/hypr/bindings/utilities.conf deleted file mode 100644 index dffc2dbe..00000000 --- a/default/hypr/bindings/utilities.conf +++ /dev/null @@ -1,80 +0,0 @@ -# Menus -bindd = SUPER, SPACE, Launch apps, exec, omarchy-launch-walker -bindd = SUPER CTRL, E, Emoji picker, exec, omarchy-launch-walker -m symbols -bindd = SUPER CTRL, C, Capture menu, exec, omarchy-menu capture -bindd = SUPER CTRL, O, Toggle menu, exec, omarchy-menu toggle -bindd = SUPER CTRL, H, Hardware menu, exec, omarchy-menu hardware -bindd = SUPER ALT, SPACE, Omarchy menu, exec, omarchy-menu -bindd = SUPER SHIFT, code:201, Omarchy menu, exec, omarchy-menu -bindd = SUPER, ESCAPE, System menu, exec, omarchy-menu system -bindld = , XF86PowerOff, Power menu, exec, omarchy-menu system -bindd = SUPER, K, Show key bindings, exec, omarchy-menu-keybindings -bindd = , XF86Calculator, Calculator, exec, gnome-calculator - -# Aesthetics -bindd = SUPER SHIFT, SPACE, Toggle top bar, exec, omarchy-toggle-waybar -bindd = SUPER SHIFT CTRL, UP, Move Waybar to top, exec, omarchy-style-waybar-position top -bindd = SUPER SHIFT CTRL, DOWN, Move Waybar to bottom, exec, omarchy-style-waybar-position bottom -bindd = SUPER SHIFT CTRL, LEFT, Move Waybar to left, exec, omarchy-style-waybar-position left -bindd = SUPER SHIFT CTRL, RIGHT, Move Waybar to right, exec, omarchy-style-waybar-position right -bindd = SUPER CTRL, SPACE, Theme background menu, exec, omarchy-menu background -bindd = SUPER SHIFT CTRL, SPACE, Theme menu, exec, omarchy-menu theme -bindd = SUPER, BACKSPACE, Toggle window transparency, exec, omarchy-hyprland-window-transparency-toggle -bindd = SUPER SHIFT, BACKSPACE, Toggle window gaps, exec, omarchy-hyprland-window-gaps-toggle -bindd = SUPER CTRL, BACKSPACE, Toggle single-window square aspect, exec, omarchy-hyprland-window-single-square-aspect-toggle - -# Notifications -bindd = SUPER, COMMA, Dismiss last notification, exec, makoctl dismiss -bindd = SUPER SHIFT, COMMA, Dismiss all notifications, exec, makoctl dismiss --all -bindd = SUPER CTRL, COMMA, Toggle silencing notifications, exec, omarchy-toggle-notification-silencing -bindd = SUPER ALT, COMMA, Invoke last notification, exec, makoctl invoke -bindd = SUPER SHIFT ALT, COMMA, Restore last notification, exec, makoctl restore - -# Toggles -bindd = SUPER CTRL, I, Toggle locking on idle, exec, omarchy-toggle-idle -bindd = SUPER CTRL, N, Toggle nightlight, exec, omarchy-toggle-nightlight -bindd = SUPER CTRL, Delete, Toggle laptop display, exec, omarchy-hyprland-monitor-internal toggle -bindd = SUPER CTRL ALT, Delete, Toggle laptop display mirroring, exec, omarchy-hyprland-monitor-internal-mirror toggle -bindl = , switch:on:Lid Switch, exec, omarchy-hw-external-monitors && omarchy-hyprland-monitor-internal off -bindl = , switch:off:Lid Switch, exec, omarchy-hyprland-monitor-internal on - -# Captures -bindd = , PRINT, Screenshot, exec, omarchy-capture-screenshot -bindd = ALT, PRINT, Screenrecording, exec, omarchy-menu screenrecord -bindd = SUPER, PRINT, Color picker, exec, pkill hyprpicker || hyprpicker -a -bindd = SUPER CTRL, PRINT, Extract text (OCR) from screenshot, exec, omarchy-capture-text-extraction - -# File sharing -bindd = SUPER CTRL, S, Share, exec, omarchy-menu share - -# Transcoding -bindd = SUPER CTRL, PERIOD, Transcode, exec, omarchy-transcode - -# Reminders -bindd = SUPER CTRL, R, Set reminder, exec, omarchy-menu reminder-set -bindd = SUPER CTRL ALT, R, Show reminders, exec, omarchy-reminder show -bindd = SUPER SHIFT CTRL, R, Clear reminders, exec, omarchy-reminder clear - -# Waybar-less information -bindd = SUPER CTRL ALT, T, Show time, exec, notify-send -u low " $(date +"%A %H:%M · %d %B %Y · Week %V")" -bindd = SUPER CTRL ALT, B, Show battery remaining, exec, notify-send -u low "$(omarchy-battery-status)" -bindd = SUPER CTRL ALT, W, Show weather, exec, notify-send -u low "$(omarchy-weather-status)" - -# Control panels -bindd = SUPER CTRL, A, Audio controls, exec, omarchy-launch-audio -bindd = SUPER CTRL, B, Bluetooth controls, exec, omarchy-launch-bluetooth -bindd = SUPER CTRL, W, Wifi controls, exec, omarchy-launch-wifi -bindd = SUPER CTRL, T, Activity, exec, omarchy-launch-tui btop - -# Dictation -bindd = SUPER CTRL, X, Toggle dictation, exec, voxtype record toggle - -bindd = , F9, Start dictation (push-to-talk), exec, voxtype record start -binddr = , F9, Stop dictation (push-to-talk), exec, voxtype record stop - -# Zoom -bindd = SUPER CTRL, Z, Zoom in, exec, hyprctl keyword cursor:zoom_factor $(hyprctl getoption cursor:zoom_factor -j | jq '.float + 1') -bindd = SUPER CTRL ALT, Z, Reset zoom, exec, hyprctl keyword cursor:zoom_factor 1 - -# Lock system -bindd = SUPER CTRL, L, Lock system, exec, omarchy-system-lock diff --git a/default/hypr/bindings/utilities.lua b/default/hypr/bindings/utilities.lua new file mode 100644 index 00000000..dc9f0824 --- /dev/null +++ b/default/hypr/bindings/utilities.lua @@ -0,0 +1,72 @@ +hl.bind("SUPER + SPACE", hl.dsp.exec_cmd("omarchy-launch-walker"), { description = "Launch apps" }) +hl.bind("SUPER + CTRL + E", hl.dsp.exec_cmd("omarchy-launch-walker -m symbols"), { description = "Emoji picker" }) +hl.bind("SUPER + CTRL + C", hl.dsp.exec_cmd("omarchy-menu capture"), { description = "Capture menu" }) +hl.bind("SUPER + CTRL + O", hl.dsp.exec_cmd("omarchy-menu toggle"), { description = "Toggle menu" }) +hl.bind("SUPER + CTRL + H", hl.dsp.exec_cmd("omarchy-menu hardware"), { description = "Hardware menu" }) +hl.bind("SUPER + ALT + SPACE", hl.dsp.exec_cmd("omarchy-menu"), { description = "Omarchy menu" }) +hl.bind("SUPER + SHIFT + code:201", hl.dsp.exec_cmd("omarchy-menu"), { description = "Omarchy menu" }) +hl.bind("SUPER + ESCAPE", hl.dsp.exec_cmd("omarchy-menu system"), { description = "System menu" }) +hl.bind("XF86PowerOff", hl.dsp.exec_cmd("omarchy-menu system"), { locked = true, description = "Power menu" }) +hl.bind("SUPER + K", hl.dsp.exec_cmd("omarchy-menu-keybindings"), { description = "Show key bindings" }) +hl.bind("XF86Calculator", hl.dsp.exec_cmd("gnome-calculator"), { description = "Calculator" }) + +hl.bind("SUPER + SHIFT + SPACE", hl.dsp.exec_cmd("omarchy-toggle-waybar"), { description = "Toggle top bar" }) +hl.bind("SUPER + SHIFT + CTRL + UP", hl.dsp.exec_cmd("omarchy-style-waybar-position top"), { description = "Move Waybar to top" }) +hl.bind("SUPER + SHIFT + CTRL + DOWN", hl.dsp.exec_cmd("omarchy-style-waybar-position bottom"), { description = "Move Waybar to bottom" }) +hl.bind("SUPER + SHIFT + CTRL + LEFT", hl.dsp.exec_cmd("omarchy-style-waybar-position left"), { description = "Move Waybar to left" }) +hl.bind("SUPER + SHIFT + CTRL + RIGHT", hl.dsp.exec_cmd("omarchy-style-waybar-position right"), { description = "Move Waybar to right" }) +hl.bind("SUPER + CTRL + SPACE", hl.dsp.exec_cmd("omarchy-menu background"), { description = "Theme background menu" }) +hl.bind("SUPER + SHIFT + CTRL + SPACE", hl.dsp.exec_cmd("omarchy-menu theme"), { description = "Theme menu" }) +hl.bind("SUPER + BACKSPACE", hl.dsp.exec_cmd("omarchy-hyprland-window-transparency-toggle"), { description = "Toggle window transparency" }) +hl.bind("SUPER + SHIFT + BACKSPACE", hl.dsp.exec_cmd("omarchy-hyprland-window-gaps-toggle"), { description = "Toggle window gaps" }) +hl.bind("SUPER + CTRL + BACKSPACE", hl.dsp.exec_cmd("omarchy-hyprland-window-single-square-aspect-toggle"), { description = "Toggle single-window square aspect" }) + +hl.bind("SUPER + COMMA", hl.dsp.exec_cmd("makoctl dismiss"), { description = "Dismiss last notification" }) +hl.bind("SUPER + SHIFT + COMMA", hl.dsp.exec_cmd("makoctl dismiss --all"), { description = "Dismiss all notifications" }) +hl.bind("SUPER + CTRL + COMMA", hl.dsp.exec_cmd("omarchy-toggle-notification-silencing"), { description = "Toggle silencing notifications" }) +hl.bind("SUPER + ALT + COMMA", hl.dsp.exec_cmd("makoctl invoke"), { description = "Invoke last notification" }) +hl.bind("SUPER + SHIFT + ALT + COMMA", hl.dsp.exec_cmd("makoctl restore"), { description = "Restore last notification" }) + +hl.bind("SUPER + CTRL + I", hl.dsp.exec_cmd("omarchy-toggle-idle"), { description = "Toggle locking on idle" }) +hl.bind("SUPER + CTRL + N", hl.dsp.exec_cmd("omarchy-toggle-nightlight"), { description = "Toggle nightlight" }) +hl.bind("SUPER + CTRL + Delete", hl.dsp.exec_cmd("omarchy-hyprland-monitor-internal toggle"), { description = "Toggle laptop display" }) +hl.bind("SUPER + CTRL + ALT + Delete", hl.dsp.exec_cmd("omarchy-hyprland-monitor-internal-mirror toggle"), { description = "Toggle laptop display mirroring" }) +hl.bind("switch:on:Lid Switch", hl.dsp.exec_cmd("omarchy-hw-external-monitors && omarchy-hyprland-monitor-internal off"), { locked = true }) +hl.bind("switch:off:Lid Switch", hl.dsp.exec_cmd("omarchy-hyprland-monitor-internal on"), { locked = true }) + +hl.bind("PRINT", hl.dsp.exec_cmd("omarchy-capture-screenshot"), { description = "Screenshot" }) +hl.bind("ALT + PRINT", hl.dsp.exec_cmd("omarchy-menu screenrecord"), { description = "Screenrecording" }) +hl.bind("SUPER + PRINT", hl.dsp.exec_cmd("pkill hyprpicker || hyprpicker -a"), { description = "Color picker" }) +hl.bind("SUPER + CTRL + PRINT", hl.dsp.exec_cmd("omarchy-capture-text-extraction"), { description = "Extract text (OCR) from screenshot" }) + +hl.bind("SUPER + CTRL + S", hl.dsp.exec_cmd("omarchy-menu share"), { description = "Share" }) + +hl.bind("SUPER + CTRL + PERIOD", hl.dsp.exec_cmd("omarchy-transcode"), { description = "Transcode" }) + +hl.bind("SUPER + CTRL + R", hl.dsp.exec_cmd("omarchy-menu reminder-set"), { description = "Set reminder" }) +hl.bind("SUPER + CTRL + ALT + R", hl.dsp.exec_cmd("omarchy-reminder show"), { description = "Show reminders" }) +hl.bind("SUPER + SHIFT + CTRL + R", hl.dsp.exec_cmd("omarchy-reminder clear"), { description = "Clear reminders" }) + +hl.bind("SUPER + CTRL + ALT + T", hl.dsp.exec_cmd([[notify-send -u low " $(date +"%A %H:%M · %d %B %Y · Week %V")"]]), { description = "Show time" }) +hl.bind("SUPER + CTRL + ALT + B", hl.dsp.exec_cmd([[notify-send -u low "$(omarchy-battery-status)"]]), { description = "Show battery remaining" }) +hl.bind("SUPER + CTRL + ALT + W", hl.dsp.exec_cmd([[notify-send -u low "$(omarchy-weather-status)"]]), { description = "Show weather" }) + +hl.bind("SUPER + CTRL + A", hl.dsp.exec_cmd("omarchy-launch-audio"), { description = "Audio controls" }) +hl.bind("SUPER + CTRL + B", hl.dsp.exec_cmd("omarchy-launch-bluetooth"), { description = "Bluetooth controls" }) +hl.bind("SUPER + CTRL + W", hl.dsp.exec_cmd("omarchy-launch-wifi"), { description = "Wifi controls" }) +hl.bind("SUPER + CTRL + T", hl.dsp.exec_cmd("omarchy-launch-tui btop"), { description = "Activity" }) + +hl.bind("SUPER + CTRL + X", hl.dsp.exec_cmd("voxtype record toggle"), { description = "Toggle dictation" }) +hl.bind("F9", hl.dsp.exec_cmd("voxtype record start"), { description = "Start dictation (push-to-talk)" }) +hl.bind("F9", hl.dsp.exec_cmd("voxtype record stop"), { release = true, description = "Stop dictation (push-to-talk)" }) + +hl.bind("SUPER + CTRL + Z", function() + local zoom = hl.get_config("cursor.zoom_factor") or 1 + hl.config({ cursor = { zoom_factor = zoom + 1 } }) +end, { description = "Zoom in" }) + +hl.bind("SUPER + CTRL + ALT + Z", function() + hl.config({ cursor = { zoom_factor = 1 } }) +end, { description = "Reset zoom" }) + +hl.bind("SUPER + CTRL + L", hl.dsp.exec_cmd("omarchy-system-lock"), { description = "Lock system" }) diff --git a/default/hypr/envs.conf b/default/hypr/envs.conf deleted file mode 100644 index 9210f594..00000000 --- a/default/hypr/envs.conf +++ /dev/null @@ -1,33 +0,0 @@ -# GUM environment variables for styling purposes -# hyprlang noerror true -source = ~/.config/omarchy/current/theme/gum.env.conf -# hyprlang noerror false - -# Cursor size -env = XCURSOR_SIZE,24 -env = HYPRCURSOR_SIZE,24 - -# Force all apps to use Wayland -env = GDK_BACKEND,wayland,x11,* -env = QT_QPA_PLATFORM,wayland;xcb -env = QT_STYLE_OVERRIDE,kvantum -env = MOZ_ENABLE_WAYLAND,1 -env = ELECTRON_OZONE_PLATFORM_HINT,wayland -env = OZONE_PLATFORM,wayland -env = XDG_SESSION_TYPE,wayland - -# Allow better support for screen sharing (Google Meet, Discord, etc) -env = XDG_CURRENT_DESKTOP,Hyprland -env = XDG_SESSION_DESKTOP,Hyprland - -xwayland { - force_zero_scaling = true -} - -# Use XCompose file -env = XCOMPOSEFILE,~/.XCompose - -# Don't show update on first launch -ecosystem { - no_update_news = true -} diff --git a/default/hypr/envs.lua b/default/hypr/envs.lua new file mode 100644 index 00000000..365cb0e0 --- /dev/null +++ b/default/hypr/envs.lua @@ -0,0 +1,42 @@ +local paths = require("default.hypr.paths") + +local function require_file_if_exists(path, module) + local file = io.open(path, "r") + if file then + file:close() + require(module) + end +end + +-- GUM environment variables for styling purposes. +require_file_if_exists(paths.config_home .. "/omarchy/current/theme/gum_env.lua", "omarchy.current.theme.gum_env") + +-- Cursor size. +hl.env("XCURSOR_SIZE", "24") +hl.env("HYPRCURSOR_SIZE", "24") + +-- Force all apps to use Wayland. +hl.env("GDK_BACKEND", "wayland,x11,*") +hl.env("QT_QPA_PLATFORM", "wayland;xcb") +hl.env("QT_STYLE_OVERRIDE", "kvantum") +hl.env("MOZ_ENABLE_WAYLAND", "1") +hl.env("ELECTRON_OZONE_PLATFORM_HINT", "wayland") +hl.env("OZONE_PLATFORM", "wayland") +hl.env("XDG_SESSION_TYPE", "wayland") + +-- Allow better support for screen sharing (Google Meet, Discord, etc). +hl.env("XDG_CURRENT_DESKTOP", "Hyprland") +hl.env("XDG_SESSION_DESKTOP", "Hyprland") + +-- Use XCompose file. +hl.env("XCOMPOSEFILE", paths.home .. "/.XCompose") + +hl.config({ + xwayland = { + force_zero_scaling = true, + }, + + ecosystem = { + no_update_news = true, + }, +}) diff --git a/default/hypr/input.conf b/default/hypr/input.conf deleted file mode 100644 index 14e9ccb6..00000000 --- a/default/hypr/input.conf +++ /dev/null @@ -1,21 +0,0 @@ -# https://wiki.hypr.land/Configuring/Basics/Variables/#input -input { - kb_layout = us - kb_variant = - kb_model = - kb_options = compose:caps - kb_rules = - - follow_mouse = 1 - - sensitivity = 0 # -1.0 - 1.0, 0 means no modification. - - touchpad { - natural_scroll = false - } -} - -misc { - key_press_enables_dpms = true # key press will trigger wake - mouse_move_enables_dpms = true # mouse move will trigger wake -} diff --git a/default/hypr/input.lua b/default/hypr/input.lua new file mode 100644 index 00000000..1f003936 --- /dev/null +++ b/default/hypr/input.lua @@ -0,0 +1,21 @@ +-- https://wiki.hypr.land/Configuring/Basics/Variables/#input +hl.config({ + input = { + kb_layout = "us", + kb_variant = "", + kb_model = "", + kb_options = "compose:caps", + kb_rules = "", + follow_mouse = 1, + sensitivity = 0, + + touchpad = { + natural_scroll = false, + }, + }, + + misc = { + key_press_enables_dpms = true, + mouse_move_enables_dpms = true, + }, +}) diff --git a/default/hypr/looknfeel.conf b/default/hypr/looknfeel.conf deleted file mode 100644 index 1a6a8d97..00000000 --- a/default/hypr/looknfeel.conf +++ /dev/null @@ -1,144 +0,0 @@ -# Refer to https://wiki.hypr.land/Configuring/Basics/Variables/ - -# Variables -$activeBorderColor = rgba(33ccffee) rgba(00ff99ee) 45deg -$inactiveBorderColor = rgba(595959aa) - -# https://wiki.hypr.land/Configuring/Basics/Variables/#general -general { - gaps_in = 5 - gaps_out = 10 - - border_size = 2 - - # https://wiki.hypr.land/Configuring/Basics/Variables/#variable-types for info about colors - col.active_border = $activeBorderColor - col.inactive_border = $inactiveBorderColor - - # Set to true 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 -} - -# https://wiki.hypr.land/Configuring/Basics/Variables/#decoration -decoration { - rounding = 0 - - shadow { - enabled = true - range = 2 - render_power = 3 - color = rgba(1a1a1aee) - } - - # https://wiki.hypr.land/Configuring/Basics/Variables/#blur - blur { - enabled = true - size = 2 - passes = 2 - special = true - brightness = 0.60 - contrast = 0.75 - } -} - -# https://wiki.hypr.land/Configuring/Basics/Variables/#group -group { - col.border_active = $activeBorderColor - col.border_inactive = $inactiveBorderColor - col.border_locked_active = -1 - col.border_locked_inactive = -1 - - groupbar { - font_size = 12 - font_family = monospace - font_weight_active = ultraheavy - font_weight_inactive = normal - - indicator_height = 0 - indicator_gap = 5 - height = 22 - gaps_in = 5 - gaps_out = 0 - - text_color = rgb(ffffff) - text_color_inactive = rgba(ffffff90) - col.active = rgba(00000040) - col.inactive = rgba(00000020) - - gradients = true - gradient_rounding = 0 - gradient_round_only_edges = false - } -} - - -# https://wiki.hypr.land/Configuring/Basics/Variables/#animations -animations { - enabled = yes, please :) - - # Default animations, see https://wiki.hypr.land/Configuring/Advanced-and-Cool/Animations/ for more - - bezier = easeOutQuint,0.23,1,0.32,1 - bezier = easeInOutCubic,0.65,0.05,0.36,1 - bezier = linear,0,0,1,1 - bezier = almostLinear,0.5,0.5,0.75,1.0 - bezier = quick,0.15,0,0.1,1 - - animation = global, 1, 10, default - animation = border, 1, 5.39, easeOutQuint - animation = windows, 1, 3.79, easeOutQuint - animation = windowsIn, 1, 4.1, easeOutQuint, popin 87% - animation = windowsOut, 1, 1.49, linear, popin 87% - animation = fadeIn, 1, 1.73, almostLinear - animation = fadeOut, 1, 1.46, almostLinear - animation = fade, 1, 3.03, quick - animation = layers, 1, 3.81, easeOutQuint - animation = layersIn, 1, 4, easeOutQuint, fade - animation = layersOut, 1, 1.5, linear, fade - animation = fadeLayersIn, 1, 1.79, almostLinear - animation = fadeLayersOut, 1, 1.39, almostLinear - animation = workspaces, 0, 0, ease - animation = specialWorkspace, 1, 3, easeOutQuint, slidevert -} - -# See https://wiki.hypr.land/Configuring/Layouts/Dwindle-Layout/ for more -dwindle { - pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below - preserve_split = true # You probably want this - force_split = 2 # Always split on the right -} - -scrolling { - column_width = 0.49 -} - -# See https://wiki.hypr.land/Configuring/Layouts/Master-Layout/ for more -master { - new_status = master -} - -# https://wiki.hypr.land/Configuring/Basics/Variables/#misc -misc { - disable_hyprland_logo = true - disable_splash_rendering = true - disable_scale_notification = true - focus_on_activate = true - anr_missed_pings = 3 - on_focus_under_fullscreen = 1 -} - -# https://wiki.hypr.land/Configuring/Basics/Variables/#cursor -cursor { - hide_on_key_press = true - warp_on_change_workspace = 1 -} - -# Auto toggle scratchpad on switching workspace from scratchpad -binds { - hide_special_on_workspace_change = true -} diff --git a/default/hypr/looknfeel.lua b/default/hypr/looknfeel.lua new file mode 100644 index 00000000..9339ad82 --- /dev/null +++ b/default/hypr/looknfeel.lua @@ -0,0 +1,129 @@ +-- Refer to https://wiki.hypr.land/Configuring/Basics/Variables/ + +local active_border_color = { colors = { "rgba(33ccffee)", "rgba(00ff99ee)" }, angle = 45 } +local inactive_border_color = "rgba(595959aa)" + +hl.config({ + general = { + gaps_in = 5, + gaps_out = 10, + border_size = 2, + + col = { + active_border = active_border_color, + inactive_border = inactive_border_color, + }, + + resize_on_border = false, + allow_tearing = false, + layout = "dwindle", + }, + + decoration = { + rounding = 0, + + shadow = { + enabled = true, + range = 2, + render_power = 3, + color = "rgba(1a1a1aee)", + }, + + blur = { + enabled = true, + size = 2, + passes = 2, + special = true, + brightness = 0.60, + contrast = 0.75, + }, + }, + + group = { + col = { + border_active = active_border_color, + border_inactive = inactive_border_color, + }, + + groupbar = { + font_size = 12, + font_family = "monospace", + font_weight_active = "ultraheavy", + font_weight_inactive = "normal", + indicator_height = 0, + indicator_gap = 5, + height = 22, + gaps_in = 5, + gaps_out = 0, + text_color = "rgb(ffffff)", + text_color_inactive = "rgba(ffffff90)", + col = { + active = "rgba(00000040)", + inactive = "rgba(00000020)", + }, + gradients = true, + gradient_rounding = 0, + gradient_round_only_edges = false, + }, + }, + + animations = { + enabled = true, + }, +}) + +-- Default 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.0 } } }) +hl.curve("quick", { type = "bezier", points = { { 0.15, 0 }, { 0.1, 1 } } }) + +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 = 3.79, bezier = "easeOutQuint" }) +hl.animation({ leaf = "windowsIn", enabled = true, speed = 4.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 = "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 = false }) +hl.animation({ leaf = "specialWorkspace", enabled = true, speed = 3, bezier = "easeOutQuint", style = "slidevert" }) + +hl.config({ + dwindle = { + preserve_split = true, + force_split = 2, + }, + + scrolling = { + column_width = 0.49, + }, + + master = { + new_status = "master", + }, + + misc = { + disable_hyprland_logo = true, + disable_splash_rendering = true, + disable_scale_notification = true, + focus_on_activate = true, + anr_missed_pings = 3, + on_focus_under_fullscreen = 1, + }, + + cursor = { + hide_on_key_press = true, + warp_on_change_workspace = 1, + }, + + binds = { + hide_special_on_workspace_change = true, + }, +}) diff --git a/default/hypr/paths.lua b/default/hypr/paths.lua new file mode 100644 index 00000000..4671cf64 --- /dev/null +++ b/default/hypr/paths.lua @@ -0,0 +1,12 @@ +-- Shared path constants for Omarchy's Hyprland Lua modules. +-- Lua files loaded with require() have separate local scopes, so modules that +-- need these paths import this table instead of repeating os.getenv() lookups. + +local home = os.getenv("HOME") or "" + +return { + home = home, + config_home = os.getenv("XDG_CONFIG_HOME") or (home .. "/.config"), + state_home = os.getenv("XDG_STATE_HOME") or (home .. "/.local/state"), + omarchy_path = os.getenv("OMARCHY_PATH") or (home .. "/.local/share/omarchy"), +} diff --git a/default/hypr/plain-bindings.conf b/default/hypr/plain-bindings.conf deleted file mode 100644 index 81a47062..00000000 --- a/default/hypr/plain-bindings.conf +++ /dev/null @@ -1,16 +0,0 @@ -# Application bindings -bindd = SUPER, RETURN, Terminal, exec, uwsm-app -- xdg-terminal-exec --dir="$(omarchy-cmd-terminal-cwd)" -bindd = SUPER SHIFT, RETURN, Browser, exec, omarchy-launch-browser -bindd = SUPER SHIFT, F, File manager, exec, uwsm-app -- nautilus --new-window -bindd = SUPER ALT SHIFT, F, File manager (cwd), exec, uwsm-app -- nautilus --new-window "$(omarchy-cmd-terminal-cwd)" -bindd = SUPER SHIFT, B, Browser, exec, omarchy-launch-browser -bindd = SUPER SHIFT ALT, B, Browser (private), exec, omarchy-launch-browser --private -bindd = SUPER SHIFT, N, Editor, exec, omarchy-launch-editor - -# Add extra bindings -# bindd = SUPER SHIFT, A, ChatGPT, exec, omarchy-launch-webapp "https://chatgpt.com" -# bindd = SUPER SHIFT, R, exec, alacritty -e ssh your-server - -# Overwrite existing bindings, like putting Omarchy Menu on Super + Space -# unbind = SUPER, SPACE -# bindd = SUPER, SPACE, Omarchy menu, exec, omarchy-menu diff --git a/default/hypr/plain-bindings.lua b/default/hypr/plain-bindings.lua new file mode 100644 index 00000000..8656d6d7 --- /dev/null +++ b/default/hypr/plain-bindings.lua @@ -0,0 +1,13 @@ +require("default.hypr.bindings.media") +require("default.hypr.bindings.clipboard") +require("default.hypr.bindings.tiling-v2") +require("default.hypr.bindings.utilities") + +-- Application bindings without Omarchy's preinstalled web apps, TUIs, or desktop apps. +hl.bind("SUPER + RETURN", hl.dsp.exec_cmd([[uwsm-app -- xdg-terminal-exec --dir="$(omarchy-cmd-terminal-cwd)"]]), { description = "Terminal" }) +hl.bind("SUPER + SHIFT + RETURN", hl.dsp.exec_cmd("omarchy-launch-browser"), { description = "Browser" }) +hl.bind("SUPER + SHIFT + F", hl.dsp.exec_cmd("uwsm-app -- nautilus --new-window"), { description = "File manager" }) +hl.bind("SUPER + ALT + SHIFT + F", hl.dsp.exec_cmd([[uwsm-app -- nautilus --new-window "$(omarchy-cmd-terminal-cwd)"]]), { description = "File manager (cwd)" }) +hl.bind("SUPER + SHIFT + B", hl.dsp.exec_cmd("omarchy-launch-browser"), { description = "Browser" }) +hl.bind("SUPER + SHIFT + ALT + B", hl.dsp.exec_cmd("omarchy-launch-browser --private"), { description = "Browser (private)" }) +hl.bind("SUPER + SHIFT + N", hl.dsp.exec_cmd("omarchy-launch-editor"), { description = "Editor" }) diff --git a/default/hypr/require_all.lua b/default/hypr/require_all.lua new file mode 100644 index 00000000..56153a00 --- /dev/null +++ b/default/hypr/require_all.lua @@ -0,0 +1,33 @@ +-- Require every *.lua file in a directory in sorted order. +-- Used for Omarchy extension-style folders such as default/hypr/apps, +-- default/hypr/bindings, and ~/.local/state/omarchy/toggles/hypr. +-- Pass a module prefix for normal package.path modules, e.g. +-- require_all.files(paths.omarchy_path .. "/default/hypr/apps", "default.hypr.apps") +-- Pass nil as the prefix when the directory itself has been added to package.path. + +local M = {} + +local function shell_quote(path) + return "'" .. path:gsub("'", "'\\''") .. "'" +end + +function M.files(dir, module_prefix, options) + local handle = io.popen("find " .. shell_quote(dir) .. " -maxdepth 1 -type f -name '*.lua' -printf '%f\\n' 2>/dev/null | sort") + if handle then + for filename in handle:lines() do + local module = filename:gsub("%.lua$", "") + if module_prefix then + module = module_prefix .. "." .. module + end + + if options and options.reload then + package.loaded[module] = nil + end + + require(module) + end + handle:close() + end +end + +return M diff --git a/default/hypr/toggles.lua b/default/hypr/toggles.lua new file mode 100644 index 00000000..5f24e1cf --- /dev/null +++ b/default/hypr/toggles.lua @@ -0,0 +1,7 @@ +local paths = require("default.hypr.paths") +local require_all = require("default.hypr.require_all") + +local toggles_dir = paths.state_home .. "/omarchy/toggles/hypr" +package.path = toggles_dir .. "/?.lua;" .. package.path + +require_all.files(toggles_dir, nil, { reload = true }) diff --git a/default/hypr/toggles/flags.conf b/default/hypr/toggles/flags.conf deleted file mode 100644 index a6334225..00000000 --- a/default/hypr/toggles/flags.conf +++ /dev/null @@ -1,2 +0,0 @@ -# This directory is intended for permanent config toggle flags. -# Do not remove this file (as the directory always needs at least one file). diff --git a/default/hypr/toggles/flags.lua b/default/hypr/toggles/flags.lua new file mode 100644 index 00000000..790e67ca --- /dev/null +++ b/default/hypr/toggles/flags.lua @@ -0,0 +1,2 @@ +-- This directory is intended for permanent config toggle flags. +-- Do not remove this file; the directory always needs at least one file. diff --git a/default/hypr/toggles/single-window-aspect-ratio.conf b/default/hypr/toggles/single-window-aspect-ratio.conf deleted file mode 100644 index b51d0e41..00000000 --- a/default/hypr/toggles/single-window-aspect-ratio.conf +++ /dev/null @@ -1,5 +0,0 @@ -# Avoid overly wide single-window layouts on wide screens -layout { - single_window_aspect_ratio = 1 1 -} - diff --git a/default/hypr/toggles/single-window-aspect-ratio.lua b/default/hypr/toggles/single-window-aspect-ratio.lua new file mode 100644 index 00000000..43839022 --- /dev/null +++ b/default/hypr/toggles/single-window-aspect-ratio.lua @@ -0,0 +1,6 @@ +-- Avoid overly wide single-window layouts on wide screens. +hl.config({ + layout = { + single_window_aspect_ratio = { 1, 1 }, + }, +}) diff --git a/default/hypr/toggles/window-no-gaps.conf b/default/hypr/toggles/window-no-gaps.conf deleted file mode 100644 index 47520e80..00000000 --- a/default/hypr/toggles/window-no-gaps.conf +++ /dev/null @@ -1,10 +0,0 @@ -# Remove all window gaps and borders -general { - gaps_out = 0 - gaps_in = 0 - border_size = 0 -} - -decoration { - rounding = 0 -} diff --git a/default/hypr/toggles/window-no-gaps.lua b/default/hypr/toggles/window-no-gaps.lua new file mode 100644 index 00000000..9e086a91 --- /dev/null +++ b/default/hypr/toggles/window-no-gaps.lua @@ -0,0 +1,12 @@ +-- Remove all window gaps and borders. +hl.config({ + general = { + gaps_out = 0, + gaps_in = 0, + border_size = 0, + }, + + decoration = { + rounding = 0, + }, +}) diff --git a/default/hypr/windows.conf b/default/hypr/windows.conf deleted file mode 100644 index 3ceca48f..00000000 --- a/default/hypr/windows.conf +++ /dev/null @@ -1,15 +0,0 @@ -# See https://wiki.hypr.land/Configuring/Basics/Window-Rules/ for more -# Hyprland 0.53+ syntax -windowrule = suppress_event maximize, match:class .* - -# Tag all windows for default opacity (apps can override with -default-opacity tag) -windowrule = tag +default-opacity, match:class .* - -# Fix some dragging issues with XWayland -windowrule = no_focus on, match:class ^$, match:title ^$, match:xwayland 1, match:float 1, match:fullscreen 0, match:pin 0 - -# App-specific tweaks (may remove default-opacity tag) -source = ~/.local/share/omarchy/default/hypr/apps.conf - -# Apply default opacity after apps have had a chance to opt out -windowrule = opacity 0.97 0.9, match:tag default-opacity diff --git a/default/hypr/windows.lua b/default/hypr/windows.lua new file mode 100644 index 00000000..342ddbcb --- /dev/null +++ b/default/hypr/windows.lua @@ -0,0 +1,25 @@ +-- See https://wiki.hypr.land/Configuring/Basics/Window-Rules/ + +hl.window_rule({ match = { class = ".*" }, suppress_event = "maximize" }) + +-- Tag all windows for default opacity (apps can override with -default-opacity tag). +hl.window_rule({ match = { class = ".*" }, tag = "+default-opacity" }) + +-- Fix some dragging issues with XWayland. +hl.window_rule({ + match = { + class = "^$", + title = "^$", + xwayland = true, + float = true, + fullscreen = false, + pin = false, + }, + no_focus = true, +}) + +-- App-specific tweaks (may remove default-opacity tag). +require("default.hypr.apps") + +-- Apply default opacity after apps have had a chance to opt out. +hl.window_rule({ match = { tag = "default-opacity" }, opacity = "0.97 0.9" }) From f1bec1532548c29c9b6a21107d28c3836f1b47b9 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sun, 10 May 2026 02:00:36 -0400 Subject: [PATCH 4/9] Update theme and SDDM to lua --- default/sddm/hyprland.conf | 11 --- default/sddm/hyprland.lua | 13 +++ default/themed/gum.env.conf.tpl | 137 ------------------------------- default/themed/gum_env.lua.tpl | 137 +++++++++++++++++++++++++++++++ default/themed/hyprland.conf.tpl | 9 -- default/themed/hyprland.lua.tpl | 15 ++++ 6 files changed, 165 insertions(+), 157 deletions(-) delete mode 100644 default/sddm/hyprland.conf create mode 100644 default/sddm/hyprland.lua delete mode 100644 default/themed/gum.env.conf.tpl create mode 100644 default/themed/gum_env.lua.tpl delete mode 100644 default/themed/hyprland.conf.tpl create mode 100644 default/themed/hyprland.lua.tpl diff --git a/default/sddm/hyprland.conf b/default/sddm/hyprland.conf deleted file mode 100644 index 4ce15a75..00000000 --- a/default/sddm/hyprland.conf +++ /dev/null @@ -1,11 +0,0 @@ -# Minimal Hyprland config for the SDDM Wayland greeter. -# SDDM starts the greeter itself after the compositor is ready. -misc { - disable_hyprland_logo = true - disable_splash_rendering = true - force_default_wallpaper = 0 -} - -animations { - enabled = false -} diff --git a/default/sddm/hyprland.lua b/default/sddm/hyprland.lua new file mode 100644 index 00000000..977ae17e --- /dev/null +++ b/default/sddm/hyprland.lua @@ -0,0 +1,13 @@ +-- Minimal Hyprland config for the SDDM Wayland greeter. +-- SDDM starts the greeter itself after the compositor is ready. +hl.config({ + misc = { + disable_hyprland_logo = true, + disable_splash_rendering = true, + force_default_wallpaper = 0, + }, + + animations = { + enabled = false, + }, +}) diff --git a/default/themed/gum.env.conf.tpl b/default/themed/gum.env.conf.tpl deleted file mode 100644 index 616f5a5f..00000000 --- a/default/themed/gum.env.conf.tpl +++ /dev/null @@ -1,137 +0,0 @@ -# Gum Style (generic) Variables -env = FOREGROUND,#{{ foreground }} -env = BACKGROUND,#{{ background }} -env = BORDER_FOREGROUND,#{{ accent }} -env = BORDER_BACKGROUND,#{{ background }} - -# Gum Confirm Style Variables -env = GUM_CONFIRM_PROMPT_FOREGROUND,#{{ accent }} -env = GUM_CONFIRM_PROMPT_BACKGROUND,#{{ background }} -env = GUM_CONFIRM_SELECTED_FOREGROUND,#{{ selection_foreground }} -env = GUM_CONFIRM_SELECTED_BACKGROUND,#{{ selection_background }} -env = GUM_CONFIRM_UNSELECTED_FOREGROUND,#{{ foreground }} -env = GUM_CONFIRM_UNSELECTED_BACKGROUND,#{{ background }} - -# Gum Input Style Variables -env = GUM_INPUT_PROMPT_FOREGROUND,#{{ accent }} -env = GUM_INPUT_PROMPT_BACKGROUND,#{{ background }} -env = GUM_INPUT_PLACEHOLDER_FOREGROUND,#{{ color8 }} -env = GUM_INPUT_PLACEHOLDER_BACKGROUND,#{{ background }} -env = GUM_INPUT_CURSOR_FOREGROUND,#{{ cursor }} -env = GUM_INPUT_CURSOR_BACKGROUND,#{{ background }} -env = GUM_INPUT_HEADER_FOREGROUND,#{{ foreground }} -env = GUM_INPUT_HEADER_BACKGROUND,#{{ background }} - -# Gum Choose Style Variables -env = GUM_CHOOSE_CURSOR_FOREGROUND,#{{ accent }} -env = GUM_CHOOSE_CURSOR_BACKGROUND,#{{ background }} -env = GUM_CHOOSE_HEADER_FOREGROUND,#{{ foreground }} -env = GUM_CHOOSE_HEADER_BACKGROUND,#{{ background }} -env = GUM_CHOOSE_ITEM_FOREGROUND,#{{ foreground }} -env = GUM_CHOOSE_ITEM_BACKGROUND,#{{ background }} -env = GUM_CHOOSE_SELECTED_FOREGROUND,#{{ selection_foreground }} -env = GUM_CHOOSE_SELECTED_BACKGROUND,#{{ selection_background }} - -# Gum Filter Style Variables -env = GUM_FILTER_PROMPT_FOREGROUND,#{{ accent }} -env = GUM_FILTER_PROMPT_BACKGROUND,#{{ background }} -env = GUM_FILTER_TEXT_FOREGROUND,#{{ foreground }} -env = GUM_FILTER_TEXT_BACKGROUND,#{{ background }} -env = GUM_FILTER_MATCH_FOREGROUND,#{{ accent }} -env = GUM_FILTER_CURSOR_TEXT_FOREGROUND,#{{ cursor }} -env = GUM_FILTER_CURSOR_TEXT_BACKGROUND,#{{ background }} -env = GUM_FILTER_SELECTED_FOREGROUND,#{{ selection_foreground }} -env = GUM_FILTER_SELECTED_BACKGROUND,#{{ selection_background }} -env = GUM_FILTER_INDICATOR_FOREGROUND,#{{ accent }} -env = GUM_FILTER_HEADER_FOREGROUND,#{{ foreground }} -env = GUM_FILTER_MATCH_BACKGROUND,#{{ background }} -env = GUM_FILTER_HEADER_BACKGROUND,#{{ background }} -env = GUM_FILTER_PLACEHOLDER_FOREGROUND,#{{ color8 }} -env = GUM_FILTER_PLACEHOLDER_BACKGROUND,#{{ background }} -env = GUM_FILTER_INDICATOR_BACKGROUND,#{{ background }} -env = GUM_FILTER_SELECTED_PREFIX_FOREGROUND,#{{ selection_foreground }} -env = GUM_FILTER_SELECTED_PREFIX_BACKGROUND,#{{ selection_background }} -env = GUM_FILTER_UNSELECTED_PREFIX_FOREGROUND,#{{ color8 }} -env = GUM_FILTER_UNSELECTED_PREFIX_BACKGROUND,#{{ background }} - -# Gum Table Style Variables -env = GUM_TABLE_HEADER_FOREGROUND,#{{ foreground }} -env = GUM_TABLE_HEADER_BACKGROUND,#{{ background }} -env = GUM_TABLE_CELL_FOREGROUND,#{{ foreground }} -env = GUM_TABLE_CELL_BACKGROUND,#{{ background }} -env = GUM_TABLE_BORDER_FOREGROUND,#{{ color8 }} -env = GUM_TABLE_BORDER_BACKGROUND,#{{ background }} -env = GUM_TABLE_SELECTED_FOREGROUND,#{{ selection_foreground }} -env = GUM_TABLE_SELECTED_BACKGROUND,#{{ selection_background }} - -# Gum Spin Style Variables -env = GUM_SPIN_SPINNER_FOREGROUND,#{{ accent }} -env = GUM_SPIN_SPINNER_BACKGROUND,#{{ background }} -env = GUM_SPIN_TITLE_FOREGROUND,#{{ foreground }} -env = GUM_SPIN_TITLE_BACKGROUND,#{{ background }} - -# Gum File Style Variables -env = GUM_FILE_CURSOR_FOREGROUND,#{{ cursor }} -env = GUM_FILE_CURSOR_BACKGROUND,#{{ background }} -env = GUM_FILE_SYMLINK_FOREGROUND,#{{ foreground }} -env = GUM_FILE_SYMLINK_BACKGROUND,#{{ background }} -env = GUM_FILE_DIRECTORY_FOREGROUND,#{{ foreground }} -env = GUM_FILE_DIRECTORY_BACKGROUND,#{{ background }} -env = GUM_FILE_FILE_FOREGROUND,#{{ foreground }} -env = GUM_FILE_FILE_BACKGROUND,#{{ background }} -env = GUM_FILE_PERMISSIONS_FOREGROUND,#{{ color8 }} -env = GUM_FILE_PERMISSIONS_BACKGROUND,#{{ background }} -env = GUM_FILE_SELECTED_FOREGROUND,#{{ selection_foreground }} -env = GUM_FILE_SELECTED_BACKGROUND,#{{ selection_background }} -env = GUM_FILE_FILE_SIZE_FOREGROUND,#{{ color8 }} -env = GUM_FILE_FILE_SIZE_BACKGROUND,#{{ background }} -env = GUM_FILE_HEADER_FOREGROUND,#{{ foreground }} -env = GUM_FILE_HEADER_BACKGROUND,#{{ background }} - -# Gum Pager Style Variables -env = GUM_PAGER_FOREGROUND,#{{ foreground }} -env = GUM_PAGER_BACKGROUND,#{{ background }} -env = GUM_PAGER_LINE_NUMBER_FOREGROUND,#{{ color8 }} -env = GUM_PAGER_LINE_NUMBER_BACKGROUND,#{{ background }} -env = GUM_PAGER_MATCH_FOREGROUND,#{{ accent }} -env = GUM_PAGER_MATCH_BACKGROUND,#{{ background }} -env = GUM_PAGER_MATCH_HIGH_FOREGROUND,#{{ accent }} -env = GUM_PAGER_MATCH_HIGH_BACKGROUND,#{{ background }} -env = GUM_PAGER_HELP_FOREGROUND,#{{ color8 }} -env = GUM_PAGER_HELP_BACKGROUND,#{{ background }} - -# Gum Write Style Variables -env = GUM_WRITE_BASE_FOREGROUND,#{{ foreground }} -env = GUM_WRITE_BASE_BACKGROUND,#{{ background }} -env = GUM_WRITE_CURSOR_LINE_NUMBER_FOREGROUND,#{{ color8 }} -env = GUM_WRITE_CURSOR_LINE_NUMBER_BACKGROUND,#{{ background }} -env = GUM_WRITE_CURSOR_LINE_FOREGROUND,#{{ foreground }} -env = GUM_WRITE_CURSOR_LINE_BACKGROUND,#{{ selection_background }} -env = GUM_WRITE_CURSOR_FOREGROUND,#{{ cursor }} -env = GUM_WRITE_CURSOR_BACKGROUND,#{{ background }} -env = GUM_WRITE_END_OF_BUFFER_FOREGROUND,#{{ color8 }} -env = GUM_WRITE_END_OF_BUFFER_BACKGROUND,#{{ background }} -env = GUM_WRITE_LINE_NUMBER_FOREGROUND,#{{ color8 }} -env = GUM_WRITE_LINE_NUMBER_BACKGROUND,#{{ background }} -env = GUM_WRITE_HEADER_FOREGROUND,#{{ foreground }} -env = GUM_WRITE_HEADER_BACKGROUND,#{{ background }} -env = GUM_WRITE_PLACEHOLDER_FOREGROUND,#{{ color8 }} -env = GUM_WRITE_PLACEHOLDER_BACKGROUND,#{{ background }} -env = GUM_WRITE_PROMPT_FOREGROUND,#{{ foreground }} -env = GUM_WRITE_PROMPT_BACKGROUND,#{{ background }} - -# Gum Log Style Variables -env = GUM_LOG_LEVEL_FOREGROUND,#{{ accent }} -env = GUM_LOG_LEVEL_BACKGROUND,#{{ background }} -env = GUM_LOG_TIME_FOREGROUND,#{{ color8 }} -env = GUM_LOG_TIME_BACKGROUND,#{{ background }} -env = GUM_LOG_PREFIX_FOREGROUND,#{{ foreground }} -env = GUM_LOG_PREFIX_BACKGROUND,#{{ background }} -env = GUM_LOG_MESSAGE_FOREGROUND,#{{ foreground }} -env = GUM_LOG_MESSAGE_BACKGROUND,#{{ background }} -env = GUM_LOG_KEY_FOREGROUND,#{{ foreground }} -env = GUM_LOG_KEY_BACKGROUND,#{{ background }} -env = GUM_LOG_VALUE_FOREGROUND,#{{ foreground }} -env = GUM_LOG_VALUE_BACKGROUND,#{{ background }} -env = GUM_LOG_SEPARATOR_FOREGROUND,#{{ color8 }} -env = GUM_LOG_SEPARATOR_BACKGROUND,#{{ background }} \ No newline at end of file diff --git a/default/themed/gum_env.lua.tpl b/default/themed/gum_env.lua.tpl new file mode 100644 index 00000000..aa607d87 --- /dev/null +++ b/default/themed/gum_env.lua.tpl @@ -0,0 +1,137 @@ +-- Gum Style (generic) Variables +hl.env("FOREGROUND", "#{{ foreground }}") +hl.env("BACKGROUND", "#{{ background }}") +hl.env("BORDER_FOREGROUND", "#{{ accent }}") +hl.env("BORDER_BACKGROUND", "#{{ background }}") + +-- Gum Confirm Style Variables +hl.env("GUM_CONFIRM_PROMPT_FOREGROUND", "#{{ accent }}") +hl.env("GUM_CONFIRM_PROMPT_BACKGROUND", "#{{ background }}") +hl.env("GUM_CONFIRM_SELECTED_FOREGROUND", "#{{ selection_foreground }}") +hl.env("GUM_CONFIRM_SELECTED_BACKGROUND", "#{{ selection_background }}") +hl.env("GUM_CONFIRM_UNSELECTED_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_CONFIRM_UNSELECTED_BACKGROUND", "#{{ background }}") + +-- Gum Input Style Variables +hl.env("GUM_INPUT_PROMPT_FOREGROUND", "#{{ accent }}") +hl.env("GUM_INPUT_PROMPT_BACKGROUND", "#{{ background }}") +hl.env("GUM_INPUT_PLACEHOLDER_FOREGROUND", "#{{ color8 }}") +hl.env("GUM_INPUT_PLACEHOLDER_BACKGROUND", "#{{ background }}") +hl.env("GUM_INPUT_CURSOR_FOREGROUND", "#{{ cursor }}") +hl.env("GUM_INPUT_CURSOR_BACKGROUND", "#{{ background }}") +hl.env("GUM_INPUT_HEADER_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_INPUT_HEADER_BACKGROUND", "#{{ background }}") + +-- Gum Choose Style Variables +hl.env("GUM_CHOOSE_CURSOR_FOREGROUND", "#{{ accent }}") +hl.env("GUM_CHOOSE_CURSOR_BACKGROUND", "#{{ background }}") +hl.env("GUM_CHOOSE_HEADER_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_CHOOSE_HEADER_BACKGROUND", "#{{ background }}") +hl.env("GUM_CHOOSE_ITEM_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_CHOOSE_ITEM_BACKGROUND", "#{{ background }}") +hl.env("GUM_CHOOSE_SELECTED_FOREGROUND", "#{{ selection_foreground }}") +hl.env("GUM_CHOOSE_SELECTED_BACKGROUND", "#{{ selection_background }}") + +-- Gum Filter Style Variables +hl.env("GUM_FILTER_PROMPT_FOREGROUND", "#{{ accent }}") +hl.env("GUM_FILTER_PROMPT_BACKGROUND", "#{{ background }}") +hl.env("GUM_FILTER_TEXT_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_FILTER_TEXT_BACKGROUND", "#{{ background }}") +hl.env("GUM_FILTER_MATCH_FOREGROUND", "#{{ accent }}") +hl.env("GUM_FILTER_CURSOR_TEXT_FOREGROUND", "#{{ cursor }}") +hl.env("GUM_FILTER_CURSOR_TEXT_BACKGROUND", "#{{ background }}") +hl.env("GUM_FILTER_SELECTED_FOREGROUND", "#{{ selection_foreground }}") +hl.env("GUM_FILTER_SELECTED_BACKGROUND", "#{{ selection_background }}") +hl.env("GUM_FILTER_INDICATOR_FOREGROUND", "#{{ accent }}") +hl.env("GUM_FILTER_HEADER_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_FILTER_MATCH_BACKGROUND", "#{{ background }}") +hl.env("GUM_FILTER_HEADER_BACKGROUND", "#{{ background }}") +hl.env("GUM_FILTER_PLACEHOLDER_FOREGROUND", "#{{ color8 }}") +hl.env("GUM_FILTER_PLACEHOLDER_BACKGROUND", "#{{ background }}") +hl.env("GUM_FILTER_INDICATOR_BACKGROUND", "#{{ background }}") +hl.env("GUM_FILTER_SELECTED_PREFIX_FOREGROUND", "#{{ selection_foreground }}") +hl.env("GUM_FILTER_SELECTED_PREFIX_BACKGROUND", "#{{ selection_background }}") +hl.env("GUM_FILTER_UNSELECTED_PREFIX_FOREGROUND", "#{{ color8 }}") +hl.env("GUM_FILTER_UNSELECTED_PREFIX_BACKGROUND", "#{{ background }}") + +-- Gum Table Style Variables +hl.env("GUM_TABLE_HEADER_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_TABLE_HEADER_BACKGROUND", "#{{ background }}") +hl.env("GUM_TABLE_CELL_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_TABLE_CELL_BACKGROUND", "#{{ background }}") +hl.env("GUM_TABLE_BORDER_FOREGROUND", "#{{ color8 }}") +hl.env("GUM_TABLE_BORDER_BACKGROUND", "#{{ background }}") +hl.env("GUM_TABLE_SELECTED_FOREGROUND", "#{{ selection_foreground }}") +hl.env("GUM_TABLE_SELECTED_BACKGROUND", "#{{ selection_background }}") + +-- Gum Spin Style Variables +hl.env("GUM_SPIN_SPINNER_FOREGROUND", "#{{ accent }}") +hl.env("GUM_SPIN_SPINNER_BACKGROUND", "#{{ background }}") +hl.env("GUM_SPIN_TITLE_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_SPIN_TITLE_BACKGROUND", "#{{ background }}") + +-- Gum File Style Variables +hl.env("GUM_FILE_CURSOR_FOREGROUND", "#{{ cursor }}") +hl.env("GUM_FILE_CURSOR_BACKGROUND", "#{{ background }}") +hl.env("GUM_FILE_SYMLINK_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_FILE_SYMLINK_BACKGROUND", "#{{ background }}") +hl.env("GUM_FILE_DIRECTORY_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_FILE_DIRECTORY_BACKGROUND", "#{{ background }}") +hl.env("GUM_FILE_FILE_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_FILE_FILE_BACKGROUND", "#{{ background }}") +hl.env("GUM_FILE_PERMISSIONS_FOREGROUND", "#{{ color8 }}") +hl.env("GUM_FILE_PERMISSIONS_BACKGROUND", "#{{ background }}") +hl.env("GUM_FILE_SELECTED_FOREGROUND", "#{{ selection_foreground }}") +hl.env("GUM_FILE_SELECTED_BACKGROUND", "#{{ selection_background }}") +hl.env("GUM_FILE_FILE_SIZE_FOREGROUND", "#{{ color8 }}") +hl.env("GUM_FILE_FILE_SIZE_BACKGROUND", "#{{ background }}") +hl.env("GUM_FILE_HEADER_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_FILE_HEADER_BACKGROUND", "#{{ background }}") + +-- Gum Pager Style Variables +hl.env("GUM_PAGER_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_PAGER_BACKGROUND", "#{{ background }}") +hl.env("GUM_PAGER_LINE_NUMBER_FOREGROUND", "#{{ color8 }}") +hl.env("GUM_PAGER_LINE_NUMBER_BACKGROUND", "#{{ background }}") +hl.env("GUM_PAGER_MATCH_FOREGROUND", "#{{ accent }}") +hl.env("GUM_PAGER_MATCH_BACKGROUND", "#{{ background }}") +hl.env("GUM_PAGER_MATCH_HIGH_FOREGROUND", "#{{ accent }}") +hl.env("GUM_PAGER_MATCH_HIGH_BACKGROUND", "#{{ background }}") +hl.env("GUM_PAGER_HELP_FOREGROUND", "#{{ color8 }}") +hl.env("GUM_PAGER_HELP_BACKGROUND", "#{{ background }}") + +-- Gum Write Style Variables +hl.env("GUM_WRITE_BASE_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_WRITE_BASE_BACKGROUND", "#{{ background }}") +hl.env("GUM_WRITE_CURSOR_LINE_NUMBER_FOREGROUND", "#{{ color8 }}") +hl.env("GUM_WRITE_CURSOR_LINE_NUMBER_BACKGROUND", "#{{ background }}") +hl.env("GUM_WRITE_CURSOR_LINE_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_WRITE_CURSOR_LINE_BACKGROUND", "#{{ selection_background }}") +hl.env("GUM_WRITE_CURSOR_FOREGROUND", "#{{ cursor }}") +hl.env("GUM_WRITE_CURSOR_BACKGROUND", "#{{ background }}") +hl.env("GUM_WRITE_END_OF_BUFFER_FOREGROUND", "#{{ color8 }}") +hl.env("GUM_WRITE_END_OF_BUFFER_BACKGROUND", "#{{ background }}") +hl.env("GUM_WRITE_LINE_NUMBER_FOREGROUND", "#{{ color8 }}") +hl.env("GUM_WRITE_LINE_NUMBER_BACKGROUND", "#{{ background }}") +hl.env("GUM_WRITE_HEADER_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_WRITE_HEADER_BACKGROUND", "#{{ background }}") +hl.env("GUM_WRITE_PLACEHOLDER_FOREGROUND", "#{{ color8 }}") +hl.env("GUM_WRITE_PLACEHOLDER_BACKGROUND", "#{{ background }}") +hl.env("GUM_WRITE_PROMPT_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_WRITE_PROMPT_BACKGROUND", "#{{ background }}") + +-- Gum Log Style Variables +hl.env("GUM_LOG_LEVEL_FOREGROUND", "#{{ accent }}") +hl.env("GUM_LOG_LEVEL_BACKGROUND", "#{{ background }}") +hl.env("GUM_LOG_TIME_FOREGROUND", "#{{ color8 }}") +hl.env("GUM_LOG_TIME_BACKGROUND", "#{{ background }}") +hl.env("GUM_LOG_PREFIX_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_LOG_PREFIX_BACKGROUND", "#{{ background }}") +hl.env("GUM_LOG_MESSAGE_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_LOG_MESSAGE_BACKGROUND", "#{{ background }}") +hl.env("GUM_LOG_KEY_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_LOG_KEY_BACKGROUND", "#{{ background }}") +hl.env("GUM_LOG_VALUE_FOREGROUND", "#{{ foreground }}") +hl.env("GUM_LOG_VALUE_BACKGROUND", "#{{ background }}") +hl.env("GUM_LOG_SEPARATOR_FOREGROUND", "#{{ color8 }}") +hl.env("GUM_LOG_SEPARATOR_BACKGROUND", "#{{ background }}") diff --git a/default/themed/hyprland.conf.tpl b/default/themed/hyprland.conf.tpl deleted file mode 100644 index e4dbf3c3..00000000 --- a/default/themed/hyprland.conf.tpl +++ /dev/null @@ -1,9 +0,0 @@ -$activeBorderColor = rgb({{ accent_strip }}) - -general { - col.active_border = $activeBorderColor -} - -group { - col.border_active = $activeBorderColor -} diff --git a/default/themed/hyprland.lua.tpl b/default/themed/hyprland.lua.tpl new file mode 100644 index 00000000..5c9e2101 --- /dev/null +++ b/default/themed/hyprland.lua.tpl @@ -0,0 +1,15 @@ +local active_border_color = "rgb({{ accent_strip }})" + +hl.config({ + general = { + col = { + active_border = active_border_color, + }, + }, + + group = { + col = { + border_active = active_border_color, + }, + }, +}) From 59a2619426764ac5cd417e18aa4ea38975dbb0c6 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sun, 10 May 2026 02:01:01 -0400 Subject: [PATCH 5/9] Update theme specifics to lua --- themes/kanagawa/hyprland.conf | 12 ------------ themes/kanagawa/hyprland.lua | 18 ++++++++++++++++++ themes/lumon/hyprland.conf | 26 -------------------------- themes/lumon/hyprland.lua | 32 ++++++++++++++++++++++++++++++++ themes/retro-82/hyprland.conf | 9 --------- themes/retro-82/hyprland.lua | 15 +++++++++++++++ 6 files changed, 65 insertions(+), 47 deletions(-) delete mode 100644 themes/kanagawa/hyprland.conf create mode 100644 themes/kanagawa/hyprland.lua delete mode 100644 themes/lumon/hyprland.conf create mode 100644 themes/lumon/hyprland.lua delete mode 100644 themes/retro-82/hyprland.conf create mode 100644 themes/retro-82/hyprland.lua diff --git a/themes/kanagawa/hyprland.conf b/themes/kanagawa/hyprland.conf deleted file mode 100644 index 0ee92cac..00000000 --- a/themes/kanagawa/hyprland.conf +++ /dev/null @@ -1,12 +0,0 @@ -$activeBorderColor = rgb(dcd7ba) - -general { - col.active_border = $activeBorderColor -} - -group { - col.border_active = $activeBorderColor -} - -# Kanagawa backdrop is too strong for detault opacity -windowrule = opacity 0.98 0.95, match:tag terminal diff --git a/themes/kanagawa/hyprland.lua b/themes/kanagawa/hyprland.lua new file mode 100644 index 00000000..b03145b6 --- /dev/null +++ b/themes/kanagawa/hyprland.lua @@ -0,0 +1,18 @@ +local active_border_color = "rgb(dcd7ba)" + +hl.config({ + general = { + col = { + active_border = active_border_color, + }, + }, + + group = { + col = { + border_active = active_border_color, + }, + }, +}) + +-- Kanagawa backdrop is too strong for default opacity. +hl.window_rule({ match = { tag = "terminal" }, opacity = "0.98 0.95" }) diff --git a/themes/lumon/hyprland.conf b/themes/lumon/hyprland.conf deleted file mode 100644 index 40d21b4a..00000000 --- a/themes/lumon/hyprland.conf +++ /dev/null @@ -1,26 +0,0 @@ -$activeBorderColor = rgb(f2fcff) -$activeShadowColor = rgb(6fb8e3) -$inactiveBorderColor = rgba(30486099) -$inactiveShadowColor = rgba(30486077) - -general { - col.active_border = $activeBorderColor - col.inactive_border = $inactiveBorderColor - gaps_in = 8 - gaps_out = 16 -} - -group { - col.border_active = $activeBorderColor - col.border_inactive = $inactiveBorderColor -} - -decoration { - shadow { - enabled = true - range = 16 - render_power = 4 - color = $activeShadowColor - color_inactive = $inactiveShadowColor - } -} diff --git a/themes/lumon/hyprland.lua b/themes/lumon/hyprland.lua new file mode 100644 index 00000000..497830a3 --- /dev/null +++ b/themes/lumon/hyprland.lua @@ -0,0 +1,32 @@ +local active_border_color = "rgb(f2fcff)" +local active_shadow_color = "rgb(6fb8e3)" +local inactive_border_color = "rgba(30486099)" +local inactive_shadow_color = "rgba(30486077)" + +hl.config({ + general = { + col = { + active_border = active_border_color, + inactive_border = inactive_border_color, + }, + gaps_in = 8, + gaps_out = 16, + }, + + group = { + col = { + border_active = active_border_color, + border_inactive = inactive_border_color, + }, + }, + + decoration = { + shadow = { + enabled = true, + range = 16, + render_power = 4, + color = active_shadow_color, + color_inactive = inactive_shadow_color, + }, + }, +}) diff --git a/themes/retro-82/hyprland.conf b/themes/retro-82/hyprland.conf deleted file mode 100644 index 4d4c6ad5..00000000 --- a/themes/retro-82/hyprland.conf +++ /dev/null @@ -1,9 +0,0 @@ -$activeBorderColor = rgb(faa968) - -general { - col.active_border = $activeBorderColor -} - -group { - col.border_active = $activeBorderColor -} diff --git a/themes/retro-82/hyprland.lua b/themes/retro-82/hyprland.lua new file mode 100644 index 00000000..ebea23d3 --- /dev/null +++ b/themes/retro-82/hyprland.lua @@ -0,0 +1,15 @@ +local active_border_color = "rgb(faa968)" + +hl.config({ + general = { + col = { + active_border = active_border_color, + }, + }, + + group = { + col = { + border_active = active_border_color, + }, + }, +}) From 82a1a91509ae4aadfbd557fac406fe1aed41dbeb Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sun, 10 May 2026 02:01:30 -0400 Subject: [PATCH 6/9] Add conf -> lua migration for Hyprland and update old migrations --- migrations/1757879836.sh | 11 ++--- migrations/1778148645.sh | 5 ++- migrations/1778321093.sh | 92 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+), 10 deletions(-) create mode 100644 migrations/1778321093.sh diff --git a/migrations/1757879836.sh b/migrations/1757879836.sh index e15c4415..553b6e55 100644 --- a/migrations/1757879836.sh +++ b/migrations/1757879836.sh @@ -1,10 +1,5 @@ -echo "Ensure .config/hypr/looknfeel.conf is available and included" +echo "Ensure .config/hypr/looknfeel.lua is available" -if [[ ! -f ~/.config/hypr/looknfeel.conf ]]; then - cp $OMARCHY_PATH/config/hypr/looknfeel.conf ~/.config/hypr/looknfeel.conf -fi - -if [[ -f ~/.config/hypr/hyprland.conf ]]; then - grep -qx 'source = ~/.config/hypr/looknfeel.conf' ~/.config/hypr/hyprland.conf || - sed -i '/^source = ~\/.config\/hypr\/envs\.conf$/a source = ~/.config/hypr/looknfeel.conf' ~/.config/hypr/hyprland.conf +if [[ ! -f ~/.config/hypr/looknfeel.lua ]]; then + cp "$OMARCHY_PATH/config/hypr/looknfeel.lua" ~/.config/hypr/looknfeel.lua fi diff --git a/migrations/1778148645.sh b/migrations/1778148645.sh index c085858e..40f10c03 100644 --- a/migrations/1778148645.sh +++ b/migrations/1778148645.sh @@ -1,11 +1,12 @@ echo "Configure SDDM to use Wayland for the greeter" -sudo cp "$OMARCHY_PATH/default/sddm/hyprland.conf" /usr/share/sddm/hyprland.conf +sudo cp "$OMARCHY_PATH/default/sddm/hyprland.lua" /usr/share/sddm/hyprland.lua +sudo rm -f /usr/share/sddm/hyprland.conf sudo mkdir -p /etc/sddm.conf.d cat </dev/null [General] DisplayServer=wayland [Wayland] -CompositorCommand=start-hyprland -- --config /usr/share/sddm/hyprland.conf +CompositorCommand=start-hyprland -- --config /usr/share/sddm/hyprland.lua EOF diff --git a/migrations/1778321093.sh b/migrations/1778321093.sh new file mode 100644 index 00000000..72a551f6 --- /dev/null +++ b/migrations/1778321093.sh @@ -0,0 +1,92 @@ +echo "Migrate Hyprland user config from Omarchy hyprlang files to Lua files" + +hypr_config_dir="$HOME/.config/hypr" +omarchy_hypr_config_dir="$OMARCHY_PATH/config/hypr" +toggle_state_dir="$HOME/.local/state/omarchy/toggles/hypr" +toggle_defaults_dir="$OMARCHY_PATH/default/hypr/toggles" +timestamp=$(date +%s) + +lua_escape() { + local value="$1" + value="${value//\\/\\\\}" + value="${value//\"/\\\"}" + printf '%s' "$value" +} + +mkdir -p "$hypr_config_dir" "$toggle_state_dir" + +for lua_config in "$omarchy_hypr_config_dir"/*.lua "$omarchy_hypr_config_dir"/.luarc.json; do + if [[ -f $lua_config ]]; then + cp -f "$lua_config" "$hypr_config_dir/" + fi +done + +for config_name in autostart bindings hyprland input looknfeel monitors; do + conf_file="$hypr_config_dir/$config_name.conf" + + if [[ -f $conf_file ]]; then + mv "$conf_file" "$conf_file.bak.$timestamp" + fi +done + +for conf_toggle in "$toggle_state_dir"/*.conf; do + [[ -f $conf_toggle ]] || continue + + toggle_name=$(basename "$conf_toggle" .conf) + lua_toggle="$toggle_state_dir/$toggle_name.lua" + + if [[ ! -f $lua_toggle ]]; then + case "$toggle_name" in + flags | single-window-aspect-ratio | window-no-gaps) + if [[ -f $toggle_defaults_dir/$toggle_name.lua ]]; then + cp -f "$toggle_defaults_dir/$toggle_name.lua" "$lua_toggle" + fi + ;; + internal-monitor-disable) + monitor=$(sed -nE 's/^monitor=([^,]+),disable.*$/\1/p' "$conf_toggle" | head -n 1) + if [[ -n $monitor ]]; then + printf 'hl.monitor({ output = "%s", disabled = true })\n' "$(lua_escape "$monitor")" >"$lua_toggle" + fi + ;; + internal-monitor-mirror) + monitor_line=$(grep -E '^monitor=' "$conf_toggle" | head -n 1) + external=$(printf '%s' "$monitor_line" | cut -d, -f1 | sed 's/^monitor=//') + internal=$(printf '%s' "$monitor_line" | awk -F',[[:space:]]*mirror,[[:space:]]*' '{ print $2 }') + if [[ -n $external && -n $internal ]]; then + printf 'hl.monitor({ output = "%s", mode = "preferred", position = "auto", scale = 1, mirror = "%s" })\n' "$(lua_escape "$external")" "$(lua_escape "$internal")" >"$lua_toggle" + fi + ;; + touchpad-disabled | touchscreen-disabled) + device=$(sed -nE 's/^[[:space:]]*name[[:space:]]*=[[:space:]]*(.*)$/\1/p' "$conf_toggle" | head -n 1) + if [[ -n $device ]]; then + printf 'hl.device({ name = "%s", enabled = false })\n' "$(lua_escape "$device")" >"$lua_toggle" + fi + ;; + esac + fi + + mv "$conf_toggle" "$conf_toggle.bak.$timestamp" +done + +sddm_hypr_conf="/usr/share/sddm/hyprland.conf" +sddm_hypr_lua="/usr/share/sddm/hyprland.lua" +sddm_wayland_conf="/etc/sddm.conf.d/10-wayland.conf" + +if [[ -f $sddm_hypr_conf || -f $sddm_wayland_conf ]]; then + if [[ -f $OMARCHY_PATH/default/sddm/hyprland.lua ]]; then + sudo mkdir -p /usr/share/sddm + sudo cp "$OMARCHY_PATH/default/sddm/hyprland.lua" "$sddm_hypr_lua" + fi + + if [[ -f $sddm_wayland_conf ]]; then + sudo sed -i 's|/usr/share/sddm/hyprland\.conf|/usr/share/sddm/hyprland.lua|g' "$sddm_wayland_conf" + fi + + if [[ -f $sddm_hypr_conf ]]; then + sudo mv "$sddm_hypr_conf" "$sddm_hypr_conf.bak.$timestamp" + fi +fi + +omarchy-state set reboot-required + +echo "Hyprland must be restarted to switch from hyprland.conf to hyprland.lua. Log out and back in, or reboot when ready." From 804571d8e2c11737ce8d4abbd1dedf9ace2f6e55 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sun, 10 May 2026 02:01:44 -0400 Subject: [PATCH 7/9] Update all hyprland references to new lua ones --- bin/omarchy-brightness-display | 5 +- bin/omarchy-hw-recover-internal-monitor | 2 +- bin/omarchy-hyprland-monitor-internal | 6 +-- bin/omarchy-hyprland-monitor-internal-mirror | 13 +++-- bin/omarchy-hyprland-monitor-scaling-cycle | 23 ++++----- bin/omarchy-hyprland-toggle | 50 +++++++++++++++---- bin/omarchy-hyprland-toggle-disabled | 2 +- bin/omarchy-hyprland-toggle-enabled | 2 +- bin/omarchy-hyprland-window-close-all | 6 ++- bin/omarchy-hyprland-window-pop | 30 ++++++----- ...marchy-hyprland-window-transparency-toggle | 4 +- bin/omarchy-hyprland-workspace-layout-toggle | 3 +- bin/omarchy-launch-or-focus | 2 +- bin/omarchy-launch-screensaver | 36 ++++++------- bin/omarchy-menu | 19 ++++--- bin/omarchy-refresh-hyprland | 15 +++--- bin/omarchy-remove-preinstalls | 4 +- bin/omarchy-screensaver | 4 +- bin/omarchy-toggle-touchpad | 14 +++--- bin/omarchy-toggle-touchscreen | 14 +++--- bin/omarchy-update-git | 2 +- bin/omarchy-update-perform | 4 +- config/elephant/symbols.toml | 2 +- .../omarchy-recover-internal-monitor.service | 2 +- install/config/detect-keyboard-layout.sh | 10 ++-- install/config/hardware/nvidia.sh | 18 +++---- install/config/omarchy-toggles.sh | 2 +- install/login/sddm.sh | 5 +- 28 files changed, 173 insertions(+), 126 deletions(-) diff --git a/bin/omarchy-brightness-display b/bin/omarchy-brightness-display index 7d30bfcf..ffeb3caa 100755 --- a/bin/omarchy-brightness-display +++ b/bin/omarchy-brightness-display @@ -7,10 +7,10 @@ step="${1:-+5%}" if [[ $step == "off" ]]; then - hyprctl dispatch dpms off >/dev/null 2>&1 + hyprctl dispatch 'hl.dsp.dpms({ action = "disable" })' >/dev/null 2>&1 || hyprctl dispatch dpms off >/dev/null 2>&1 exit 0 elif [[ $step == "on" ]]; then - hyprctl dispatch dpms on >/dev/null 2>&1 + hyprctl dispatch 'hl.dsp.dpms({ action = "enable" })' >/dev/null 2>&1 || hyprctl dispatch dpms on >/dev/null 2>&1 exit 0 fi @@ -30,6 +30,7 @@ for candidate in amdgpu_bl* intel_backlight acpi_video*; do fi done + if omarchy-hyprland-monitor-focused-apple; then omarchy-brightness-display-apple "$step" exit diff --git a/bin/omarchy-hw-recover-internal-monitor b/bin/omarchy-hw-recover-internal-monitor index 2ff125e7..182f54f3 100755 --- a/bin/omarchy-hw-recover-internal-monitor +++ b/bin/omarchy-hw-recover-internal-monitor @@ -2,7 +2,7 @@ # omarchy:summary=Clear the internal-monitor-disable toggle if no external display is connected. -TOGGLE="$HOME/.local/state/omarchy/toggles/hypr/internal-monitor-disable.conf" +TOGGLE="$HOME/.local/state/omarchy/toggles/hypr/internal-monitor-disable.lua" if [[ -f $TOGGLE ]] && ! omarchy-hw-external-monitors; then rm -f "$TOGGLE" diff --git a/bin/omarchy-hyprland-monitor-internal b/bin/omarchy-hyprland-monitor-internal index 865c82d6..6b72c2bd 100755 --- a/bin/omarchy-hyprland-monitor-internal +++ b/bin/omarchy-hyprland-monitor-internal @@ -4,7 +4,7 @@ # omarchy:args= TOGGLE="internal-monitor-disable" -TOGGLE_FLAG="$HOME/.local/state/omarchy/toggles/hypr/$TOGGLE.conf" +TOGGLE_FLAG="$HOME/.local/state/omarchy/toggles/hypr/$TOGGLE.lua" MIRROR_TOGGLE="internal-monitor-mirror" # Get internal monitor name dynamically @@ -24,14 +24,14 @@ off() { fi if omarchy-hyprland-toggle-disabled $TOGGLE && omarchy-hyprland-toggle-disabled $MIRROR_TOGGLE; then - echo "monitor=$INTERNAL,disable" >"$TOGGLE_FLAG" + printf 'hl.monitor({ output = "%s", disabled = true })\n' "$INTERNAL" >"$TOGGLE_FLAG" omarchy-notification-send -g 󰍹 "Laptop display disabled" hyprctl reload fi } recover() { - if ! omarchy-hw-external-monitors; then + if ! omarchy-hw-external-monitors && omarchy-hyprland-toggle-enabled $TOGGLE; then omarchy-hyprland-toggle $TOGGLE off fi } diff --git a/bin/omarchy-hyprland-monitor-internal-mirror b/bin/omarchy-hyprland-monitor-internal-mirror index 5c9e92bc..451d4305 100755 --- a/bin/omarchy-hyprland-monitor-internal-mirror +++ b/bin/omarchy-hyprland-monitor-internal-mirror @@ -4,7 +4,7 @@ # omarchy:args= TOGGLE="internal-monitor-mirror" -TOGGLE_FLAG="$HOME/.local/state/omarchy/toggles/hypr/$TOGGLE.conf" +TOGGLE_FLAG="$HOME/.local/state/omarchy/toggles/hypr/$TOGGLE.lua" DISABLE_TOGGLE="internal-monitor-disable" # Get names dynamically @@ -24,9 +24,12 @@ on() { fi omarchy-hyprland-toggle $DISABLE_TOGGLE off - echo "monitor=$EXTERNAL, preferred, auto, 1, mirror, $INTERNAL" >"$TOGGLE_FLAG" - omarchy-notification-send -g 󰍹 "Mirroring enabled ($EXTERNAL)" - hyprctl reload + + if omarchy-hyprland-toggle-disabled $TOGGLE; then + printf 'hl.monitor({ output = "%s", mode = "preferred", position = "auto", scale = 1, mirror = "%s" })\n' "$EXTERNAL" "$INTERNAL" >"$TOGGLE_FLAG" + omarchy-notification-send -g 󰍹 "Mirroring enabled ($EXTERNAL)" + hyprctl reload + fi } off() { @@ -45,7 +48,7 @@ toggle() { } recover() { - if ! omarchy-hw-external-monitors; then + if ! omarchy-hw-external-monitors && omarchy-hyprland-toggle-enabled $TOGGLE; then omarchy-hyprland-toggle $TOGGLE off fi } diff --git a/bin/omarchy-hyprland-monitor-scaling-cycle b/bin/omarchy-hyprland-monitor-scaling-cycle index d776f552..c88a87b3 100755 --- a/bin/omarchy-hyprland-monitor-scaling-cycle +++ b/bin/omarchy-hyprland-monitor-scaling-cycle @@ -24,7 +24,7 @@ CURRENT_IDX=$(awk -v s="$CURRENT_SCALE" -v list="${SCALES[*]}" 'BEGIN { print best }') -if [[ "$1" == "--reverse" ]]; then +if [[ $1 == "--reverse" ]]; then NEW_IDX=$(( (CURRENT_IDX - 1 + ${#SCALES[@]}) % ${#SCALES[@]} )) else NEW_IDX=$(( (CURRENT_IDX + 1) % ${#SCALES[@]} )) @@ -32,19 +32,16 @@ fi NEW_SCALE=${SCALES[$NEW_IDX]} -hyprctl keyword monitor "$ACTIVE_MONITOR,${WIDTH}x${HEIGHT}@${REFRESH_RATE},auto,$NEW_SCALE" +hyprctl eval "hl.monitor({ output = \"$ACTIVE_MONITOR\", mode = \"${WIDTH}x${HEIGHT}@${REFRESH_RATE}\", position = \"auto\", scale = $NEW_SCALE })" >/dev/null -# Persist to monitors.conf if the user has a single generic catch-all line -# (ignoring disabled monitors), so the scale survives reboots. -MONITOR_CONF="$HOME/.config/hypr/monitors.conf" -if [[ -f $MONITOR_CONF ]]; then - mapfile -t ACTIVE_LINES < <(grep -E '^[[:space:]]*monitor=' "$MONITOR_CONF" | grep -vE 'disable[[:space:]]*$') - if [[ ${#ACTIVE_LINES[@]} -eq 1 ]] && [[ "${ACTIVE_LINES[0]}" =~ ^monitor=,preferred,auto, ]]; then - sed -i -E \ - -e "s|^(monitor=,preferred,auto,).*|\\1${NEW_SCALE}|" \ - -e "s|^([[:space:]]*env[[:space:]]*=[[:space:]]*GDK_SCALE,).*|\\1${NEW_SCALE}|" \ - "$MONITOR_CONF" - fi +# Persist to monitors.lua if the user has a single generic catch-all line, +# so the scale survives reboots. +MONITOR_LUA="$HOME/.config/hypr/monitors.lua" +if [[ -f $MONITOR_LUA ]] && grep -q '^hl\.monitor({ output = "", mode = "preferred", position = "auto", scale = ' "$MONITOR_LUA"; then + sed -i -E \ + -e "s|^(hl\.monitor\(\{ output = \"\", mode = \"preferred\", position = \"auto\", scale = )([^ ]+)( \}\))|\\1${NEW_SCALE}\\3|" \ + -e 's|^hl\.env\("GDK_SCALE", ".*"\)|hl.env("GDK_SCALE", "'"$NEW_SCALE"'")|' \ + "$MONITOR_LUA" fi notify-send -u low "󰍹 Display scaling set to ${NEW_SCALE}x" diff --git a/bin/omarchy-hyprland-toggle b/bin/omarchy-hyprland-toggle index 30345e74..a38723a3 100755 --- a/bin/omarchy-hyprland-toggle +++ b/bin/omarchy-hyprland-toggle @@ -1,29 +1,61 @@ #!/bin/bash # omarchy:summary=Toggle permanent Hyprland flags by copying them into a directory that's sourced entirely. -# omarchy:args= [on|off] +# omarchy:args=[--enabled-notification ] [--disabled-notification ] [on|off|toggle] + +ENABLED_NOTIFICATION="" +DISABLED_NOTIFICATION="" + +while (($# > 0)); do + case $1 in + --enabled-notification) + if (($# < 2)); then + echo "Missing value for $1" >&2 + exit 1 + fi + ENABLED_NOTIFICATION="$2" + shift 2 + ;; + --disabled-notification) + if (($# < 2)); then + echo "Missing value for $1" >&2 + exit 1 + fi + DISABLED_NOTIFICATION="$2" + shift 2 + ;; + *) break ;; + esac +done + +if (($# < 1)); then + echo "Usage: omarchy-hyprland-toggle [--enabled-notification ] [--disabled-notification ] [on|off|toggle]" >&2 + exit 1 +fi FLAG_NAME="$1" ACTION="${2:-toggle}" -FLAG="$HOME/.local/state/omarchy/toggles/hypr/$FLAG_NAME.conf" -FLAG_SOURCE="$OMARCHY_PATH/default/hypr/toggles/$FLAG_NAME.conf" +FLAG_FILE="$HOME/.local/state/omarchy/toggles/hypr/$FLAG_NAME.lua" +FLAG_SOURCE="$OMARCHY_PATH/default/hypr/toggles/$FLAG_NAME.lua" on() { if [[ -f $FLAG_SOURCE ]]; then - mkdir -p "$(dirname "$FLAG")" - cp "$FLAG_SOURCE" "$FLAG" + mkdir -p "$(dirname "$FLAG_FILE")" + cp "$FLAG_SOURCE" "$FLAG_FILE" + [[ -n $ENABLED_NOTIFICATION ]] && notify-send -u low "$ENABLED_NOTIFICATION" else - echo "Flag not found: $FLAG_NAME" + echo "Flag not found: $FLAG_NAME" >&2 exit 1 fi } off() { - rm -f "$FLAG" + rm -f "$FLAG_FILE" + [[ -n $DISABLED_NOTIFICATION ]] && notify-send -u low "$DISABLED_NOTIFICATION" } toggle() { - if [[ -f $FLAG ]]; then + if [[ -f $FLAG_FILE ]]; then off echo "off" else @@ -37,7 +69,7 @@ case $ACTION in off) off ;; toggle) toggle ;; *) - echo "Usage: omarchy-hyprland-toggle [on|off]" + echo "Usage: omarchy-hyprland-toggle [--enabled-notification ] [--disabled-notification ] [on|off|toggle]" >&2 exit 1 ;; esac diff --git a/bin/omarchy-hyprland-toggle-disabled b/bin/omarchy-hyprland-toggle-disabled index 51707491..5414e2b5 100755 --- a/bin/omarchy-hyprland-toggle-disabled +++ b/bin/omarchy-hyprland-toggle-disabled @@ -3,4 +3,4 @@ # omarchy:summary=Check if a Hyprland toggle is currently disabled (missing). # omarchy:args= -[[ ! -f "$HOME/.local/state/omarchy/toggles/hypr/$1.conf" ]] +[[ ! -f "$HOME/.local/state/omarchy/toggles/hypr/$1.lua" ]] diff --git a/bin/omarchy-hyprland-toggle-enabled b/bin/omarchy-hyprland-toggle-enabled index cdc4e718..73bb7ba1 100755 --- a/bin/omarchy-hyprland-toggle-enabled +++ b/bin/omarchy-hyprland-toggle-enabled @@ -3,4 +3,4 @@ # omarchy:summary=Check if a Hyprland toggle is currently enabled. # omarchy:args= -[[ -f "$HOME/.local/state/omarchy/toggles/hypr/$1.conf" ]] +[[ -f "$HOME/.local/state/omarchy/toggles/hypr/$1.lua" ]] diff --git a/bin/omarchy-hyprland-window-close-all b/bin/omarchy-hyprland-window-close-all index dbf0d758..c88a640c 100755 --- a/bin/omarchy-hyprland-window-close-all +++ b/bin/omarchy-hyprland-window-close-all @@ -4,7 +4,9 @@ hyprctl clients -j | \ jq -r ".[].address" | \ - xargs -I{} hyprctl dispatch closewindow address:{} + while read -r addr; do + hyprctl dispatch "hl.dsp.window.close(\"address:$addr\")" >/dev/null 2>&1 || hyprctl dispatch closewindow "address:$addr" + done # Move to first workspace -hyprctl dispatch workspace 1 +hyprctl dispatch 'hl.dsp.focus({ workspace = "1" })' >/dev/null 2>&1 || hyprctl dispatch workspace 1 diff --git a/bin/omarchy-hyprland-window-pop b/bin/omarchy-hyprland-window-pop index 05451076..c115e091 100755 --- a/bin/omarchy-hyprland-window-pop +++ b/bin/omarchy-hyprland-window-pop @@ -11,24 +11,30 @@ y=${4:-} active=$(hyprctl activewindow -j) pinned=$(echo "$active" | jq ".pinned") addr=$(echo "$active" | jq -r ".address") +window="address:$addr" + +hypr_dispatch() { + local lua="$1" + shift + + hyprctl dispatch "$lua" >/dev/null 2>&1 || hyprctl dispatch "$@" >/dev/null +} if [[ $pinned == "true" ]]; then - hyprctl -q --batch \ - "dispatch pin address:$addr;" \ - "dispatch togglefloating address:$addr;" \ - "dispatch tagwindow -pop address:$addr;" + hypr_dispatch "hl.dsp.window.pin({ window = \"$window\" })" pin "$window" + hypr_dispatch "hl.dsp.window.float({ window = \"$window\", action = \"toggle\" })" togglefloating "$window" + hypr_dispatch "hl.dsp.window.tag({ window = \"$window\", tag = \"-pop\" })" tagwindow -pop "$window" elif [[ -n $addr ]]; then - hyprctl dispatch togglefloating address:$addr - hyprctl dispatch resizeactive exact $width $height address:$addr + hypr_dispatch "hl.dsp.window.float({ window = \"$window\", action = \"toggle\" })" togglefloating "$window" + hypr_dispatch "hl.dsp.window.resize({ window = \"$window\", x = $width, y = $height })" resizeactive exact "$width" "$height" "$window" if [[ -n $x && -n $y ]]; then - hyprctl dispatch moveactive $x $y address:$addr + hypr_dispatch "hl.dsp.window.move({ window = \"$window\", x = $x, y = $y })" moveactive "$x" "$y" "$window" else - hyprctl dispatch centerwindow address:$addr + hypr_dispatch "hl.dsp.window.center({ window = \"$window\" })" centerwindow "$window" fi - hyprctl -q --batch \ - "dispatch pin address:$addr;" \ - "dispatch alterzorder top address:$addr;" \ - "dispatch tagwindow +pop address:$addr;" + hypr_dispatch "hl.dsp.window.pin({ window = \"$window\" })" pin "$window" + hypr_dispatch "hl.dsp.window.alter_zorder({ window = \"$window\", mode = \"top\" })" alterzorder top "$window" + hypr_dispatch "hl.dsp.window.tag({ window = \"$window\", tag = \"+pop\" })" tagwindow +pop "$window" fi diff --git a/bin/omarchy-hyprland-window-transparency-toggle b/bin/omarchy-hyprland-window-transparency-toggle index 81afc272..1235969d 100755 --- a/bin/omarchy-hyprland-window-transparency-toggle +++ b/bin/omarchy-hyprland-window-transparency-toggle @@ -2,4 +2,6 @@ # omarchy:summary=Toggles transparency for the currently focused window. -hyprctl dispatch setprop "address:$(hyprctl activewindow -j | jq -r '.address')" opaque toggle +addr=$(hyprctl activewindow -j | jq -r '.address') +hyprctl dispatch "hl.dsp.window.set_prop({ window = \"address:$addr\", prop = \"opaque\", value = \"toggle\" })" >/dev/null 2>&1 || \ + hyprctl dispatch setprop "address:$addr" opaque toggle diff --git a/bin/omarchy-hyprland-workspace-layout-toggle b/bin/omarchy-hyprland-workspace-layout-toggle index 4636e38e..7335ff5d 100755 --- a/bin/omarchy-hyprland-workspace-layout-toggle +++ b/bin/omarchy-hyprland-workspace-layout-toggle @@ -10,5 +10,6 @@ case "$CURRENT_LAYOUT" in *) NEW_LAYOUT=dwindle ;; esac -hyprctl keyword workspace $ACTIVE_WORKSPACE, layout:$NEW_LAYOUT +hyprctl eval "hl.workspace_rule({ workspace = \"$ACTIVE_WORKSPACE\", layout = \"$NEW_LAYOUT\" })" >/dev/null 2>&1 || \ + hyprctl keyword workspace $ACTIVE_WORKSPACE, layout:$NEW_LAYOUT notify-send -u low "󱂬 Workspace layout set to $NEW_LAYOUT" diff --git a/bin/omarchy-launch-or-focus b/bin/omarchy-launch-or-focus index 44164bb5..11f65c5f 100755 --- a/bin/omarchy-launch-or-focus +++ b/bin/omarchy-launch-or-focus @@ -13,7 +13,7 @@ LAUNCH_COMMAND="${2:-"uwsm-app -- $WINDOW_PATTERN"}" WINDOW_ADDRESS=$(hyprctl clients -j | jq -r --arg p "$WINDOW_PATTERN" '.[]|select((.class|test("\\b" + $p + "\\b";"i")) or (.title|test("\\b" + $p + "\\b";"i")))|.address' | head -n1) if [[ -n $WINDOW_ADDRESS ]]; then - hyprctl dispatch focuswindow "address:$WINDOW_ADDRESS" + hyprctl dispatch "hl.dsp.focus({ window = \"address:$WINDOW_ADDRESS\" })" >/dev/null 2>&1 || hyprctl dispatch focuswindow "address:$WINDOW_ADDRESS" else eval exec setsid $LAUNCH_COMMAND fi diff --git a/bin/omarchy-launch-screensaver b/bin/omarchy-launch-screensaver index 0cd64a70..1bf445f7 100755 --- a/bin/omarchy-launch-screensaver +++ b/bin/omarchy-launch-screensaver @@ -20,35 +20,31 @@ walker -q focused=$(omarchy-hyprland-monitor-focused) terminal=$(xdg-terminal-exec --print-id) +hypr_focus_monitor() { + hyprctl dispatch "hl.dsp.focus({ monitor = \"$1\" })" >/dev/null 2>&1 || hyprctl dispatch focusmonitor "$1" >/dev/null +} + +hypr_exec() { + local command="$1" + + hyprctl dispatch "hl.dsp.exec_cmd([[$command]])" >/dev/null 2>&1 || hyprctl dispatch exec -- bash -lc "$command" >/dev/null +} + for m in $(hyprctl monitors -j | jq -r '.[] | .name'); do - hyprctl dispatch focusmonitor $m + hypr_focus_monitor "$m" case $terminal in *Alacritty*) - hyprctl dispatch exec -- \ - alacritty --class=org.omarchy.screensaver \ - --config-file ~/.local/share/omarchy/default/alacritty/screensaver.toml \ - -e omarchy-screensaver + hypr_exec "alacritty --class=org.omarchy.screensaver --config-file ~/.local/share/omarchy/default/alacritty/screensaver.toml -e omarchy-screensaver" ;; *ghostty*) - hyprctl dispatch exec -- \ - ghostty --class=org.omarchy.screensaver \ - --config-file=~/.local/share/omarchy/default/ghostty/screensaver \ - --font-size=18 \ - -e omarchy-screensaver + hypr_exec "ghostty --class=org.omarchy.screensaver --config-file=~/.local/share/omarchy/default/ghostty/screensaver --font-size=18 -e omarchy-screensaver" ;; *foot*) - hyprctl dispatch exec -- \ - foot --app-id=org.omarchy.screensaver \ - --config="$OMARCHY_PATH/default/foot/screensaver.ini" \ - -e omarchy-screensaver + hypr_exec "foot --app-id=org.omarchy.screensaver --config=\"$OMARCHY_PATH/default/foot/screensaver.ini\" -e omarchy-screensaver" ;; *kitty*) - hyprctl dispatch exec -- \ - kitty --class=org.omarchy.screensaver \ - --override font_size=18 \ - --override window_padding_width=0 \ - -e omarchy-screensaver + hypr_exec "kitty --class=org.omarchy.screensaver --override font_size=18 --override window_padding_width=0 -e omarchy-screensaver" ;; *) notify-send -u low "✋ Screensaver only runs in Alacritty, Foot, Ghostty, or Kitty" @@ -56,4 +52,4 @@ for m in $(hyprctl monitors -j | jq -r '.[] | .name'); do esac done -hyprctl dispatch focusmonitor $focused +hypr_focus_monitor "$focused" diff --git a/bin/omarchy-menu b/bin/omarchy-menu index 93908a5f..dfac208f 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -56,6 +56,11 @@ open_in_editor() { omarchy-launch-editor "$1" } +hypr_config_file() { + local name="$1" + printf '%s/.config/hypr/%s.lua' "$HOME" "$name" +} + install() { present_terminal "echo 'Installing $1...'; omarchy-pkg-add $2" } @@ -272,7 +277,7 @@ show_style_menu() { *Font*) show_font_menu ;; *Background*) show_background_menu ;; *Corners*) show_style_corners_menu ;; - *Hyprland*) open_in_editor ~/.config/hypr/looknfeel.conf ;; + *Hyprland*) open_in_editor "$(hypr_config_file looknfeel)" ;; *Waybar*) show_waybar_position_menu ;; *Screensaver*) show_screensaver_menu ;; *About*) show_about_menu ;; @@ -335,8 +340,8 @@ show_font_menu() { show_setup_menu() { local options=" Audio\n Wifi\n󰂯 Bluetooth\n󱐋 Power Profile\n System Sleep\n󰍹 Monitors" - [[ -f ~/.config/hypr/bindings.conf ]] && options="$options\n Keybindings" - [[ -f ~/.config/hypr/input.conf ]] && options="$options\n Input" + [[ -f ~/.config/hypr/bindings.lua ]] && options="$options\n Keybindings" + [[ -f ~/.config/hypr/input.lua ]] && options="$options\n Input" options="$options\n Defaults\n󰱔 DNS\n Security\n Config" case $(menu "Setup" "$options") in @@ -345,9 +350,9 @@ show_setup_menu() { *Bluetooth*) omarchy-launch-bluetooth ;; *Power*) show_setup_power_menu ;; *System*) show_setup_system_menu ;; - *Monitors*) open_in_editor ~/.config/hypr/monitors.conf ;; - *Keybindings*) open_in_editor ~/.config/hypr/bindings.conf ;; - *Input*) open_in_editor ~/.config/hypr/input.conf ;; + *Monitors*) open_in_editor "$(hypr_config_file monitors)" ;; + *Keybindings*) open_in_editor "$(hypr_config_file bindings)" ;; + *Input*) open_in_editor "$(hypr_config_file input)" ;; *Defaults*) show_setup_default_menu ;; *DNS*) present_terminal omarchy-setup-dns ;; *Security*) show_setup_security_menu ;; @@ -482,7 +487,7 @@ show_setup_default_editor_menu() { show_setup_config_menu() { case $(menu "Setup" " Hyprland\n Hypridle\n Hyprlock\n Hyprsunset\n Swayosd\n󰌧 Walker\n󰍜 Waybar\n󰞅 XCompose") in - *Hyprland*) open_in_editor ~/.config/hypr/hyprland.conf ;; + *Hyprland*) open_in_editor "$(hypr_config_file hyprland)" ;; *Hypridle*) open_in_editor ~/.config/hypr/hypridle.conf && omarchy-restart-hypridle ;; *Hyprlock*) open_in_editor ~/.config/hypr/hyprlock.conf ;; *Hyprsunset*) open_in_editor ~/.config/hypr/hyprsunset.conf && omarchy-restart-hyprsunset ;; diff --git a/bin/omarchy-refresh-hyprland b/bin/omarchy-refresh-hyprland index 58618014..1ebd1ab3 100755 --- a/bin/omarchy-refresh-hyprland +++ b/bin/omarchy-refresh-hyprland @@ -1,11 +1,12 @@ #!/bin/bash -# omarchy:summary=Overwrite all the user configs in ~/.config/hypr with the Omarchy defaults. +# omarchy:summary=Overwrite all the user Hyprland Lua configs in ~/.config/hypr with the Omarchy defaults. -omarchy-refresh-config hypr/autostart.conf -omarchy-refresh-config hypr/bindings.conf -omarchy-refresh-config hypr/input.conf -omarchy-refresh-config hypr/looknfeel.conf -omarchy-refresh-config hypr/hyprland.conf -omarchy-refresh-config hypr/monitors.conf +omarchy-refresh-config hypr/.luarc.json +omarchy-refresh-config hypr/autostart.lua +omarchy-refresh-config hypr/bindings.lua +omarchy-refresh-config hypr/input.lua +omarchy-refresh-config hypr/looknfeel.lua +omarchy-refresh-config hypr/hyprland.lua +omarchy-refresh-config hypr/monitors.lua bash "$OMARCHY_PATH/install/config/detect-keyboard-layout.sh" diff --git a/bin/omarchy-remove-preinstalls b/bin/omarchy-remove-preinstalls index fc5eae72..e54dedf2 100755 --- a/bin/omarchy-remove-preinstalls +++ b/bin/omarchy-remove-preinstalls @@ -8,8 +8,8 @@ if gum confirm "Are you sure you want to remove all preinstalled web apps, TUI w omarchy-webapp-remove-all omarchy-tui-remove-all - cp ~/.config/hypr/bindings.conf ~/.config/hypr/bindings.conf.bak - cp "$OMARCHY_PATH/default/hypr/plain-bindings.conf" ~/.config/hypr/bindings.conf + [[ -f ~/.config/hypr/bindings.lua ]] && cp ~/.config/hypr/bindings.lua ~/.config/hypr/bindings.lua.bak + cp "$OMARCHY_PATH/default/hypr/plain-bindings.lua" ~/.config/hypr/bindings.lua hyprctl reload # Remove npx stubs diff --git a/bin/omarchy-screensaver b/bin/omarchy-screensaver index 536ae0e3..9a3ed6cf 100755 --- a/bin/omarchy-screensaver +++ b/bin/omarchy-screensaver @@ -7,7 +7,7 @@ screensaver_in_focus() { } exit_screensaver() { - hyprctl keyword cursor:invisible false &>/dev/null || true + hyprctl eval 'hl.config({ cursor = { invisible = false } })' &>/dev/null || hyprctl keyword cursor:invisible false &>/dev/null || true pkill -x tte 2>/dev/null pkill -f org.omarchy.screensaver 2>/dev/null exit 0 @@ -18,7 +18,7 @@ trap exit_screensaver SIGINT SIGTERM SIGHUP SIGQUIT printf '\033]11;rgb:00/00/00\007' # Set background color to black -hyprctl keyword cursor:invisible true &>/dev/null +hyprctl eval 'hl.config({ cursor = { invisible = true } })' &>/dev/null || hyprctl keyword cursor:invisible true &>/dev/null tty=$(tty 2>/dev/null) diff --git a/bin/omarchy-toggle-touchpad b/bin/omarchy-toggle-touchpad index 06764dab..15ad4ca5 100755 --- a/bin/omarchy-toggle-touchpad +++ b/bin/omarchy-toggle-touchpad @@ -3,7 +3,7 @@ # omarchy:summary=Enable, disable, or toggle the touchpad # omarchy:args=[on|off|toggle] -STATE_CONF="$HOME/.local/state/omarchy/toggles/hypr/touchpad-disabled.conf" +STATE_FILE="$HOME/.local/state/omarchy/toggles/hypr/touchpad-disabled.lua" device="$(omarchy-hw-touchpad)" @@ -13,20 +13,20 @@ if [[ -z $device ]]; then fi enable() { - hyprctl keyword "device[$device]:enabled" true >/dev/null - rm -f "$STATE_CONF" + hyprctl eval "hl.device({ name = \"$device\", enabled = true })" >/dev/null + rm -f "$STATE_FILE" omarchy-swayosd-client --custom-icon input-touchpad-symbolic --custom-message "Touchpad enabled" } disable() { - hyprctl keyword "device[$device]:enabled" false >/dev/null - mkdir -p "$(dirname "$STATE_CONF")" - printf 'device {\n name = %s\n enabled = false\n}\n' "$device" > "$STATE_CONF" + hyprctl eval "hl.device({ name = \"$device\", enabled = false })" >/dev/null + mkdir -p "$(dirname "$STATE_FILE")" + printf 'hl.device({ name = "%s", enabled = false })\n' "$device" >"$STATE_FILE" omarchy-swayosd-client --custom-icon touchpad-disabled-symbolic --custom-message "Touchpad disabled" } case "${1:-toggle}" in on) enable ;; off) disable ;; - toggle) if [[ -f $STATE_CONF ]]; then enable; else disable; fi ;; + toggle) if [[ -f $STATE_FILE ]]; then enable; else disable; fi ;; esac diff --git a/bin/omarchy-toggle-touchscreen b/bin/omarchy-toggle-touchscreen index a0b5ccb0..7225c793 100755 --- a/bin/omarchy-toggle-touchscreen +++ b/bin/omarchy-toggle-touchscreen @@ -3,7 +3,7 @@ # omarchy:summary=Enable, disable, or toggle the touch functionality of the screen # omarchy:args=[on|off|toggle] -STATE_CONF="$HOME/.local/state/omarchy/toggles/hypr/touchscreen-disabled.conf" +STATE_FILE="$HOME/.local/state/omarchy/toggles/hypr/touchscreen-disabled.lua" device="$(omarchy-hw-touchscreen)" @@ -13,20 +13,20 @@ if [[ -z $device ]]; then fi enable() { - hyprctl keyword "device[$device]:enabled" true >/dev/null - rm -f "$STATE_CONF" + hyprctl eval "hl.device({ name = \"$device\", enabled = true })" >/dev/null + rm -f "$STATE_FILE" omarchy-swayosd-client --custom-icon device-support-touch-symbolic --custom-message "Touchscreen enabled" } disable() { - hyprctl keyword "device[$device]:enabled" false >/dev/null - mkdir -p "$(dirname "$STATE_CONF")" - printf 'device {\n name = %s\n enabled = false\n}\n' "$device" > "$STATE_CONF" + hyprctl eval "hl.device({ name = \"$device\", enabled = false })" >/dev/null + mkdir -p "$(dirname "$STATE_FILE")" + printf 'hl.device({ name = "%s", enabled = false })\n' "$device" >"$STATE_FILE" omarchy-swayosd-client --custom-icon touch-disabled-symbolic --custom-message "Touchscreen disabled" } case "${1:-toggle}" in on) enable ;; off) disable ;; - toggle) if [[ -f $STATE_CONF ]]; then enable; else disable; fi ;; + toggle) if [[ -f $STATE_FILE ]]; then enable; else disable; fi ;; esac diff --git a/bin/omarchy-update-git b/bin/omarchy-update-git index 5c64b624..c3e63008 100755 --- a/bin/omarchy-update-git +++ b/bin/omarchy-update-git @@ -9,7 +9,7 @@ echo -e "\e[32mUpdate Omarchy\e[0m" omarchy-update-time # Suppress Hyprland config errors while git updates default config files mid-pull -hyprctl keyword debug:suppress_errors true &>/dev/null || true +hyprctl eval 'hl.config({ debug = { suppress_errors = true } })' &>/dev/null || hyprctl keyword debug:suppress_errors true &>/dev/null || true git -C $OMARCHY_PATH pull --autostash git -C $OMARCHY_PATH --no-pager diff --check || git -C $OMARCHY_PATH reset --merge diff --git a/bin/omarchy-update-perform b/bin/omarchy-update-perform index 6e892610..14d85e18 100755 --- a/bin/omarchy-update-perform +++ b/bin/omarchy-update-perform @@ -6,7 +6,7 @@ set -e # Ensure screensaver/sleep doesn't set in during updates -hyprctl dispatch tagwindow +noidle &>/dev/null || true +hyprctl dispatch 'hl.dsp.window.tag({ tag = "+noidle" })' &>/dev/null || hyprctl dispatch tagwindow +noidle &>/dev/null || true # Perform all update steps omarchy-update-keyring @@ -22,4 +22,4 @@ omarchy-update-analyze-logs omarchy-update-restart # Re-enable screensaver/sleep after updates -hyprctl dispatch tagwindow -- -noidle &>/dev/null || true +hyprctl dispatch 'hl.dsp.window.tag({ tag = "-noidle" })' &>/dev/null || hyprctl dispatch tagwindow -- -noidle &>/dev/null || true diff --git a/config/elephant/symbols.toml b/config/elephant/symbols.toml index 3144c152..d06e9204 100644 --- a/config/elephant/symbols.toml +++ b/config/elephant/symbols.toml @@ -1 +1 @@ -command = 'wl-copy && hyprctl dispatch sendshortcut "SHIFT, Insert,"' +command = 'wl-copy && (hyprctl dispatch "hl.dsp.send_shortcut({ mods = \"SHIFT\", key = \"Insert\" })" || hyprctl dispatch sendshortcut "SHIFT, Insert,")' diff --git a/config/systemd/user/omarchy-recover-internal-monitor.service b/config/systemd/user/omarchy-recover-internal-monitor.service index fef52180..b890f3fa 100644 --- a/config/systemd/user/omarchy-recover-internal-monitor.service +++ b/config/systemd/user/omarchy-recover-internal-monitor.service @@ -1,7 +1,7 @@ [Unit] Description=Recover the internal monitor toggle when no external display is connected Before=graphical-session-pre.target -ConditionPathExists=%h/.local/state/omarchy/toggles/hypr/internal-monitor-disable.conf +ConditionPathExists=%h/.local/state/omarchy/toggles/hypr/internal-monitor-disable.lua [Service] Type=oneshot diff --git a/install/config/detect-keyboard-layout.sh b/install/config/detect-keyboard-layout.sh index aaaee4f8..576d7975 100644 --- a/install/config/detect-keyboard-layout.sh +++ b/install/config/detect-keyboard-layout.sh @@ -1,13 +1,13 @@ # Copy over the keyboard layout that's been set in Arch during install to Hyprland conf="/etc/vconsole.conf" -hyprconf="$HOME/.config/hypr/input.conf" +hyprlua="$HOME/.config/hypr/input.lua" -if grep -q '^XKBLAYOUT=' "$conf"; then +if [[ -f $conf && -f $hyprlua ]] && grep -q '^XKBLAYOUT=' "$conf"; then layout=$(grep '^XKBLAYOUT=' "$conf" | cut -d= -f2 | tr -d '"') - sed -i "/^[[:space:]]*kb_options *=/i\ kb_layout = $layout" "$hyprconf" + sed -i "/^[[:space:]]*kb_options *=/i\ kb_layout = \"$layout\"," "$hyprlua" fi -if grep -q '^XKBVARIANT=' "$conf"; then +if [[ -f $conf && -f $hyprlua ]] && grep -q '^XKBVARIANT=' "$conf"; then variant=$(grep '^XKBVARIANT=' "$conf" | cut -d= -f2 | tr -d '"') - sed -i "/^[[:space:]]*kb_options *=/i\ kb_variant = $variant" "$hyprconf" + sed -i "/^[[:space:]]*kb_options *=/i\ kb_variant = \"$variant\"," "$hyprlua" fi diff --git a/install/config/hardware/nvidia.sh b/install/config/hardware/nvidia.sh index dddcf7e4..c38f8e98 100644 --- a/install/config/hardware/nvidia.sh +++ b/install/config/hardware/nvidia.sh @@ -30,20 +30,20 @@ EOF # Add NVIDIA environment variables based on GPU architecture if [[ $GPU_ARCH = "turing_plus" ]]; then # Turing+ (RTX 20xx, GTX 16xx, and newer) with GSP firmware support - cat >>"$HOME/.config/hypr/envs.conf" <<'EOF' + cat >>"$HOME/.config/hypr/envs.lua" <<'EOF' -# NVIDIA (Turing+ with GSP firmware) -env = NVD_BACKEND,direct -env = LIBVA_DRIVER_NAME,nvidia -env = __GLX_VENDOR_LIBRARY_NAME,nvidia +-- NVIDIA (Turing+ with GSP firmware) +hl.env("NVD_BACKEND", "direct") +hl.env("LIBVA_DRIVER_NAME", "nvidia") +hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia") EOF elif [[ $GPU_ARCH = "maxwell_pascal_volta" ]]; then # Maxwell/Pascal/Volta (GTX 9xx/10xx, GT 10xx, Quadro P/M/GV, MX series, Titan X/Xp/V) lack GSP firmware - cat >>"$HOME/.config/hypr/envs.conf" <<'EOF' + cat >>"$HOME/.config/hypr/envs.lua" <<'EOF' -# NVIDIA (Maxwell/Pascal/Volta without GSP firmware) -env = NVD_BACKEND,egl -env = __GLX_VENDOR_LIBRARY_NAME,nvidia +-- NVIDIA (Maxwell/Pascal/Volta without GSP firmware) +hl.env("NVD_BACKEND", "egl") +hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia") EOF fi fi diff --git a/install/config/omarchy-toggles.sh b/install/config/omarchy-toggles.sh index b4b5ea93..4a6687f4 100644 --- a/install/config/omarchy-toggles.sh +++ b/install/config/omarchy-toggles.sh @@ -1,3 +1,3 @@ # Toggles are used to turn certain features on/off in a persistent way mkdir -p ~/.local/state/omarchy/toggles/hypr -cp $OMARCHY_PATH/default/hypr/toggles/flags.conf ~/.local/state/omarchy/toggles/hypr/ +cp "$OMARCHY_PATH/default/hypr/toggles/flags.lua" ~/.local/state/omarchy/toggles/hypr/ diff --git a/install/login/sddm.sh b/install/login/sddm.sh index f97243cb..05d45b86 100644 --- a/install/login/sddm.sh +++ b/install/login/sddm.sh @@ -4,7 +4,8 @@ omarchy-refresh-sddm # Setup SDDM login service sudo mkdir -p /usr/local/share/wayland-sessions sudo cp "$OMARCHY_PATH/default/wayland-sessions/omarchy.desktop" /usr/local/share/wayland-sessions/omarchy.desktop -sudo cp "$OMARCHY_PATH/default/sddm/hyprland.conf" /usr/share/sddm/hyprland.conf +sudo cp "$OMARCHY_PATH/default/sddm/hyprland.lua" /usr/share/sddm/hyprland.lua +sudo rm -f /usr/share/sddm/hyprland.conf sudo mkdir -p /etc/sddm.conf.d cat </dev/null @@ -12,7 +13,7 @@ cat </dev/null DisplayServer=wayland [Wayland] -CompositorCommand=start-hyprland -- --config /usr/share/sddm/hyprland.conf +CompositorCommand=start-hyprland -- --config /usr/share/sddm/hyprland.lua EOF if [[ ! -f /etc/sddm.conf.d/autologin.conf ]]; then From e39206f24d53820841c4baea8bbfa0114ff4799f Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sun, 10 May 2026 02:27:04 -0400 Subject: [PATCH 8/9] Simplify montor scaling --- bin/omarchy-hyprland-monitor-scaling-cycle | 17 +++++++++++----- config/hypr/monitors.lua | 23 +++++++++++++--------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/bin/omarchy-hyprland-monitor-scaling-cycle b/bin/omarchy-hyprland-monitor-scaling-cycle index c88a87b3..9addd89c 100755 --- a/bin/omarchy-hyprland-monitor-scaling-cycle +++ b/bin/omarchy-hyprland-monitor-scaling-cycle @@ -9,8 +9,9 @@ WIDTH=$(echo "$MONITOR_INFO" | jq -r '.width') HEIGHT=$(echo "$MONITOR_INFO" | jq -r '.height') REFRESH_RATE=$(echo "$MONITOR_INFO" | jq -r '.refreshRate') -# Cycle through scales: 1 → 1.25 → 1.6 → 2 → 3 → 4 → 1 (or reverse with --reverse) +# Cycle through monitor/GDK scale pairs: 1 → 1.25 → 1.6 → 2 → 3 → 4 → 1 (or reverse with --reverse) SCALES=(1 1.25 1.6 2 3 4) +GDK_SCALES=(1 1.25 1.75 2 3 4) # Find the index of the scale closest to the current one (Hyprland may # snap fractional scales to nearby values, so we can't match exactly) @@ -31,16 +32,22 @@ else fi NEW_SCALE=${SCALES[$NEW_IDX]} +NEW_GDK_SCALE=${GDK_SCALES[$NEW_IDX]} hyprctl eval "hl.monitor({ output = \"$ACTIVE_MONITOR\", mode = \"${WIDTH}x${HEIGHT}@${REFRESH_RATE}\", position = \"auto\", scale = $NEW_SCALE })" >/dev/null -# Persist to monitors.lua if the user has a single generic catch-all line, -# so the scale survives reboots. +# Persist to monitors.lua if the user still has Omarchy's generic catch-all +# defaults, so the scale survives reboots. MONITOR_LUA="$HOME/.config/hypr/monitors.lua" -if [[ -f $MONITOR_LUA ]] && grep -q '^hl\.monitor({ output = "", mode = "preferred", position = "auto", scale = ' "$MONITOR_LUA"; then +if [[ -f $MONITOR_LUA ]] && grep -q '^local omarchy_monitor_scale = ' "$MONITOR_LUA"; then + sed -i -E \ + -e "s|^local omarchy_monitor_scale = .*|local omarchy_monitor_scale = ${NEW_SCALE}|" \ + -e "s|^local omarchy_gdk_scale = .*|local omarchy_gdk_scale = ${NEW_GDK_SCALE}|" \ + "$MONITOR_LUA" +elif [[ -f $MONITOR_LUA ]] && grep -Eq '^hl\.monitor\(\{ output = "", mode = "preferred", position = "auto", scale = ("auto"|[0-9.]+) \}\)' "$MONITOR_LUA"; then sed -i -E \ -e "s|^(hl\.monitor\(\{ output = \"\", mode = \"preferred\", position = \"auto\", scale = )([^ ]+)( \}\))|\\1${NEW_SCALE}\\3|" \ - -e 's|^hl\.env\("GDK_SCALE", ".*"\)|hl.env("GDK_SCALE", "'"$NEW_SCALE"'")|' \ + -e 's|^hl\.env\("GDK_SCALE", ".*"\)|hl.env("GDK_SCALE", "'"$NEW_GDK_SCALE"'")|' \ "$MONITOR_LUA" fi diff --git a/config/hypr/monitors.lua b/config/hypr/monitors.lua index b51a5820..dee9fd8e 100644 --- a/config/hypr/monitors.lua +++ b/config/hypr/monitors.lua @@ -1,18 +1,23 @@ -- See https://wiki.hypr.land/Configuring/Basics/Monitors/ -- List current monitors and resolutions possible: hyprctl monitors all +local omarchy_gdk_scale = 2 +local omarchy_monitor_scale = "auto" + -- Optimized for retina-class 2x displays, like 13" 2.8K, 27" 5K, 32" 6K. -hl.env("GDK_SCALE", "2") -hl.monitor({ output = "", mode = "preferred", position = "auto", scale = "auto" }) +-- local omarchy_gdk_scale = 2 +-- local omarchy_monitor_scale = "auto" --- Good compromise for 27" or 32" 4K monitors (but fractional!) --- hl.env("GDK_SCALE", "1.75") --- hl.monitor({ output = "", mode = "preferred", position = "auto", scale = 1.6 }) +-- Good compromise for 27" or 32" 4K monitors (but fractional!): monitor scale 1.6, GDK scale 1.75. +-- local omarchy_gdk_scale = 1.75 +-- local omarchy_monitor_scale = 1.6 --- Straight 1x setup for low-resolution displays like 1080p or 1440p. --- Or for ultrawide monitors like 34" 3440x1440 or 49" 5120x1440. --- hl.env("GDK_SCALE", "1") --- hl.monitor({ output = "", mode = "preferred", position = "auto", scale = 1 }) +-- Straight 1x setup for low-resolution displays like 1080p, 1440p, or ultrawides: both 1. +-- local omarchy_gdk_scale = 1 +-- local omarchy_monitor_scale = 1 + +hl.env("GDK_SCALE", tostring(omarchy_gdk_scale)) +hl.monitor({ output = "", mode = "preferred", position = "auto", scale = omarchy_monitor_scale }) -- Portrait/rotated secondary monitor (transform: 1 = 90°, 3 = 270°) -- hl.monitor({ output = "DP-2", mode = "preferred", position = "auto", scale = 1, transform = 1 }) From 350b9a33b3024fb9016ef633fc4ca564fdfcada1 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sun, 10 May 2026 02:27:18 -0400 Subject: [PATCH 9/9] Fix keybinds display --- bin/omarchy-menu-keybindings | 162 ++++++++++++++++++++++++++++++----- 1 file changed, 139 insertions(+), 23 deletions(-) diff --git a/bin/omarchy-menu-keybindings b/bin/omarchy-menu-keybindings index b90f69e5..ddaa6106 100755 --- a/bin/omarchy-menu-keybindings +++ b/bin/omarchy-menu-keybindings @@ -21,6 +21,11 @@ declare -A FALLBACK_KEYCODE_SYM_MAP=( [61]="SLASH" ) +# Hyprland's Lua config provider currently reports code:... binds from hl.bind() +# as key="" and keycode=0 in `hyprctl -j binds`. Keep a lightweight +# source-derived key cache so the menu can still show those bindings. +declare -A LUA_BIND_KEY_MAP + build_keymap_cache() { local keymap keymap="$(xkbcli compile-keymap)" || { @@ -108,36 +113,146 @@ parse_keycodes() { fi } -# Fetch dynamic keybindings from Hyprland +# Supplement `hyprctl -j binds` for Lua-only binds that Hyprland currently +# reports without their original key, such as hl.bind("SUPER + code:10", ...). +build_lua_bind_key_cache() { + local modmask description key + + omarchy-cmd-present lua || return 0 + + while IFS=$'\t' read -r modmask description key; do + [[ -z $modmask || -z $description || -z $key ]] && continue + LUA_BIND_KEY_MAP["$modmask,$description"]="$key" + done < <( + lua <<'LUA' +local modifiers = { SHIFT = 1, CTRL = 4, CONTROL = 4, ALT = 8, SUPER = 64 } + +local function split_keys(keys) + local modmask = 0 + local key = "" + + for part in string.gmatch(keys, "[^+]+") do + local value = part:gsub("^%s+", ""):gsub("%s+$", "") + local modifier = modifiers[string.upper(value)] + + if modifier then + modmask = modmask + modifier + else + key = value + end + end + + return modmask, key +end + +local function proxy() + local p = {} + + return setmetatable(p, { + __index = function() + return p + end, + __call = function() + return p + end, + }) +end + +local p = proxy() + +hl = setmetatable({ + dsp = p, + bind = function(keys, _, opts) + opts = opts or {} + if opts.description and opts.description ~= "" then + local modmask, key = split_keys(keys) + print(modmask .. "\t" .. opts.description .. "\t" .. key) + end + return p + end, + unbind = function() end, + config = function() end, + env = function() end, + monitor = function() end, + window_rule = function() end, + gesture = function() end, + animation = function() end, + curve = function() end, + exec_cmd = function() end, +}, { + __index = function() + return function() + return p + end + end, +}) + +local config = (os.getenv("HOME") or "") .. "/.config/hypr/hyprland.lua" +local file = io.open(config, "r") + +if file then + file:close() + local ok, err = pcall(dofile, config) + if not ok and os.getenv("DEBUG") == "1" then + io.stderr:write("[DEBUG] lua bind scan failed: " .. tostring(err) .. "\n") + end +end +LUA + ) +} + +modmask_to_text() { + case "$1" in + 0) printf '' ;; + 1) printf 'SHIFT' ;; + 4) printf 'CTRL' ;; + 5) printf 'SHIFT CTRL' ;; + 8) printf 'ALT' ;; + 9) printf 'SHIFT ALT' ;; + 12) printf 'CTRL ALT' ;; + 13) printf 'SHIFT CTRL ALT' ;; + 64) printf 'SUPER' ;; + 65) printf 'SUPER SHIFT' ;; + 68) printf 'SUPER CTRL' ;; + 69) printf 'SUPER SHIFT CTRL' ;; + 72) printf 'SUPER ALT' ;; + 73) printf 'SUPER SHIFT ALT' ;; + 76) printf 'SUPER CTRL ALT' ;; + 77) printf 'SUPER SHIFT CTRL ALT' ;; + *) printf '%s' "$1" ;; + esac +} + +# Fetch dynamic keybindings from Hyprland. # # Also do some pre-processing: +# - Fill missing Lua code:... keys from the Lua source cache # - Remove standard Omarchy bin path prefix # - Map numeric modifier key mask to a textual rendition # - Output comma-separated values that the parser can understand dynamic_bindings() { + local modmask key keycode description dispatcher arg modifiers + hyprctl -j binds | - jq -r '.[] | {modmask, key, keycode, description, dispatcher, arg} | "\(.modmask),\(.key)@\(.keycode),\(.description),\(.dispatcher),\(.arg)"' | - sed -r \ - -e 's/null//' \ - -e 's,~/.local/share/omarchy/bin/,,' \ - -e 's/@0//' \ - -e 's/,@/,code:/' \ - -e 's/^0,/,/' \ - -e 's/^1,/SHIFT,/' \ - -e 's/^4,/CTRL,/' \ - -e 's/^5,/SHIFT CTRL,/' \ - -e 's/^8,/ALT,/' \ - -e 's/^9,/SHIFT ALT,/' \ - -e 's/^12,/CTRL ALT,/' \ - -e 's/^13,/SHIFT CTRL ALT,/' \ - -e 's/^64,/SUPER,/' \ - -e 's/^65,/SUPER SHIFT,/' \ - -e 's/^68,/SUPER CTRL,/' \ - -e 's/^69,/SUPER SHIFT CTRL,/' \ - -e 's/^72,/SUPER ALT,/' \ - -e 's/^73,/SUPER SHIFT ALT,/' \ - -e 's/^76,/SUPER CTRL ALT,/' \ - -e 's/^77,/SUPER SHIFT CTRL ALT,/' + jq -r '.[] | [.modmask, (.key // ""), (.keycode // 0), (.description // ""), (.dispatcher // ""), (.arg // "") | tostring] | join("\u001f")' | + while IFS=$'\x1f' read -r modmask key keycode description dispatcher arg; do + if [[ -z $key && $keycode != "0" ]]; then + key="code:$keycode" + fi + + if [[ -z $key && -n $description ]]; then + key="${LUA_BIND_KEY_MAP["$modmask,$description"]}" + fi + + [[ -z $description && $dispatcher == "__lua" ]] && continue + + modifiers=$(modmask_to_text "$modmask") + arg="${arg//~\/.local\/share\/omarchy\/bin\//}" + arg="${arg//uwsm app -- /}" + arg="${arg//uwsm-app -- /}" + + printf '%s,%s,%s,%s,%s\n' "$modifiers" "$key" "$description" "$dispatcher" "$arg" + done } # Hardcoded bindings, like the copy-url extension and such @@ -262,6 +377,7 @@ prioritize_entries() { output_binding_records() { build_keymap_cache + build_lua_bind_key_cache { dynamic_bindings