hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
19.53k stars 818 forks source link

Rules seem to not work correctly #6593

Closed leon-erd closed 2 months ago

leon-erd commented 2 months ago

Regression?

No

System Info and Version

System/Version info ```sh Hyprland, built from branch at commit d1340bd1d8eedd274283e0cb2568a3ed67b58c81 (). Date: 2024-06-17 Tag: , commits: d1340bd1d8eedd274283e0cb2568a3ed67b58c81 flags: (if any) System Information: System name: Linux Node name: leon-inspiron Release: 6.9.4 Version: #1-NixOS SMP PREEMPT_DYNAMIC Wed Jun 12 09:39:59 UTC 2024 GPU information: 0000:00:02.0 VGA compatible controller [0300]: Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics] [8086:9a49] (rev 01) (prog-if 00 [VGA controller]) os-release: ANSI_COLOR="1;34" BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues" BUILD_ID="24.11.20240616.b60ebf5" DOCUMENTATION_URL="https://nixos.org/learn.html" HOME_URL="https://nixos.org/" ID=nixos IMAGE_ID="" IMAGE_VERSION="" LOGO="nix-snowflake" NAME=NixOS PRETTY_NAME="NixOS 24.11 (Vicuna)" SUPPORT_URL="https://nixos.org/community.html" VERSION="24.11 (Vicuna)" VERSION_CODENAME=vicuna VERSION_ID="24.11" plugins: hyprexpo by Vaxry ver 1.0 ======Config-Start====== Config File: /home/leon/.config/hypr/hyprland.conf: Read Succeeded exec-once = /nix/store/y29cbwfiwb9nyi4db4apk9dgylzdjm1v-dbus-1.14.10/bin/dbus-update-activation-environment --systemd --all && systemctl --user stop hyprland-session.target && systemctl --user start hyprland-session.target plugin=/nix/store/abcgxxd6z5bpddjkva09hkmzwxyjfx47-hyprexpo-0.1/lib/libhyprexpo.so $mainMod=SUPER bezier=linear, 0, 0, 1, 1 source=./monitors.conf source=./workspaces.conf source=./monitors.conf source=./workspaces.conf binds { allow_workspace_cycles=yes } cursor { no_hardware_cursors=true } decoration { blur { ignore_opacity=true passes=4 popups=true size=4 special=true } rounding=5 } device { name=cust0000:00-04f3:2a4a-stylus output=eDP-1 } dwindle { force_split=2 preserve_split=true pseudotile=true } general { border_size=2 col.active_border=rgba(33ccffff) rgba(00ff99ff) 45deg col.inactive_border=rgba(444444aa) gaps_in=3 gaps_out=3 layout=master resize_on_border=true } gestures { workspace_swipe=true workspace_swipe_forever=true } group { groupbar { col.active=rgba(6600ccee) col.inactive=rgba(6600cc99) } col.border_active=rgba(8800ffff) rgba(aa0055ff) 45deg col.border_inactive=rgba(444444aa) } input { touchpad { drag_lock=true natural_scroll=true } kb_layout=de numlock_by_default=true } misc { animate_manual_resizes=true animate_mouse_windowdragging=true focus_on_activate=true force_default_wallpaper=0 initial_workspace_tracking=false new_window_takes_over_fullscreen=2 } plugin { hyprexpo { bg_col=rgb(111111) columns=3 enable_gesture=true gap_size=5 gesture_distance=300 gesture_positive=false workspace_method=first 1 } } animation=specialWorkspace, 1, 5, default, slidefadevert animation=borderangle, 1, 40, linear, loop animation=layers, 1, 5, default, popin bind=$mainMod, B, togglespecialworkspace, btop bind=$mainMod, H, togglespecialworkspace, htop bind=$mainMod, S, togglespecialworkspace, spotify bind=$mainMod, T, togglespecialworkspace, terminal bind=ALT, F4 , killactive, bind=$mainMod, F, togglefloating, bind=$mainMod, G, togglegroup bind=$mainMod, M, fullscreen, bind=$mainMod, E, exec, dolphin bind=, XF86Calculator , exec, qalculate-qt bind=$mainMod + SHIFT, left, movewindoworgroup, l bind=$mainMod + SHIFT, right, movewindoworgroup, r bind=$mainMod + SHIFT, up, movewindoworgroup, u bind=$mainMod + SHIFT, down, movewindoworgroup, d bind=$mainMod + CTRL, left, movecurrentworkspacetomonitor, l bind=$mainMod + CTRL, right, movecurrentworkspacetomonitor, r bind=$mainMod + CTRL, up, movecurrentworkspacetomonitor, u bind=$mainMod + CTRL, down, movecurrentworkspacetomonitor, d bind=$mainMod, RETURN, layoutmsg, swapwithmaster bind=$mainMod + SHIFT, RETURN, layoutmsg, addmaster bind=$mainMod + SHIFT + CTRL, RETURN, layoutmsg, removemaster bind=ALT, Tab, cyclenext, bind=ALT + CTRL, Tab, changegroupactive bind=$mainMod, 1, workspace, 1 bind=$mainMod, 2, workspace, 2 bind=$mainMod, 3, workspace, 3 bind=$mainMod, 4, workspace, 4 bind=$mainMod, 5, workspace, 5 bind=$mainMod, 6, workspace, 6 bind=$mainMod, 7, workspace, 7 bind=$mainMod, 8, workspace, 8 bind=$mainMod, 9, workspace, 9 bind=$mainMod, 0, workspace, 10 bind=$mainMod, Tab, workspace, previous bind=$mainMod SHIFT, 1, movetoworkspacesilent, 1 bind=$mainMod SHIFT, 2, movetoworkspacesilent, 2 bind=$mainMod SHIFT, 3, movetoworkspacesilent, 3 bind=$mainMod SHIFT, 4, movetoworkspacesilent, 4 bind=$mainMod SHIFT, 5, movetoworkspacesilent, 5 bind=$mainMod SHIFT, 6, movetoworkspacesilent, 6 bind=$mainMod SHIFT, 7, movetoworkspacesilent, 7 bind=$mainMod SHIFT, 8, movetoworkspacesilent, 8 bind=$mainMod SHIFT, 9, movetoworkspacesilent, 9 bind=$mainMod SHIFT, 0, movetoworkspacesilent, 10 bind=$mainMod, mouse_down, workspace, e+1 bind=$mainMod, mouse_up, workspace, e-1 bind=CTRL + ALT, B, exec, ~/scripts/launch_waybar.sh bind=CTRL + ALT, W, exec, ~/scripts/wallpaper/update_wallpaper.sh bind=$mainMod, N, exec, swaync-client -t -sw bind=CTRL + ALT, S, exec, wl-paste | swappy -f - bind=, Print, exec, grimblast --notify --freeze copy area bind=$mainMod, P, exec, nwg-displays bind=$mainMod, W, hyprexpo:expo, toggle bind=$mainMod, V, exec, cliphist list | rofi -dmenu -theme /nix/store/r5gfsxb7srsncmxd996bh39ag8h64qcl-spotlight-dark.rasi | cliphist decode | wl-copy && wtype -M ctrl v -m ctrl bind=CTRL + ALT, T, exec, alacritty binde=$mainMod, left, resizeactive, -30 0 binde=$mainMod, right, resizeactive, 30 0 binde=$mainMod, up, resizeactive, 0 -30 binde=$mainMod, down, resizeactive, 0 30 bindl=, XF86AudioMute, exec, swayosd-client --output-volume mute-toggle bindl=, XF86AudioPlay, exec, playerctl play-pause bindl=, XF86AudioStop, exec, playerctl stop bindl=, XF86AudioPrev, exec, playerctl previous bindl=, XF86AudioNext, exec, playerctl next bindl=CTRL, left, exec, playerctl previous bindl=CTRL, right, exec, playerctl next bindle=, XF86AudioRaiseVolume, exec, pamixer --unmute; swayosd-client --output-volume raise bindle=, XF86MonBrightnessUp, exec, swayosd-client --brightness raise bindle=, XF86MonBrightnessDown, exec, swayosd-client --brightness lower bindle=, XF86AudioLowerVolume, exec, pamixer --unmute; swayosd-client --output-volume lower bindm=$mainMod, mouse:272, movewindow bindm=$mainMod, mouse:273, resizewindow bindr=$mainMod, $mainMod_L, exec, pkill --exact tofi-drun || tofi-drun --drun-launch=true bindr=$mainMod, L, exec, /nix/store/h53bah665mn9zvn5wfqznbvpfzawr1j1-hyprlock.sh env=XCURSOR_SIZE, 12 env=QT_QPA_PLATFORMTHEME, qt5ct env=XCURSOR_THEME, breeze_cursors env=XCURSOR_SIZE, 24 exec-once=sleep 5 && nextcloud --background exec-once=sleep 5 && ~/scripts/hibernate_on_low_battery.sh exec-once=sleep 5 && ~/scripts/restart_failed_systemd_user_services.sh exec-once=~/scripts/launch_waybar.sh exec-once=sleep 1 && swww init exec-once=sleep 2 && swww img --transition-type grow ~/scripts/wallpaper/wallpaper.jpg exec-once=swaync exec-once=rm ~/.cache/tofi-drun exec-once=/nix/store/qjfzpww5g3zahmb8gx3d5nm13irc81hd-polkit-kde-agent-1-5.27.11/libexec/polkit-kde-authentication-agent-1 exec-once=wl-paste --type text --watch cliphist store exec-once=wl-paste --type image --watch cliphist store layerrule=blur, waybar layerrule=blurpopups, waybar layerrule=ignorealpha 0.1, waybar layerrule=blur, swaync-control-center layerrule=blur, swaync-notification-window layerrule=ignorezero, swaync-control-center layerrule=ignorezero, swaync-notification-window layerrule=animation popin 90%, swaync-control-center layerrule=animation popin, swaync-notification-window layerrule=noanim, hyprpicker layerrule=noanim, selection layerrule=blur, launcher layerrule=animation slide, launcher layerrule=blur, swayosd layerrule=ignorezero, swayosd layerrule=animation slide, rofi layerrule=blur, rofi monitor=, preferred, auto, 1 windowrulev2=float, class:^(org.kde.polkit-kde-authentication-agent-1)$ windowrulev2=tile, class:^(DesktopEditors)$ windowrulev2=tag +vscode, class:^(code-url-handler)$ windowrulev2=tag +vscode, class:^(codium-url-handler)$ windowrulev2=opacity 0.85, tag:vscode windowrulev2=opacity 1.00, tag:vscode, title:.pdf windowrulev2=workspace 1, tag:vscode windowrulev2=workspace 5, class:^(firefox)$ windowrulev2=tag +social, class:^(org.telegram.desktop)$ windowrulev2=tag +social, class:^(Signal)$ windowrulev2=tag +social, class:^(Slack)$ windowrulev2=tag +social, class:^(thunderbird)$ windowrulev2=tag +social, class:^(WebCord)$ windowrulev2=tag +social, class:^(whatsapp-for-linux)$ windowrulev2=workspace 9, tag:social windowrulev2=noblur, class:^(org.kde.kdeconnect.daemon)$ windowrulev2=noborder, class:^(org.kde.kdeconnect.daemon)$ windowrulev2=noshadow, class:^(org.kde.kdeconnect.daemon)$ windowrulev2=noanim, class:^(org.kde.kdeconnect.daemon)$ windowrulev2=nofocus, class:^(org.kde.kdeconnect.daemon)$ windowrulev2=suppressevent fullscreen, class:^(org.kde.kdeconnect.daemon)$ windowrulev2=float, class:^(org.kde.kdeconnect.daemon)$ windowrulev2=move 0 0, class:^(org.kde.kdeconnect.daemon)$ windowrulev2=size 100% 100%, class:^(org.kde.kdeconnect.daemon)$ windowrulev2=noblur, onworkspace:special:hyprlock workspace=2, on-created-empty:dolphin workspace=5, on-created-empty:firefox workspace=special:btop, on-created-empty:[fullscreen] alacritty -e btop workspace=special:htop, border:false, on-created-empty:[float; size 100% 35%; move 0% 65%] alacritty -e htop workspace=special:spotify, on-created-empty:[fullscreen] spotify workspace=special:terminal, on-created-empty:[fullscreen] alacritty workspace=name:hyprlock, monitor:eDP-1 workspace=name:hyprlock, decorate:false workspace=name:hyprlock, border:false workspace=name:hyprlock, shadow:false workspace=special:hyprlock, monitor:eDP-1 workspace=special:hyprlock, decorate:false workspace=special:hyprlock, border:false workspace=special:hyprlock, shadow:false Config File: /home/leon/.config/hypr/monitors.conf: Read Succeeded # Generated by myKanshiPlus (2024-06-19 11:24:50.524596). Do not edit manually. monitor = desc:Dell Inc. DELL P2412H TTMDG2AQ15EU, preferred, 0x0, 1 monitor = desc:LG Display 0x0637, preferred, 3600x0, 1 monitor = desc:LG Electronics E2210 205NDMT1D051, preferred, 1920x0, 1 Config File: /home/leon/.config/hypr/workspaces.conf: Read Succeeded # Generated by myKanshiPlus (2024-06-19 11:24:50.524663). Do not edit manually. workspace = 1, monitor:desc:Dell Inc. DELL P2412H TTMDG2AQ15EU, default:true workspace = 10, monitor:desc:LG Display 0x0637, default:true workspace = 2, monitor:desc:LG Electronics E2210 205NDMT1D051, default:true Config File: /home/leon/.config/hypr/monitors.conf: Read Succeeded # Generated by myKanshiPlus (2024-06-19 11:24:50.524596). Do not edit manually. monitor = desc:Dell Inc. DELL P2412H TTMDG2AQ15EU, preferred, 0x0, 1 monitor = desc:LG Display 0x0637, preferred, 3600x0, 1 monitor = desc:LG Electronics E2210 205NDMT1D051, preferred, 1920x0, 1 Config File: /home/leon/.config/hypr/workspaces.conf: Read Succeeded # Generated by myKanshiPlus (2024-06-19 11:24:50.524663). Do not edit manually. workspace = 1, monitor:desc:Dell Inc. DELL P2412H TTMDG2AQ15EU, default:true workspace = 10, monitor:desc:LG Display 0x0637, default:true workspace = 2, monitor:desc:LG Electronics E2210 205NDMT1D051, default:true ======Config-End======== ```

