diff --git a/Configs/.config/bin/toggle-noscreenshare.sh b/Configs/.config/bin/toggle-noscreenshare.sh index b7b9296..8862494 100755 --- a/Configs/.config/bin/toggle-noscreenshare.sh +++ b/Configs/.config/bin/toggle-noscreenshare.sh @@ -2,8 +2,8 @@ FILE="$HOME/.config/hypr/hyprland/rules.conf" -LAYER_RULE="layerrule = noscreenshare,^(.*)$" -WINDOW_RULE="windowrulev2 = noscreenshare, initialClass:^(.*)$" +LAYER_RULE="layerrule = match:namespace ^(.*)$, no_screen_share on" +WINDOW_RULE="windowrule = match:initial_class = ^(.*)$, no_screen_share on" escape_regex() { printf '%s\n' "$1" | sed -e 's/[][\/.^$*]/\\&/g' diff --git a/Configs/.config/hypr/hyprland/rules.conf b/Configs/.config/hypr/hyprland/rules.conf index ea2e997..8be4ea4 100644 --- a/Configs/.config/hypr/hyprland/rules.conf +++ b/Configs/.config/hypr/hyprland/rules.conf @@ -6,100 +6,176 @@ # https://wiki.hyprland.org/Configuring/Workspace-Rules/ -# Floating windows -windowrulev2 = float, class:^(org.gnome.Calculator)$ -windowrulev2 = size 400 500, class:^(org.gnome.Calculator)$ +### Floating windows +# Calculator +windowrule { + name = calculator + match:class = ^(org.gnome.Calculator)$ + float = on + size = 400 500 +} -$FLOAT_CLASSES = ^(org.pulseaudio.pavucontrol|nm-connection-editor|blueman-manager|nekobox|waypaper)$ -windowrulev2 = float, class:$FLOAT_CLASSES -windowrulev2 = size 50%, class:$FLOAT_CLASSES -windowrulev2 = center, class:$FLOAT_CLASSES +# General floating windows +$FLOAT_CLASSES = ^(org.pulseaudio.pavucontrol|nm-connection-editor\ +|blueman-manager|nekobox|waypaper)$ +windowrule { + name = float-classes + match:class = $FLOAT_CLASSES + center = on + float = on + size = (monitor_w*0.5) (monitor_h*0.5) +} -# Dialog windows -$DIALOG_TITLES = ^(Open Files?|Pick Files?|Choose Files|Choose a file|Select a File|Choose wallpaper\ -|Open Folders?|Add Folders?( to Workspace)?|Save As|Library|File Upload|.*wants to (save|open))$ -windowrulev2 = center, title:$DIALOG_TITLES -windowrulev2 = float, title:$DIALOG_TITLES -windowrulev2 = size 50%, title:$DIALOG_TITLES +### Dialog windows +$DIALOG_TITLES = ^(Open Files?|Pick Files?|Choose Files|Choose a file\ +|Select a File|Choose wallpaper|Open Folders?|Add Folders?( to Workspace)?\ +|Save As|Library|File Upload|.*wants to (save|open))$ +windowrule { + name = dialogs + match:title = $DIALOG_TITLES + center = on + float = on + size = (monitor_w*0.5) (monitor_h*0.5) +} -# Picture-in-Picture +### Picture-in-Picture $PiP = Picture.?in.?[Pp]icture -windowrulev2 = float, title:$PiP -windowrulev2 = pin, title:$PiP -windowrulev2 = size 25%, title:$PiP -windowrulev2 = keepaspectratio, title:$PiP -windowrulev2 = noborder, title:$PiP -windowrulev2 = opacity 1 1, title:$PiP -windowrulev2 = move 71% 13%, title:$PiP +windowrule { + name = picture-in-picture + match:title = $PiP + border_size = 0 + float = on + keep_aspect_ratio = on + move = (monitor_w*0.71) (monitor_h*0.13) + opacity = 1.0 1.0 + pin = on + size = (monitor_w*0.25) (monitor_h*0.25) +} -# Opacity 100% -$OPAQUE_CLASSES = ^(libreoffice|ONLYOFFICE|qemu|vlc|com.obsproject.Studio|imv|org.gnome.NautilusPreviewer)$ -windowrulev2 = opaque, class:$OPAQUE_CLASSES +### Opacity 100% +$OPAQUE_CLASSES = ^(libreoffice|ONLYOFFICE|qemu|vlc\ +|com.obsproject.Studio|imv|org.gnome.NautilusPreviewer)$ +windowrule { + name = opaque-apps + match:class = $OPAQUE_CLASSES + opaque = on +} -# Flameshot -windowrulev2 = noanim, class:flameshot -windowrulev2 = float, class:flameshot -layerrule = noanim, selection - -# Emote -windowrulev2 = stayfocused, class:emote - +### App-specific rules # KDE Connect $KDE_CONNECT = org.kde.kdeconnect.daemon -windowrulev2 = nofocus, class:$KDE_CONNECT -windowrulev2 = float, class:$KDE_CONNECT -windowrulev2 = noinitialfocus, class:$KDE_CONNECT -# For "Presentation remote" -# windowrulev2 = opacity 1, class:$KDE_CONNECT -# windowrulev2 = noblur, class:$KDE_CONNECT -# windowrulev2 = noborder, class:$KDE_CONNECT -# windowrulev2 = noshadow, class:$KDE_CONNECT -# windowrulev2 = suppressevent fullscreen, class:$KDE_CONNECT -# windowrulev2 = pin, class:$KDE_CONNECT -# windowrulev2 = size 100%, class:$KDE_CONNECT -# windowrulev2 = move 0 0, class:$KDE_CONNECT +windowrule { + name = kde-connect + match:class = $KDE_CONNECT + float = on + no_focus = on + no_initial_focus = on +} +# KDE Connect "Presentation remote" +# windowrule { +# name = kde-connect-presentation +# match:class = $KDE_CONNECT +# border_size = 0 +# move = 0 0 +# no_blur = on +# no_shadow = on +# opacity = 1.0 +# pin = on +# size = (monitor_w*1) (monitor_h*1) +# suppress_event = fullscreen +# } # Steam $STEAM_FLOAT_TITLES=^(Steam Settings) -windowrulev2 = float, title:$STEAM_FLOAT_TITLES +windowrule { + name = steam-settings + match:title = $STEAM_FLOAT_TITLES + float = on +} + +### Workspace-specific rules # Games -windowrulev2 = noshadow, onworkspace:8 -windowrulev2 = opaque, onworkspace:8 -windowrulev2 = noblur, onworkspace:8 +windowrule { + name = games-workspace + match:workspace = 8 + no_blur = on + no_shadow = on + opaque = on +} + +### Technical fixes & overrides # Tearing -windowrulev2 = immediate, title:.*\.exe -windowrulev2 = immediate, title:.*minecraft.* -windowrulev2 = immediate, class:^(steam_app).* +windowrule { + name = tearing-exe + match:title = .*\.exe + immediate = on +} +windowrule { + name = tearing-minecraft + match:title = .*minecraft.* + immediate = on +} +windowrule { + name = tearing-steam + match:class = ^(steam_app).* + immediate = on +} - -# Ignore maximize requests from apps. -windowrulev2 = suppressevent maximize, class:.* +# Ignore maximize requests from apps +windowrule { + name = ignore-maximize + match:class = .* + suppress_event = maximize +} # Fix some dragging issues with XWayland -windowrulev2 = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0 +windowrule { + name = xwayland-drag-fix + match:class = ^$ + match:title = ^$ + match:float = true + match:fullscreen = false + match:pin = false + match:xwayland = true + no_focus = on +} # Fix blur around XWayland windows # Variant 1 -windowrulev2 = noblur, class:^()$, title:^()$ -windowrulev2 = opacity 0.98 override, class:^()$, title:^()$ +windowrule { + name = xwayland-blur-fix + match:class = ^()$ + match:title = ^()$ + no_blur = on + opacity = 0.98 override +} # Variant 2 -# windowrulev2 = noblur, xwayland:1, floating:1 -# windowrulev2 = opacity 0.98 override, xwayland:1, floating:1 +# windowrule { +# name = xwayland-blur-fix-alt +# match:float = true +# match:xwayland = true +# no_blur = on +# opacity = 0.98 override +# } +### Screen Sharing # No Screen Share for Authentication Window and KeePassXC -windowrulev2 = noscreenshare, class:^(polkit-gnome-authentication-agent-1|org.keepassxc.KeePassXC)$ +windowrule { + name = no-screen-share-apps + match:class = ^(polkit-gnome-authentication-agent-1|org.keepassxc.KeePassXC)$ + no_screen_share = on +} # NoScreenShare for SwayNC -# layerrule = noscreenshare, swaync-notification-window -# layerrule = noscreenshare, ^(swaync-control-center|swaync-notification-window)$ +# layerrule = match:namespace ^(swaync-control-center|swaync-notification-window)$, no_screen_share on # NoScreenShare (~/.config/bin/toggle-noscreenshare.sh) -# layerrule = noscreenshare,^(.*)$ -# windowrulev2 = noscreenshare, initialClass:^(.*)$ +# layerrule = match:namespace ^(.*)$, no_screen_share on +# windowrule = match:initial_class = ^(.*)$, no_screen_share on