Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scratchpads running, but wont show up #40

Closed
darkshitllord opened this issue Jan 4, 2024 · 12 comments
Closed

Scratchpads running, but wont show up #40

darkshitllord opened this issue Jan 4, 2024 · 12 comments
Labels
invalid This doesn't seem right

Comments

@darkshitllord
Copy link

darkshitllord commented Jan 4, 2024

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.

@fdev31
Copy link
Collaborator

fdev31 commented Jan 6, 2024

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

@darkshitllord
Copy link
Author

darkshitllord commented Jan 6, 2024

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.

@fdev31
Copy link
Collaborator

fdev31 commented Jan 6, 2024

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.

@darkshitllord
Copy link
Author

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.

@fdev31
Copy link
Collaborator

fdev31 commented Jan 12, 2024

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.

@darkshitllord
Copy link
Author

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.

@fdev31
Copy link
Collaborator

fdev31 commented Jan 13, 2024

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%"

@fdev31
Copy link
Collaborator

fdev31 commented Jan 14, 2024

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

Is it working for you ?

@darkshitllord
Copy link
Author

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.

@fdev31
Copy link
Collaborator

fdev31 commented Jan 15, 2024

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.

@darkshitllord
Copy link
Author

darkshitllord commented Jan 15, 2024

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!

@fdev31
Copy link
Collaborator

fdev31 commented Jan 15, 2024

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

@fdev31 fdev31 closed this as completed Jan 15, 2024
@fdev31 fdev31 added the invalid This doesn't seem right label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants