Closed musicfunfan closed 3 months ago
Try windowrulev2 = workspace 2,class:(^FM$)
to match whole string
So... I try windowrulev2 = workspace 1 ,class:(^FMP$)
. And then. I run.
firefox --name FMP
And the window spawn on the workspace 2
.
So this is not working.
FMP
still matches (FM)
. Your second rule needs to be more specific. (FM)
will match anything containing FM
.
I understand, so this is working as indented ? I am of the opinion that Hyprland should check the whole string... If it is a match. I was thinking that this was a BUG.
https://wiki.hyprland.org/Configuring/Window-Rules/
The second part of a rule is a RegEx. ^
mathes the start of string, $
- the end. Take a look at https://cheatography.com/davechild/cheat-sheets/regular-expressions/
I know what RegEx is. I just did not expect to need to use them when i have the whole string i want to match.
For example when i want to delete a file i can do rm name_of_the_file
(no RegEx). Only when i do not know the name but i know some of it. I need use RegEx like rm *.mp3
or something like that.
Any way, as far as i understand this is the indented response from Hyprland.
Thanks for the help and for the knowledge.
I will close this issue. Because terns out this is not an issue.
Regression?
No
System Info and Version
System/Version info
```sh Hyprland, built from branch at commit 918d8340afd652b011b937d29d5eea0be08467f5 (flake.lock: update). Date: Tue Jun 25 12:06:02 2024 Tag: v0.41.2, commits: 4886 flags: (if any) System Information: System name: Linux Node name: archlinux Release: 6.9.6-arch1-1 Version: #1 SMP PREEMPT_DYNAMIC Fri, 21 Jun 2024 19:49:19 +0000 GPU information: 07:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Baffin [Radeon RX 460/560D / Pro 450/455/460/555/555X/560/560X] [1002:67ef] (rev e5) (prog-if 00 [VGA controller]) os-release: NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=archlinux-logo plugins: ======Config-Start====== Config File: /home/musicfan/.config/hypr/hyprland.conf: Read Succeeded #Monitor set up. monitor=DP-1,3840x2160@60,0x0,2 monitor=DVI-D-1,1920x1080@60,1920x0,1 #Extra settings. misc { disable_hyprland_logo = true } #keyboard layout. input { kb_layout = us,gr kb_options = grp:alt_shift_toggle } #Commands to execute at start up. exec-once = waybar & exec-once = corectrl -m main --minimize-systray & exec-once = xrdb -load /home/musicfan/.Xresources & exec-once = exec exec openrgb -p cyan.orp --startminimized & exec-once = openrgb -p cyan.orp --startminimized & exec-once = nm-applet & exec-once = playerctld daemon & exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP #exec-once = wlsunset exec-once = lxqt-policykit-agent & exec-once = $HOME/.config/scripts/SelectWallpeper.sh & exec-once = radeontop -d gpu.txt -l 0 > /dev/null & exec-once = blueman-applet & exec-once = pactl load-module module-native-protocol-tcp auth-anonymous=true & exec-once = hypridle & #XWayland scale. xwayland { force_zero_scaling = true } #Some default env vars. env = XCURSOR_SIZE,24 env = GDK_SCALE,2 env = QT_QPA_PLATFORMTHEME,qt5ct env = GTK_THEME,Nordic #Window Rules. #Floating windowrulev2 = float,class:(lxqt-policykit-agent) windowrulev2 = float,size 20%,noborder,class:(mpv) #Workspace 1 windowrulev2 = workspace 1 ,class:(discord) windowrulev2 = workspace 1 ,class:(Skype) windowrulev2 = workspace 1 ,class:(Element) windowrulev2 = workspace 1 ,class:(thunderbird) windowrulev2 = workspace 1 ,class:(FAMP) #Workspace 2 windowrulev2 = workspace 2 ,class:(FM) #Workspace 3 windowrulev2 = workspace 3 ,class:(FS) #Worksapce 4 windowrulev2 = workspace 4 ,class:(FN) windowrulev2 = workspace 4 ,class:(pcmanfm-qt) #Workspace 5 windowrulev2 = workspace 5 ,class:(kitty) #Workspace 6 windowrulev2 = workspace 6 ,class:(virt-manager) #Workspace 7 windowrulev2 = workspace 7 ,class:(Emacs) #Workspace 8 windowrulev2 = workspace 8 ,class:(com.obsproject.Studio) #Workspace 9 windowrulev2 = workspace 9 ,class:(FP) #Workspace 10 windowrulev2 = workspace 10 ,class:(steam) #Workspace 11 windowrulev2 = workspace 11 ,class:(org.kde.kdenlive) windowrulev2 = workspace 11 ,class:(blender) windowrulev2 = workspace 11 ,class:(fr.handbrake.ghb) #Workspace 12 windowrulev2 = workspace 12 ,class:(libreoffice-writer) windowrulev2 = workspace 12 ,class:(libreoffice-calc) windowrulev2 = workspace 12 ,class:(libreoffice-impress) windowrulev2 = workspace 12 ,class:(libreoffice-draw) windowrulev2 = workspace 12 ,class:(libreoffice-math) windowrulev2 = workspace 12 ,class:(libreoffice-base) #Workspace special windowrulev2 = workspace special ,class:(ch.proton.bridge-gui) windowrulev2 = workspace special ,class:(org.pulseaudio.pavucontrol) windowrulev2 = workspace special ,class:(org.rncbc.qpwgraph) windowrulev2 = workspace special ,class:(blueman-manager) general { # See https://wiki.hyprland.org/Configuring/Variables/ for more gaps_in = 0 gaps_out = 0 border_size = 4 col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg col.inactive_border = rgba(59595900) layout = dwindle } decoration { # See https://wiki.hyprland.org/Configuring/Variables/ for more rounding = 0 blur { enabled = false size = 3 passes = 1 } drop_shadow = yes shadow_range = 4 shadow_render_power = 3 col.shadow = rgba(1a1a1aee) } animations { enabled = yes # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more bezier = myBezier, 0.05, 0.9, 0.1, 1.05 animation = windows, 1, 7, myBezier animation = windowsOut, 1, 7, default, popin 80% animation = border, 1, 10, default animation = borderangle, 1, 8, default animation = fade, 1, 7, default animation = workspaces, 1, 6, default } dwindle { # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = yes # you probably want this } #master { # # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more # new_is_master = true #} gestures { # See https://wiki.hyprland.org/Configuring/Variables/ for more workspace_swipe = off } # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bind = $mainMod, w,exec,$HOME/.config/scripts/SelectWallpeper.sh bind = $mainMod, P,exec,$HOME/.config/scripts/power.sh bind = $mainMod, U,movecurrentworkspacetomonitor, DVI-D-1 bind = $mainMod, I,movecurrentworkspacetomonitor, DP-1 bind = $mainMod, Y,swapactiveworkspaces,current +1 bind = $mainMod, F, workspaceopt, allfloat bind = $mainMod, Return, exec, kitty bind = $mainMod, M, exit, bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, q, togglesplit, # dwindle bind = $mainMod, A, exec,passrofi bind = ALT_L, SPACE, exec,rofi -show drun bind = ALT_L, W, exec, $HOME/.config/scripts/search.sh bind = ALT_L, E, exec, $HOME/.config/scripts/sites.sh bind = ALT_L, 5, fullscreen bind = ALT_L, T, togglefloating, bind = ALT_L, f4, killactive, bind = ALT_L, j, exec ,rofi -show emoji -theme $HOME/.config/rofi/arthur.rasi bind = CTRL_L_SHIFT, W,exec, $HOME/.config/scripts/media.sh bind = ,Print,exec, $HOME/.config/scripts/screenshot.sh bind = ALT_L, q ,exec, $HOME/.config/scripts/runScript.sh bind=$mainMod_SHIFT,s,movetoworkspace,special bind=$mainMod,s,togglespecialworkspace, #Media buttons bind =, XF86AudioMute, exec, $HOME/.config/scripts/volumeMeter.sh -m binde =, XF86AudioLowerVolume, exec, $HOME/.config/scripts/volumeMeter.sh -d binde =, XF86AudioRaiseVolume, exec, $HOME/.config/scripts/volumeMeter.sh -u bind =, XF86AudioPlay, exec, $HOME/.config/scripts/mediaNotification.sh -p bind =, XF86AudioPause, exec, $HOME/.cofnig/scripts/mediaNotification.sh -p bind =, XF86AudioNext, exec, $HOME/.config/scripts/mediaNotification.sh -n bind =, XF86AudioPrev, exec, $HOME/.config/scripts/mediaNotification.sh -b bind =, XF86AudioStop, exec, $HOME/.config/scripts/mediaNotification.sh -t #Move focus with mainMod + arrow keys bind = $mainMod, L, movefocus, l bind = $mainMod, H, movefocus, r bind = $mainMod, K, movefocus, u bind = $mainMod, J, movefocus, d # Switch workspaces with mainMod + [0-9] bind = CONTROL_L, F1, workspace, 1 bind = CONTROL_L, F2, workspace, 2 bind = CONTROL_L, F3, workspace, 3 bind = CONTROL_L, F4, workspace, 4 bind = CONTROL_L, F5, workspace, 5 bind = CONTROL_L, F6, workspace, 6 bind = CONTROL_L, F7, workspace, 7 bind = CONTROL_L, F8, workspace, 8 bind = CONTROL_L, F9, workspace, 9 bind = CONTROL_L, F10, workspace, 10 bind = CONTROL_L, F11, workspace, 11 bind = CONTROL_L, F12, workspace, 12 # Move active window to a workspace with mainMod + SHIFT + [0-9] bind = CONTROL_L SHIFT, F1, movetoworkspace, 1 bind = CONTROL_L SHIFT, F2, movetoworkspace, 2 bind = CONTROL_L SHIFT, F3, movetoworkspace, 3 bind = CONTROL_L SHIFT, F4, movetoworkspace, 4 bind = CONTROL_L SHIFT, F5, movetoworkspace, 5 bind = CONTROL_L SHIFT, F6, movetoworkspace, 6 bind = CONTROL_L SHIFT, F7, movetoworkspace, 7 bind = CONTROL_L SHIFT, F8, movetoworkspace, 8 bind = CONTROL_L SHIFT, F9, movetoworkspace, 9 bind = CONTROL_L SHIFT, F10, movetoworkspace, 10 bind = CONTROL_L SHIFT, F11, movetoworkspace, 11 bind = CONTROL_L SHIFT, F12, movetoworkspace, 12 # Scroll through existing workspaces with mainMod + scroll bind = $mainMod, mouse_down, workspace, e+1 bind = $mainMod, mouse_up, workspace, e-1 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow #Lock the screen bind = $alt, l, exec, hyprlock # Submaps bind = ALT,R,submap,resize submap = resize binde = ,right,resizeactive,10 0 binde = ,left,resizeactive,-10 0 binde = ,up,resizeactive,0 -10 binde = ,down,resizeactive,0 10 bind = ,escape,submap,reset submap=reset ======Config-End======== ```Description
This is a continuum of this. I created a script that launch FireFox with custom window class name.
I notice something...
When a class name exist with more than 2 characters identical then rules do not work properly
For example.
If i have a rule.
windowrulev2 = workspace 1 ,class:(FMP)
And a rulewindowrulev2 = workspace 2 ,class:(FM)
The window with the class FMP it will open on the
workspace 2
. The expected reaction in my opinion it will be to open to theworkspace 1
.If we now change the
FMP
name toFAMP
. Now it works.My thinking is that Hyprland reads the FMP and FM as the same thing.
I do not know if that is indented or not. If it is never mind. But for my brain is strange.
How to reproduce
windowrulev2 = workspace 1 ,class:(FMP)
firefox --name FMP
Crash reports, logs, images, videos
None.