This commit is contained in:
2026-07-21 22:04:54 +01:00
parent dcd46eafb9
commit d07b2e5079
6 changed files with 392 additions and 387 deletions
+224 -223
View File
@@ -1,387 +1,388 @@
-- Browser types
hl.window_rule({
name = "chromium-browser-tags",
tag = "+chromium-based-browser",
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)",
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",
}
hl.window_rule {
name = 'firefox-tags',
tag = '+firefox-based-browser',
match = {
class = "([fF]irefox|zen|librewolf)",
class = '([fF]irefox|zen|librewolf)',
},
})
}
hl.window_rule({
name = "chromium-browser-opacity-tags",
tag = "-default-opacity",
hl.window_rule {
name = 'chromium-browser-opacity-tags',
tag = '-default-opacity',
match = {
tag = "chromium-based-browser",
tag = 'chromium-based-browser',
},
})
hl.window_rule({
name = "firefox-browser-opacity-tags",
tag = "-default-opacity",
}
hl.window_rule {
name = 'firefox-browser-opacity-tags',
tag = '-default-opacity',
match = {
tag = "firefox-based-browser",
tag = 'firefox-based-browser',
},
})
}
-- 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",
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)",
class = '(chrome-youtube.com__-Default|chrome-app.zoom.us__wc_home-Default)',
},
})
hl.window_rule({
name = "video-apps-no-opacity-tag",
tag = "-default-opacity",
}
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)",
class = '(chrome-youtube.com__-Default|chrome-app.zoom.us__wc_home-Default)',
},
})
}
-- Force chromium-based browsers into a tile to deal with --app bug
hl.window_rule({
name = "chromium-tile",
hl.window_rule {
name = 'chromium-tile',
tile = true,
match = {
tag = "chromium-based-browser",
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",
hl.window_rule {
name = 'chromium-browser-subtle-opacity',
opacity = '1.0 0.97',
match = {
tag = "chromium-based-browser",
tag = 'chromium-based-browser',
},
})
hl.window_rule({
name = "firefox-browser-subtle-opacity",
opacity = "1.0 0.97",
}
hl.window_rule {
name = 'firefox-browser-subtle-opacity',
opacity = '1.0 0.97',
match = {
tag = "firefox-based-browser",
tag = 'firefox-based-browser',
},
})
}
hl.window_rule({
name = "geforce-now",
idle_inhibit = "fullscreen",
hl.window_rule {
name = 'geforce-now',
idle_inhibit = 'fullscreen',
match = {
class = "GeForceNOW",
class = 'GeForceNOW',
},
})
}
-- Remove 1px border around hyprshot screenshots
hl.layer_rule({
name = "no-anim-for-selection",
match = { namespace = "selection" },
hl.layer_rule {
name = 'no-anim-for-selection',
match = { namespace = 'selection' },
no_anim = true,
})
}
-- Jetbrains
-- Fix splash screen showing in weird places and prevent annoying focus takeovers
hl.window_rule({
name = "jetbrains-splash",
tag = "+jetbrains-splash",
hl.window_rule {
name = 'jetbrains-splash',
tag = '+jetbrains-splash',
center = true,
no_focus = true,
border_size = 0,
match = {
class = "^(jetbrains-.*)$",
title = "^(splash)$",
class = '^(jetbrains-.*)$',
title = '^(splash)$',
float = true,
},
})
}
-- Center popups/find windows
hl.window_rule({
name = "jetbrains-popups",
hl.window_rule {
name = 'jetbrains-popups',
center = true,
stay_focused = true,
border_size = 0,
min_size = { "(monitor_w*0.5)", "(monitor_h*0.5)" },
tag = "+jetbrains",
min_size = { '(monitor_w*0.5)', '(monitor_h*0.5)' },
tag = '+jetbrains',
match = {
class = "^(jetbrains-.*)$",
title = "^()$",
class = '^(jetbrains-.*)$',
title = '^()$',
float = true,
},
})
}
-- Disable window flicker when autocomplete or tooltips appear
hl.window_rule({
name = "jetbrains-tooltip",
hl.window_rule {
name = 'jetbrains-tooltip',
no_initial_focus = true,
match = {
class = "^(jetbrains-.*)$",
title = "^(win.*)$",
class = '^(jetbrains-.*)$',
title = '^(win.*)$',
float = true,
},
})
}
-- Disable mouse focus
hl.window_rule({
name = "jetbrains-no-follow-mouse",
hl.window_rule {
name = 'jetbrains-no-follow-mouse',
no_follow_mouse = true,
match = {
class = "^(jetbrains-.*)$",
class = '^(jetbrains-.*)$',
},
})
}
-- Keep enpass focused
hl.window_rule({
name = "enpass-assistant",
hl.window_rule {
name = 'enpass-assistant',
stay_focused = true,
center = true,
match = {
class = "^(Enpass)$",
title = "^(Enpass Assistant)$",
class = '^(Enpass)$',
title = '^(Enpass Assistant)$',
},
})
}
-- Float LocalSend and fzf file picker
hl.window_rule({
name = "localsend-float",
hl.window_rule {
name = 'localsend-float',
float = true,
center = true,
match = {
class = "(localsend|Share|fzf-file-picker)",
class = '(localsend|Share|fzf-file-picker)',
},
})
}
-- Picture-in-picture overlays
hl.window_rule({
name = "pip-overlay",
tag = "+pip",
hl.window_rule {
name = 'pip-overlay',
tag = '+pip',
match = {
title = "(Picture.?in.?[Pp]icture)",
title = '(Picture.?in.?[Pp]icture)',
},
})
hl.window_rule({
name = "pip-overlay",
tag = "-default-opacity",
}
hl.window_rule {
name = 'pip-overlay',
tag = '-default-opacity',
float = true,
pin = true,
size = { 600, 338 },
keep_aspect_ratio = true,
border_size = 0,
opacity = "1 1",
opacity = '1 1',
match = {
tag = "pip",
tag = 'pip',
},
})
}
-- Retroarch
hl.window_rule({
name = "retroarch-fullscreen",
hl.window_rule {
name = 'retroarch-fullscreen',
fullscreen = true,
workspace = "name:Gaming_1",
tag = "-default-opacity",
opacity = "1 1",
idle_inhibit = "fullscreen",
workspace = 'name:Gaming_1',
tag = '-default-opacity',
opacity = '1 1',
idle_inhibit = 'fullscreen',
match = {
class = "com.libretro.RetroArch",
class = 'com.libretro.RetroArch',
},
})
}
-- Scratchpad apps
hl.window_rule({
name = "spotify-scratchpad",
workspace = "special:scratchpad",
hl.window_rule {
name = 'spotify-scratchpad',
workspace = 'special:music',
match = {
class = "Spotify",
class = 'Spotify|psysonic',
},
})
hl.window_rule({
name = "signal-scratchpad",
workspace = "special:scratchpad",
}
hl.window_rule {
name = 'comms-scratchpad',
workspace = 'special:comms',
match = {
class = "signal",
class = '^(chrome-discord.com__channels_@me-Default|chrome-web.whatsapp.com__-Default|signal)$',
},
})
hl.window_rule({
name = "discord-scratchpad",
workspace = "special:scratchpad",
}
hl.window_rule {
name = 'superproductivity-scratchpad',
workspace = 'special:prod',
match = {
class = "^(chrome-discord.com__channels_@me-Default)$",
class = '^(superproductivity|org.station.notes)$',
},
})
}
-- Float Nextcloud
hl.window_rule({
name = "nextcloud-float",
hl.window_rule {
name = 'nextcloud-float',
float = true,
match = {
class = "com.nextcloud.desktopclient.nextcloud",
class = 'com.nextcloud.desktopclient.nextcloud',
},
})
}
-- Position drawing
hl.window_rule({
name = "krita-drawing",
workspace = "name:Art_1",
tag = "-default-opacity",
opacity = "1 1",
hl.window_rule {
name = 'krita-drawing',
workspace = 'name:Art_1',
tag = '-default-opacity',
opacity = '1 1',
match = {
class = "(krita)",
class = '(krita)',
},
})
}
-- Float Steam
hl.window_rule({
name = "steam-float",
hl.window_rule {
name = 'steam-float',
float = true,
no_initial_focus = true,
workspace = "name:Gaming_1",
idle_inhibit = "fullscreen",
workspace = 'name:Gaming_1',
idle_inhibit = 'fullscreen',
match = {
class = "steam",
class = 'steam',
},
})
hl.window_rule({
name = "steam-app-size",
}
hl.window_rule {
name = 'steam-app-size',
center = true,
match = {
class = "steam",
title = "Steam",
class = 'steam',
title = 'Steam',
},
})
hl.window_rule({
name = "steam-opacity",
tag = "-default-opacity",
opacity = "1 1",
}
hl.window_rule {
name = 'steam-opacity',
tag = '-default-opacity',
opacity = '1 1',
match = {
class = "steam.*",
class = 'steam.*',
},
})
hl.window_rule({
name = "steam-friends-size",
}
hl.window_rule {
name = 'steam-friends-size',
size = { 460, 800 },
match = {
class = "steam",
title = "Friends List",
class = 'steam',
title = 'Friends List',
},
})
}
-- Float Lunar Client
hl.window_rule({
name = "atlauncher-float",
hl.window_rule {
name = 'atlauncher-float',
float = true,
workspace = "name:Gaming_1",
workspace = 'name:Gaming_1',
center = true,
size = { 1100, 700 },
tag = "-default-opacity",
opacity = "1 1",
idle_inhibit = "fullscreen",
tag = '-default-opacity',
opacity = '1 1',
idle_inhibit = 'fullscreen',
match = {
class = "atlauncher",
class = 'atlauncher',
},
})
}
-- Floating windows
hl.window_rule({
name = "floating-window-tags",
tag = "+floating-window",
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)",
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)',
},
})
hl.window_rule({
name = "floating-dialog-tags",
tag = "+floating-window",
}
hl.window_rule {
name = 'floating-dialog-tags',
tag = '+floating-window',
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.*)",
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.*)',
},
})
hl.window_rule({
name = "floating-window-tags",
tag = "+floating-window",
}
hl.window_rule {
name = 'floating-window-tags',
tag = '+floating-window',
float = true,
center = true,
size = { 875, 600 },
match = {
tag = "floating-window",
tag = 'floating-window',
},
})
}
-- Calculator float
hl.window_rule({
name = "calculator-float",
hl.window_rule {
name = 'calculator-float',
float = true,
match = {
class = "org.gnome.Calculator",
class = 'org.gnome.Calculator',
},
})
}
-- Fullscreen screensaver
hl.window_rule({
name = "screensaver-fullscreen",
hl.window_rule {
name = 'screensaver-fullscreen',
fullscreen = true,
float = true,
animation = "slide",
animation = 'slide',
match = {
class = "org.station.screensaver",
class = 'org.station.screensaver',
},
})
}
-- No transparency on media windows
hl.window_rule({
name = "media-no-opacity",
tag = "-default-opacity",
opacity = "1 1",
hl.window_rule {
name = 'media-no-opacity',
tag = '-default-opacity',
opacity = '1 1',
match = {
class = "^(zoom|vlc|mpv|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta|imv|org.gnome.NautilusPreviewer)$",
class = '^(zoom|vlc|mpv|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta|imv|org.gnome.NautilusPreviewer)$',
},
})
}
-- Popped window rounding
hl.window_rule({
name = "popped-window-rounding",
hl.window_rule {
name = 'popped-window-rounding',
rounding = 8,
match = {
tag = "pop",
tag = 'pop',
},
})
}
-- Prevent idle while open
hl.window_rule({
name = "idle-inhibit-apps",
idle_inhibit = "always",
hl.window_rule {
name = 'idle-inhibit-apps',
idle_inhibit = 'always',
match = {
tag = "noidle",
tag = 'noidle',
},
})
}
-- Prevent Telegram from stealing focus on new messages
hl.window_rule({
name = "telegram-no-focus-steal",
hl.window_rule {
name = 'telegram-no-focus-steal',
focus_on_activate = false,
match = {
class = "org.telegram.desktop",
class = 'org.telegram.desktop',
},
})
}
-- Define terminal tag to style them uniformly
hl.window_rule({
name = "terminal-tags",
tag = "+terminal",
hl.window_rule {
name = 'terminal-tags',
tag = '+terminal',
match = {
class = "(Alacritty|kitty|com.mitchellh.ghostty)",
class = '(Alacritty|kitty|com.mitchellh.ghostty)',
},
})
hl.window_rule({
name = "terminal-opacity-tags",
tag = "-default-opacity",
opacity = "0.97 0.9",
}
hl.window_rule {
name = 'terminal-opacity-tags',
tag = '-default-opacity',
opacity = '0.97 0.9',
match = {
tag = "terminal",
tag = 'terminal',
},
})
}
-- Application-specific animation
hl.layer_rule({
name = "walker-no-anim",
hl.layer_rule {
name = 'walker-no-anim',
no_anim = true,
match = { namespace = "walker" },
})
match = { namespace = 'walker' },
}
-- Webcam overlay for screen recording
hl.window_rule({
name = "webcam-overlay",
hl.window_rule {
name = 'webcam-overlay',
float = true,
pin = true,
no_initial_focus = true,
no_dim = true,
size = { 320, 180 },
move = { "(monitor_w-360)", "(monitor_h-220)" },
move = { '(monitor_w-360)', '(monitor_h-220)' },
match = {
title = "WebcamOverlay",
title = 'WebcamOverlay',
},
})
}