hyprland-community/pyprland

Scratchpads running, but wont show up

Closed this issue · 12 comments

I'm experiencing a problem where when i run an application in a scratchpad it does run the program but wont display it. I think this problem occurs when a program is running trough xwayland instead of native wayland, since everything I've tried so far suggests that being the issue. It would be nice if someone could try reproducing it because I've not seen anyone online raise this issue. I'm running arch linux if that information helps.

Maybe this isn't even a pyprland problem but a hyprland one, not sure.

what happens if you launch the app from a terminal instead ?

this is the configuration i generally have for a few windows:

$code = class:^(code-oss)$ windowrulev2 = float, $code windowrulev2 = $scratchpadsize, $code windowrulev2 = workspace special silent, $code windowrulev2 = center, $code

this one:

windowrulev2 = workspace special silent, $code

makes the window not appear when trying to toggle it, but I've only encountered this problem with programs running trough xwayland.

So when i launch the application without this window rule it seems to work as intended, but if not it won't appear.

Oh ok, if you added some special configuration like this it's probably the problem since it's not using the same as the internal settings.

Pypr will set the workspace and floating state for you, no need for a configuration if you set the class attribute.

Unfortunately that does not fix the problem, for example vs code does not even appear when the class attribute is set, qbittorrent and vlc appear but lose functionality, after some certain actions (when removing a torrent in qbittorrent, or when pressing any button in vlc) they freeze and cannot be interacted with. When i remove the class attributes they work as intended. I have no clue as to what could be causing the issues.

Not all apps get the same parameters.
Without any parameter, vscode have the class "Code" here.
Can you check on your environment and see if setting class="Code" or whatever you see on your system fixes the problem ?

I'm also wondering what kind of problem you experience on your system, it's not really something that can be produced by Pyprland.

Unfortunately I've had no luck with fixing this problem. I usually check for classes by doing hyprctl clients, it also displays which programs are running trough xwayland, that's why i thought maybe that was the issue since all of the programs causing issues do.

Since the specific class for vscode is "code-oss", at least on my system ,setting anything other than that just executes the command and displays another instance of vscode. And if the class "code-oss" is set it just creates a new instance every time but places it in a special workspace, making me unable to actually display the program.

Currently i have no clue as to what could be causing the problem.

I just tested vscode, it's indeed broken because the process exits and behaves like a progressive web app.
Check https://github.com/hyprland-community/pyprland/wiki/Troubleshooting#disable-process-management

I had success with the following configuration (you will probably need to adapt command & class to match your system):

[scratchpads.code]
animation = "fromLeft"
command = "code"
lazy = true
class = "Code"
process_tracking = false
size = "40% 45%"
position = "5% 5%"

In short, you must use "class" and try combinations of process_tracking=false and class_match=true.

Is it working for you ?

Tried setting the process tracking to false and different class names but didn't have any luck with setting it up to work :/.

Maybe it has something to do with the fact that i use code oss the open source version, but i dont know how it could be different.

Either way I'll probably refrain from using some apps as scratchpads for now, there are probably deeper issues not related to pyprland for some programs.

Did you also enable class matching ?
This is absolutely needed for such apps.
By default pyprland tracks the created window using the process ID, but some apps don't work in a "straightforward" way, making this unreliable.

Sorry for the trouble, i did manage to make it work with

[scratchpads.code]
command = "code"
animation = "fromTop"
lazy = true
class = "code-oss"
class_match=true
process_tracking=false

You are right, i misunderstood the documentation and did not try with class matching. Seems to be working perfectly now.

Thank you for your time and your help!

Glad it's finally working :)
I may highlight those "workarounds" more, I've seen few people struggling with similar items online...