Description

Extra rules do not seem to work correctly.

How to reproduce

  1. run hyprctl dispatch "exec [float; size 30% 10%; move 30% 10%; tag noblur; noblur] alacritty -o window.opacity=0" && sleep 1 && hyprctl clients
  2. "Created window" (Alacritty) opens correctly with no blur and hyprctl clients shows the tag
  3. Switch back to the window where you executed the command from 1. ("executing window")
  4. Switch back to the "created window"
  5. Switch back to the "executing window"
  6. Execute hyprctl clients
  7. The "created window" no longer has the tag and also noblur is gone

Additional information

I tested the following with Alacritty and Konsole as "executing windows" and Alacritty, Konsole, and Dolphin as "created windows". Bug appears on all combinations. The pid of the "created window" stays the same.

vaxerski commented 2 months ago

noblur and tag are dynamic thats why

leon-erd commented 2 months ago

I do not understand. Rules track the pid of the process as matching criteria right? In the wiki it says: "Dynamic rules are re-evaluated every time a property changes." If the pid of the process is its matching criteria I would expect that it "reapplies" the dynamic rules every time a property changes as long as the pid stays the same. If that's not how this works then dynamic rules are basically unusable with the exec dispatcher right?

vaxerski commented 2 months ago

If that's not how this works then dynamic rules are basically unusable with the exec dispatcher right?

correct. IIRC someone wanted to make a MR to make them stick around.

leon-erd commented 2 months ago

Okay. I think the only thing we need would be a pid window rule selector right? Then its pretty easy in a script to open a window and then immediately after apply dynamic rules with the pid window rule. Under the hood this could be used to fix dynamic rules with the exec dispatcher. Unfortunately, C++ is one of the languages I have never done anything with otherwise I would make a PR. So maybe we should reopen the issue and mark it as feature request with a different title? Or I can open a new feature request with an explanation.

leon-erd commented 2 months ago

I guess this is related https://github.com/hyprwm/Hyprland/issues/4648 though its formulated in a bit of a confusing way