From e9254d12707be63fc9c8fcf1896dcea389e3733f Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 26 Sep 2026 22:39:15 +0100 Subject: [PATCH] Cleaning up --- .config/hypr/.stylua.toml | 3 +- .config/hypr/apps.lua | 178 ++++++++++++------------------------- .config/hypr/autostart.lua | 4 +- 3 files changed, 60 insertions(+), 125 deletions(-) diff --git a/.config/hypr/.stylua.toml b/.config/hypr/.stylua.toml index ba0c6e6..b056308 100644 --- a/.config/hypr/.stylua.toml +++ b/.config/hypr/.stylua.toml @@ -1,6 +1,7 @@ -column_width = 160 +column_width = 80 line_endings = "Unix" indent_type = "Spaces" indent_width = 4 quote_style = "AutoPreferSingle" call_parentheses = "None" +collapse_simple_statement = "Never" diff --git a/.config/hypr/apps.lua b/.config/hypr/apps.lua index a05b374..aa27262 100644 --- a/.config/hypr/apps.lua +++ b/.config/hypr/apps.lua @@ -1,83 +1,78 @@ -- Browser types -hl.window_rule { - name = 'chromium-browser-tags', - tag = '+chromium-based-browser', - match = { - class = '((google-)?[cC]hrom(e|ium)|[bB]rave-browser|[mM]icrosoft-edge|Vivaldi-stable|helium)', - }, -} -hl.window_rule { - name = 'firefox-tags', - tag = '+firefox-based-browser', - match = { - class = '([fF]irefox|zen|librewolf)', - }, -} +local function add_tag_to_matching_class(class, tag) + hl.window_rule { + tag = '+' .. tag, + match = { + class = class, + }, + } +end -hl.window_rule { - name = 'chromium-browser-opacity-tags', - tag = '-default-opacity', - match = { - tag = 'chromium-based-browser', - }, -} -hl.window_rule { - name = 'firefox-browser-opacity-tags', - tag = '-default-opacity', - match = { - tag = 'firefox-based-browser', - }, -} +local function add_tag_to_matching_tag(match_tag, tag) + hl.window_rule { + tag = '+' .. tag, + match = { + tag = match_tag, + }, + } +end + +local function remove_tag_from_matching_class(class, tag) + hl.window_rule { + tag = '-' .. tag, + match = { + class = class, + }, + } +end + +local function remove_tag_from_matching_tag(match_tag, tag) + hl.window_rule { + tag = '-' .. tag, + match = { + tag = match_tag, + }, + } +end + +add_tag_to_matching_class( + '((google-)?[cC]hrom(e|ium)|[bB]rave-browser|[mM]icrosoft-edge|Vivaldi-stable|helium)', + 'chromium-based-browser' +) +add_tag_to_matching_class('([fF]irefox|zen|librewolf)', 'firefox-based-browser') +remove_tag_from_matching_tag('chromium-based-browser', 'default-opacity') +remove_tag_from_matching_tag('firefox-based-browser', 'default-opacity') -- Video apps: remove chromium browser tag so they don't get opacity applied -hl.window_rule { - name = 'video-apps-no-browser-tag', - tag = '-chromium-based-browser', - match = { - class = '(chrome-youtube.com__-Default|chrome-app.zoom.us__wc_home-Default)', - }, -} -hl.window_rule { - name = 'video-apps-no-opacity-tag', - tag = '-default-opacity', - match = { - class = '(chrome-youtube.com__-Default|chrome-app.zoom.us__wc_home-Default)', - }, -} +remove_tag_from_matching_class( + '(chrome-youtube.com__-Default|chrome-app.zoom.us__wc_home-Default)', + 'chromium-based-browser' +) +remove_tag_from_matching_class( + '(chrome-youtube.com__-Default|chrome-app.zoom.us__wc_home-Default)', + 'default-opacity' +) -- Force chromium-based browsers into a tile to deal with --app bug hl.window_rule { - name = 'chromium-tile', tile = true, - match = { - tag = 'chromium-based-browser', - }, + match = { tag = 'chromium-based-browser' }, } -- Only a subtle opacity change, but not for video sites hl.window_rule { - name = 'chromium-browser-subtle-opacity', opacity = '1.0 0.97', match = { tag = 'chromium-based-browser', }, } hl.window_rule { - name = 'firefox-browser-subtle-opacity', opacity = '1.0 0.97', match = { tag = 'firefox-based-browser', }, } -hl.window_rule { - name = 'geforce-now', - idle_inhibit = 'fullscreen', - match = { - class = 'GeForceNOW', - }, -} - -- Remove 1px border around hyprshot screenshots hl.layer_rule { name = 'no-anim-for-selection', @@ -88,8 +83,6 @@ hl.layer_rule { -- Jetbrains -- Fix splash screen showing in weird places and prevent annoying focus takeovers hl.window_rule { - name = 'jetbrains-splash', - tag = '+jetbrains-splash', center = true, no_focus = true, border_size = 0, @@ -102,7 +95,6 @@ hl.window_rule { -- Center popups/find windows hl.window_rule { - name = 'jetbrains-popups', center = true, stay_focused = true, border_size = 0, @@ -172,34 +164,21 @@ hl.window_rule { tag = 'pip', }, } --- Retroarch -hl.window_rule { - name = 'retroarch-fullscreen', - fullscreen = true, - tag = '-default-opacity', - opacity = '1 1', - idle_inhibit = 'fullscreen', - match = { - class = 'com.libretro.RetroArch', - }, -} + -- Scratchpad apps hl.window_rule { - name = 'spotify-scratchpad', workspace = 'special:music', match = { class = 'Spotify|psysonic', }, } hl.window_rule { - name = 'comms-scratchpad', workspace = 'special:comms', match = { class = '^(chrome-discord.com__channels_@me-Default|chrome-web.whatsapp.com__-Default|signal)$', }, } hl.window_rule { - name = 'superproductivity-scratchpad', workspace = 'special:prod', match = { class = '^(superproductivity|org.station.notes)$', @@ -207,7 +186,6 @@ hl.window_rule { } -- Float Nextcloud hl.window_rule { - name = 'nextcloud-float', float = true, match = { class = 'com.nextcloud.desktopclient.nextcloud', @@ -215,7 +193,6 @@ hl.window_rule { } -- Position drawing hl.window_rule { - name = 'krita-drawing', tag = '-default-opacity', opacity = '1 1', no_initial_focus = true, @@ -227,24 +204,7 @@ hl.window_rule { modal = true, }, } --- Float Steam --- hl.window_rule { --- name = 'steam-float', --- float = true, --- no_initial_focus = true, --- idle_inhibit = 'fullscreen', --- match = { --- class = 'steam', --- }, --- } --- hl.window_rule { --- name = 'steam-app-center', --- center = true, --- match = { --- class = 'steam', --- title = 'Steam', --- }, --- } + hl.window_rule { name = 'steam-opacity', tag = '-default-opacity', @@ -261,27 +221,11 @@ hl.window_rule { title = 'Friends List', }, } --- Float Lunar Client -hl.window_rule { - name = 'atlauncher-float', - float = true, - center = true, - size = { 1100, 700 }, - tag = '-default-opacity', - opacity = '1 1', - idle_inhibit = 'fullscreen', - match = { - class = 'atlauncher', - }, -} -- Floating windows -hl.window_rule { - name = 'floating-window-tags', - tag = '+floating-window', - match = { - class = '(org.station.bluetui|org.station.impala|org.station.wiremix|org.station.btop|org.station.terminal|org.station.bash|org.gnome.NautilusPreviewer|org.gnome.Evince|com.gabm.satty|Station|About|TUI.float|imv|mpv)', - }, -} +add_tag_to_matching_class( + '(org.station.bluetui|org.station.impala|org.station.wiremix|org.station.btop|org.station.terminal|org.station.bash|org.gnome.NautilusPreviewer|org.gnome.Evince|com.gabm.satty|Station|About|TUI.float|imv|mpv)', + 'floating-window' +) hl.window_rule { name = 'floating-dialog-tags', tag = '+floating-window', @@ -343,14 +287,6 @@ hl.window_rule { tag = 'noidle', }, } --- Prevent Telegram from stealing focus on new messages -hl.window_rule { - name = 'telegram-no-focus-steal', - focus_on_activate = false, - match = { - class = 'org.telegram.desktop', - }, -} -- Define terminal tag to style them uniformly hl.window_rule { name = 'terminal-tags', diff --git a/.config/hypr/autostart.lua b/.config/hypr/autostart.lua index 3b830b6..a7d799b 100644 --- a/.config/hypr/autostart.lua +++ b/.config/hypr/autostart.lua @@ -1,11 +1,9 @@ hl.on('hyprland.start', function() + notify('Hyprland started', 5000) exec 'uwsm-app -- hypridle' exec 'uwsm-app -- mako' exec 'uwsm-app -- fcitx5 --disable notificationitem' - exec 'uwsm-app -- Enpass -minimize' - exec 'uwsm-app -- steam' exec 'nextcloud' - exec 'station-bg-random' exec '/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1' exec 'dbus-update-activation-environment --systemd --all'