-
Notifications
You must be signed in to change notification settings - Fork 15
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
Bug: Multiple chrome PWA apps in scratchpad #31
Comments
This is not a pypr bug but a google chrome issue, also it looks like you are not using the right arguments... Check https://bugs.chromium.org/p/chromium/issues/detail?id=118613 I got "class" working on google chrome using the following: There could be more complications to it but it looks like setting user-data + class will allow configuring each app separately. Thank you for being a user! :) PS: You can verify your google chrome options checking the properties if the app in |
Thank you for a quick response! I got the command from I tried using I changed the command to this one: Here is output from
I can start every PWA app from the terminal without problems, all of them with unique class. It's just |
While hyprctl clients show correct info.... ! Can you please check the output of "px axuw" and find the lines matching the PID of the chrome clients windows ? Is the PID of every client the same ? Since the option you are using isn't working for me I assumed that was the problem, but maybe that is indeed something in Pyprland... For me it's not clear what is going wrong yet. If you do similar setup with another "real" app (not a webapp) I guess there is no problem ? |
Yes, real apps (like different kityy) or even electron apps work fine. It's only PWA apps that have this problem. These are the 2 PWA apps with pid 53923 and 16104. Interesting that it's different command than what is in
|
Can you also provide the pypr debug logs when you try to show a scratchpad ? If you don't want to send everything, when you toggle the scratch the first time, you should see something such as:
That's the part which I'm the most interested in, but please include a good amount of the events / lines received before & after that |
Of course, attached is a full log from system start, you can see I first started first app successfully (ytmusic) and then second one failed (amplenote) pypr_launch_log.txt
|
This is strange, this error should happen if you didn't define "amplenote" in the config... |
yes, this log is from fresh boot. It should be easy to reproduce, just go and install a couple of PWA apps, for example youtube music and google meet. And click This should add an entry to your launcher (in my case it created a |
Ok it is now clear, every window uses the same PID (visible if you run more than one app and dump |
Ok, it looks like a real mess, the scratchpad is able to relaunch an app if it has been closed for instance, hence there is process tracking required at several levels. I can try to make something to ignore that, as a workaround for such app, but it will break some of the existing features. On top of that, it also means I have no way to know that an app as started or not. EDIT: It's terrible code with some duplication, but I made it work in a degraded way (no process tracking - which makes it crap since it doesn't relaunch the app if it was closed) I guess there are more improvements, trying to track the window via the class name instead. I need to see the final code before deciding if it should be merged or not. If I push some experimental branch are you able to test it ? |
Hi, same as in other ticket - I'm very happy to test, I'm a dev so I know my way around git but I don't know python ecosystem at all so not sure what to do after checking out the branch. I'm on arch and have python installed. Thank you for that work, i don't like PWAs but unfortunately it's the only available option for some apps for me. |
Great :) It's still degraded functionality and only Here are my test configs: [scratchpads.zic]
command = "/opt/brave-bin/brave --profile-directory=Default --app-id=cinhimbnkkaeohfgghhklpknlkffjgod"
class = "brave-cinhimbnkkaeohfgghhklpknlkffjgod-Default"
class_match = true
size = "50% 50%"
pwa_hack = true
[scratchpads.meets]
command = "/opt/brave-bin/brave --profile-directory=Default --app-id=kjgfgldnnfoeklkmfkjfagphfepbbdan"
class = "brave-kjgfgldnnfoeklkmfkjfagphfepbbdan-Default"
class_match = true
size = "50% 50%"
pwa_hack = true I'll push on git a commit with this experimental change. Just let me know how that change works for you, and also comment the naming ("hack" isn't really nice even though it shows it will be degraded ? I was thinking in "is_pwa" or "unreliable_pid" or something like this...) EDIT: It seems to sometimes start an app twice, but even with all the logging I can't figure how it's possible... EDIT2: pushed the code |
I don't like to add complexity for such "broken" apps... but if it's becoming popular it's probably good to have some support. On my side, I have the same kind of contraints, but I'm not installing the apps, I just have one browser window with every web app I need, without having separate windows for each, but it's a bit messy sometimes. |
Thank you for that! I also use something similar to you - one of the apps I have in scratchpad is |
I like I used to have "box" apps for every messenger thing, but it always added some complications & problems compared to a webbrowser... I also had a dedicated "home" directory with separate everything for those chat apps only, but in the end it feels more natural & convenient to share everything even though it's a bit more messy. Keep me informed about how the latest git commit works for you! |
Oh, so the best option is probably to make a "-git" package... it will also be useful for more users... I just pushed one, feel free to test it yourself: If you have some package manager which supports AUR, just search
If you don't have such, you can do it the hard way: mkdir pyprland-git
cd pyprland-git
cat > PKGBUILD <<EOF
# Maintainer: Fabien Devaux <fdev31@gmail.com>
# Contributor: Fabien Devaux <fdev31@gmail.com>
pkgname=pyprland-git
pkgver=r255.bfedf14
pkgrel=1
pkgdesc="Easy scratchpads, smart monitor placement and more hyprland tweaks (GIT version)"
arch=(any)
url="https://github.com/fdev31/pyprland"
license=('MIT')
groups=()
depends=('python')
makedepends=('git' 'python-build' 'python-installer' 'python-poetry')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
replaces=()
backup=()
options=()
install=
source=(git+"https://github.com/fdev31/pyprland#branch=main")
noextract=()
md5sums=('SKIP')
pkgver() {
cd "$srcdir/${pkgname%-git}"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
build() {
cd "$srcdir/${pkgname%-git}"
python -m build --wheel --no-isolation
}
package() {
cd "$srcdir/${pkgname%-git}"
python -m installer --destdir="$pkgdir" dist/*.whl
}
EOF
makepkg -sfc
sudo pacman -U *.pkg.* |
Ah thank you, I started playing and got the commands to build it locally from your |
So it looks like pyprland.toml[scratchpads.ytmusic]
animation = "fromBottom"
command = "/opt/google/chrome-beta/google-chrome-beta --profile-directory=Default --app-id=cinhimbnkkaeohfgghhklpknlkffjgod"
class = "chrome-cinhimbnkkaeohfgghhklpknlkffjgod-Default"
class_match = true
size = "90% 80%"
max_size = "1920px 80%"
# lazy = true
pwa_hack = true
unfocus = "hide"
excludes = ["wavebox", "obsidian"]
[scratchpads.amplenote]
animation = "fromBottom"
command = "/opt/google/chrome-beta/google-chrome-beta --profile-directory=Default --app-id=pfphgelppkenhllngngioolkaeelhlmi"
class = "chrome-pfphgelppkenhllngngioolkaeelhlmi-Default"
class_match = true
size = "50% 80%"
max_size = "1920px 80%"
# lazy = true
pwa_hack = true
[scratchpads.gmeet]
command = "/opt/google/chrome-beta/google-chrome-beta \"--profile-directory=Profile 1\" --app-id=kjgfgldnnfoeklkmfkjfagphfepbbdan"
animation = "fromRight"
class = "chrome-kjgfgldnnfoeklkmfkjfagphfepbbdan-Profile_1"
class_match = true
size = "50% 80%"
max_size = "1920px 80%"
# lazy = true
pwa_hack = true
unfocus = "hide" pypr.log
|
I did some more testing today, after uncommenting
In this log i started pypr.log
|
Can you please install the package again when you have fixed your other issues. |
It works great now, thank you very much! At first, I encountered problems but I solved them by setting Also noticed the config param name is still Thanks again! |
Yes, I didn't decide for the final name yet... but I may pick I'll add some notes in the troubleshooting part for this feature. |
FYI I pushed an update (in -git branch) which should fix the floating state.... |
Yesterday I made a refactoring of this code. |
following, will be able to test on nixOS |
Great!
I pushed it yesterday 🙂
Le sam. 2 déc. 2023 à 02:09, SnIcK ***@***.***> a écrit :
… following, will be able to test on nixOS
—
Reply to this email directly, view it on GitHub
<#31 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB2IHUVXNLFKWU6ZK7YPK3YHJ5T3AVCNFSM6AAAAAA736EESOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZWHE3TGMJZHA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
of course I'm happy to test! |
Great :) |
seems to be working fine for me on |
Some applications don't provide native linux experience and are installed as PWAs (e.g. google meet, yt music, amplenote).
The problem is that currently only 1st PWA application works in a scratchpad, and others give an error:
/
Failed to show scratch. The command terminated successfully, is it already running
.I believe this is because chrome reuses the same process id when running multiple applications.
In sway I was just launching the apps and then matched them by app_id that is specific for each application, but it doesn't seem to work here.
Here is a snippet from my config:
Thank you for your help and this amazing project!
The text was updated successfully, but these errors were encountered: