Files
dotfiles/.config/hypr/apps.lua
T
2026-09-30 17:03:12 +01:00

307 lines
6.9 KiB
Lua

-- Browser types
local function add_tag_to_matching_class(class, tag)
hl.window_rule {
tag = '+' .. tag,
match = {
class = class,
},
}
end
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
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 {
tile = true,
match = { tag = 'chromium-based-browser' },
}
-- Only a subtle opacity change, but not for video sites
hl.window_rule {
opacity = '1.0 0.8',
match = {
tag = 'chromium-based-browser',
},
}
hl.window_rule {
opacity = '1.0 0.8',
match = {
tag = 'firefox-based-browser',
},
}
-- Remove 1px border around hyprshot screenshots
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 {
center = true,
no_focus = true,
border_size = 0,
match = {
class = '^(jetbrains-.*)$',
title = '^(splash)$',
float = true,
},
}
-- Center popups/find windows
hl.window_rule {
center = true,
stay_focused = true,
border_size = 0,
min_size = { '(monitor_w*0.5)', '(monitor_h*0.5)' },
tag = '+jetbrains',
match = {
class = '^(jetbrains-.*)$',
title = '^()$',
float = true,
},
}
-- Disable window flicker when autocomplete or tooltips appear
hl.window_rule {
name = 'jetbrains-tooltip',
no_initial_focus = true,
match = {
class = '^(jetbrains-.*)$',
title = '^(win.*)$',
float = true,
},
}
-- Disable mouse focus
hl.window_rule {
name = 'jetbrains-no-follow-mouse',
no_follow_mouse = true,
match = {
class = '^(jetbrains-.*)$',
},
}
-- Keep enpass focused
hl.window_rule {
name = 'enpass-assistant',
stay_focused = true,
center = true,
match = {
class = '^(Enpass)$',
title = '^(Enpass Assistant)$',
},
}
-- Float LocalSend and fzf file picker
hl.window_rule {
name = 'localsend-float',
float = true,
center = true,
match = {
class = '(localsend|Share|fzf-file-picker)',
},
}
-- Picture-in-picture overlays
hl.window_rule {
name = 'pip-overlay',
tag = '+pip',
match = {
title = '(Picture.?in.?[Pp]icture)',
},
}
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',
match = {
tag = 'pip',
},
}
-- Float Nextcloud
hl.window_rule {
float = true,
match = {
class = 'com.nextcloud.desktopclient.nextcloud',
},
}
-- Position drawing
hl.window_rule {
tag = '-default-opacity',
opacity = '1 1',
no_initial_focus = true,
stay_focused = false,
dim_around = true,
decorate = false,
match = {
class = '^(krita)$',
modal = true,
},
}
hl.window_rule {
name = 'steam-opacity',
tag = '-default-opacity',
opacity = '1 1',
match = {
class = 'steam.*',
},
}
hl.window_rule {
name = 'steam-friends-size',
size = { 460, 800 },
match = {
class = 'steam',
title = 'Friends List',
},
}
-- Floating windows
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',
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.*)',
},
}
hl.window_rule {
name = 'floating-window-tags',
tag = '+floating-window',
float = true,
center = true,
size = { 875, 600 },
match = {
tag = 'floating-window',
},
}
-- Calculator float
hl.window_rule {
name = 'calculator-float',
float = true,
match = {
class = 'org.gnome.Calculator',
},
}
-- Fullscreen screensaver
hl.window_rule {
name = 'screensaver-fullscreen',
fullscreen = true,
float = true,
animation = 'slide',
match = {
class = 'org.station.screensaver',
},
}
-- No transparency on media windows
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)$',
},
}
-- Popped window rounding
hl.window_rule {
name = 'popped-window-rounding',
rounding = 8,
match = {
tag = 'pop',
},
}
-- Prevent idle while open
hl.window_rule {
name = 'idle-inhibit-apps',
idle_inhibit = 'always',
match = {
tag = 'noidle',
},
}
-- Define terminal tag to style them uniformly
hl.window_rule {
name = 'terminal-tags',
tag = '+terminal',
match = {
class = '(Alacritty|kitty|com.mitchellh.ghostty)',
},
}
hl.window_rule {
name = 'terminal-opacity-tags',
tag = '-default-opacity',
opacity = '0.97 0.9',
match = {
tag = 'terminal',
},
}
-- Application-specific animation
hl.layer_rule {
name = 'walker-no-anim',
no_anim = true,
match = { namespace = 'walker' },
}
-- Webcam overlay for screen recording
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)' },
match = {
title = 'WebcamOverlay',
},
}