Files
dotfiles/.config/hypr/apps.lua
T

307 lines
6.9 KiB
Lua
Raw Normal View History

2026-06-07 19:03:11 +01:00
-- Browser types
2026-09-26 22:39:15 +01:00
local function add_tag_to_matching_class(class, tag)
hl.window_rule {
tag = '+' .. tag,
match = {
class = class,
},
}
end
2026-06-07 19:03:11 +01:00
2026-09-26 22:39:15 +01:00
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')
2026-06-07 19:03:11 +01:00
-- Video apps: remove chromium browser tag so they don't get opacity applied
2026-09-26 22:39:15 +01:00
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'
)
2026-06-07 19:03:11 +01:00
-- Force chromium-based browsers into a tile to deal with --app bug
2026-07-21 22:04:54 +01:00
hl.window_rule {
2026-06-07 19:03:11 +01:00
tile = true,
2026-09-26 22:39:15 +01:00
match = { tag = 'chromium-based-browser' },
2026-07-21 22:04:54 +01:00
}
2026-06-07 19:03:11 +01:00
-- Only a subtle opacity change, but not for video sites
2026-07-21 22:04:54 +01:00
hl.window_rule {
2026-09-29 15:46:15 +01:00
opacity = '1.0 0.8',
2026-06-07 19:03:11 +01:00
match = {
2026-07-21 22:04:54 +01:00
tag = 'chromium-based-browser',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
hl.window_rule {
2026-09-29 15:46:15 +01:00
opacity = '1.0 0.8',
2026-06-07 19:03:11 +01:00
match = {
2026-07-21 22:04:54 +01:00
tag = 'firefox-based-browser',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
2026-06-07 19:03:11 +01:00
-- Remove 1px border around hyprshot screenshots
2026-07-21 22:04:54 +01:00
hl.layer_rule {
name = 'no-anim-for-selection',
match = { namespace = 'selection' },
2026-06-07 19:03:11 +01:00
no_anim = true,
2026-07-21 22:04:54 +01:00
}
2026-06-07 19:03:11 +01:00
-- Jetbrains
-- Fix splash screen showing in weird places and prevent annoying focus takeovers
2026-07-21 22:04:54 +01:00
hl.window_rule {
2026-06-07 19:03:11 +01:00
center = true,
no_focus = true,
border_size = 0,
match = {
2026-07-21 22:04:54 +01:00
class = '^(jetbrains-.*)$',
title = '^(splash)$',
2026-06-07 19:03:11 +01:00
float = true,
},
2026-07-21 22:04:54 +01:00
}
2026-06-07 19:03:11 +01:00
-- Center popups/find windows
2026-07-21 22:04:54 +01:00
hl.window_rule {
2026-06-07 19:03:11 +01:00
center = true,
stay_focused = true,
border_size = 0,
2026-07-21 22:04:54 +01:00
min_size = { '(monitor_w*0.5)', '(monitor_h*0.5)' },
tag = '+jetbrains',
2026-06-07 19:03:11 +01:00
match = {
2026-07-21 22:04:54 +01:00
class = '^(jetbrains-.*)$',
title = '^()$',
2026-06-07 19:03:11 +01:00
float = true,
},
2026-07-21 22:04:54 +01:00
}
2026-06-07 19:03:11 +01:00
-- Disable window flicker when autocomplete or tooltips appear
2026-07-21 22:04:54 +01:00
hl.window_rule {
name = 'jetbrains-tooltip',
2026-06-07 19:03:11 +01:00
no_initial_focus = true,
match = {
2026-07-21 22:04:54 +01:00
class = '^(jetbrains-.*)$',
title = '^(win.*)$',
2026-06-07 19:03:11 +01:00
float = true,
},
2026-07-21 22:04:54 +01:00
}
2026-06-07 19:03:11 +01:00
-- Disable mouse focus
2026-07-21 22:04:54 +01:00
hl.window_rule {
name = 'jetbrains-no-follow-mouse',
2026-06-07 19:03:11 +01:00
no_follow_mouse = true,
match = {
2026-07-21 22:04:54 +01:00
class = '^(jetbrains-.*)$',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
2026-06-07 19:03:11 +01:00
-- Keep enpass focused
2026-07-21 22:04:54 +01:00
hl.window_rule {
name = 'enpass-assistant',
2026-06-07 19:03:11 +01:00
stay_focused = true,
center = true,
match = {
2026-07-21 22:04:54 +01:00
class = '^(Enpass)$',
title = '^(Enpass Assistant)$',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
2026-06-07 19:03:11 +01:00
-- Float LocalSend and fzf file picker
2026-07-21 22:04:54 +01:00
hl.window_rule {
name = 'localsend-float',
2026-06-07 19:03:11 +01:00
float = true,
center = true,
match = {
2026-07-21 22:04:54 +01:00
class = '(localsend|Share|fzf-file-picker)',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
2026-06-07 19:03:11 +01:00
-- Picture-in-picture overlays
2026-07-21 22:04:54 +01:00
hl.window_rule {
name = 'pip-overlay',
tag = '+pip',
2026-06-07 19:03:11 +01:00
match = {
2026-07-21 22:04:54 +01:00
title = '(Picture.?in.?[Pp]icture)',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
hl.window_rule {
name = 'pip-overlay',
tag = '-default-opacity',
2026-06-07 19:03:11 +01:00
float = true,
pin = true,
size = { 600, 338 },
keep_aspect_ratio = true,
border_size = 0,
2026-07-21 22:04:54 +01:00
opacity = '1 1',
2026-06-07 19:03:11 +01:00
match = {
2026-07-21 22:04:54 +01:00
tag = 'pip',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
2026-09-26 22:39:15 +01:00
2026-06-07 19:03:11 +01:00
-- Float Nextcloud
2026-07-21 22:04:54 +01:00
hl.window_rule {
2026-06-07 19:03:11 +01:00
float = true,
match = {
2026-07-21 22:04:54 +01:00
class = 'com.nextcloud.desktopclient.nextcloud',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
2026-06-07 19:03:11 +01:00
-- Position drawing
2026-07-21 22:04:54 +01:00
hl.window_rule {
tag = '-default-opacity',
opacity = '1 1',
2026-09-02 11:07:37 +01:00
no_initial_focus = true,
stay_focused = false,
dim_around = true,
decorate = false,
2026-06-07 19:03:11 +01:00
match = {
2026-09-02 11:07:37 +01:00
class = '^(krita)$',
modal = true,
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
2026-09-26 22:39:15 +01:00
2026-07-21 22:04:54 +01:00
hl.window_rule {
name = 'steam-opacity',
tag = '-default-opacity',
opacity = '1 1',
2026-06-07 19:03:11 +01:00
match = {
2026-07-21 22:04:54 +01:00
class = 'steam.*',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
hl.window_rule {
name = 'steam-friends-size',
2026-06-07 19:03:11 +01:00
size = { 460, 800 },
match = {
2026-07-21 22:04:54 +01:00
class = 'steam',
title = 'Friends List',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
2026-06-07 19:03:11 +01:00
-- Floating windows
2026-09-26 22:39:15 +01:00
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'
)
2026-07-21 22:04:54 +01:00
hl.window_rule {
name = 'floating-dialog-tags',
tag = '+floating-window',
2026-06-07 19:03:11 +01:00
match = {
2026-07-21 22:04:54 +01:00
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.*)',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
hl.window_rule {
name = 'floating-window-tags',
tag = '+floating-window',
2026-06-07 19:03:11 +01:00
float = true,
center = true,
size = { 875, 600 },
match = {
2026-07-21 22:04:54 +01:00
tag = 'floating-window',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
2026-06-07 19:03:11 +01:00
-- Calculator float
2026-07-21 22:04:54 +01:00
hl.window_rule {
name = 'calculator-float',
2026-06-07 19:03:11 +01:00
float = true,
match = {
2026-07-21 22:04:54 +01:00
class = 'org.gnome.Calculator',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
2026-06-07 19:03:11 +01:00
-- Fullscreen screensaver
2026-07-21 22:04:54 +01:00
hl.window_rule {
name = 'screensaver-fullscreen',
2026-06-07 19:03:11 +01:00
fullscreen = true,
float = true,
2026-07-21 22:04:54 +01:00
animation = 'slide',
2026-06-07 19:03:11 +01:00
match = {
2026-07-21 22:04:54 +01:00
class = 'org.station.screensaver',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
2026-06-07 19:03:11 +01:00
-- No transparency on media windows
2026-07-21 22:04:54 +01:00
hl.window_rule {
name = 'media-no-opacity',
tag = '-default-opacity',
opacity = '1 1',
2026-06-07 19:03:11 +01:00
match = {
2026-07-21 22:04:54 +01:00
class = '^(zoom|vlc|mpv|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta|imv|org.gnome.NautilusPreviewer)$',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
2026-06-07 19:03:11 +01:00
-- Popped window rounding
2026-07-21 22:04:54 +01:00
hl.window_rule {
name = 'popped-window-rounding',
2026-06-07 19:03:11 +01:00
rounding = 8,
match = {
2026-07-21 22:04:54 +01:00
tag = 'pop',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
2026-06-07 19:03:11 +01:00
-- Prevent idle while open
2026-07-21 22:04:54 +01:00
hl.window_rule {
name = 'idle-inhibit-apps',
idle_inhibit = 'always',
2026-06-07 19:03:11 +01:00
match = {
2026-07-21 22:04:54 +01:00
tag = 'noidle',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
2026-06-07 19:03:11 +01:00
-- Define terminal tag to style them uniformly
2026-07-21 22:04:54 +01:00
hl.window_rule {
name = 'terminal-tags',
tag = '+terminal',
2026-06-07 19:03:11 +01:00
match = {
2026-07-21 22:04:54 +01:00
class = '(Alacritty|kitty|com.mitchellh.ghostty)',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
hl.window_rule {
name = 'terminal-opacity-tags',
tag = '-default-opacity',
opacity = '0.97 0.9',
2026-06-07 19:03:11 +01:00
match = {
2026-07-21 22:04:54 +01:00
tag = 'terminal',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}
2026-06-07 19:03:11 +01:00
-- Application-specific animation
2026-07-21 22:04:54 +01:00
hl.layer_rule {
name = 'walker-no-anim',
2026-06-07 19:03:11 +01:00
no_anim = true,
2026-07-21 22:04:54 +01:00
match = { namespace = 'walker' },
}
2026-06-07 19:03:11 +01:00
-- Webcam overlay for screen recording
2026-07-21 22:04:54 +01:00
hl.window_rule {
name = 'webcam-overlay',
2026-06-07 19:03:11 +01:00
float = true,
pin = true,
no_initial_focus = true,
no_dim = true,
size = { 320, 180 },
2026-07-21 22:04:54 +01:00
move = { '(monitor_w-360)', '(monitor_h-220)' },
2026-06-07 19:03:11 +01:00
match = {
2026-07-21 22:04:54 +01:00
title = 'WebcamOverlay',
2026-06-07 19:03:11 +01:00
},
2026-07-21 22:04:54 +01:00
}