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

opening firefox - open a normal hyprland window #35

Closed
realsnick opened this issue Dec 1, 2023 · 7 comments
Closed

opening firefox - open a normal hyprland window #35

realsnick opened this issue Dec 1, 2023 · 7 comments
Labels
invalid This doesn't seem right

Comments

@realsnick
Copy link

tried this configuration:

[scratchpads.nixpkgs-search]
animation = "fromTop"
command = "firefox --no-remote --class nixpkgs-search --new-window https://search.nixos.org/packages"
class = "nixpkgs-search"
lazy = true
size = "50% 75%"
position = "25% 5%"
excludes = "*"

get this error:
Failed spawning nixpkgs-search as proc 608846 "firefox --new-window https://search.nixos.org/packages": The command terminated sucessfully, is it already running? Failed to show nixpkgs-search, aborting.

PS. also tried without the class

image

@fdev31
Copy link
Collaborator

fdev31 commented Dec 1, 2023

Sorry, I'm not getting the issue.
I see in the screenshot the window is appearing. Do you mean as soon as you use "class" this will not work anymore and you get the error you provided ?

@realsnick
Copy link
Author

realsnick commented Dec 1, 2023

shouldn't the window appear floating?

@fdev31
Copy link
Collaborator

fdev31 commented Dec 1, 2023

It should yes, but you also mention:

Failed spawning nixpkgs-search as proc 608846 "firefox --new-window https://search.nixos.org/packages": The command terminated sucessfully, is it already running? Failed to show nixpkgs-search, aborting.

Which means it didn't work for some reason (firefox is already launched ?)...

If I try your configuration, I see this window config:

    "floating": false,
    "monitor": 1,
    "class": "brave-browser",
    "title": "opening firefox - open a normal hyprland window · Issue #35 · hyprland-community/pyprland – Brave",
    "initialClass": "brave-browser",
    "initialTitle": "Nouvel onglet – Brave",
    "pid": 1969,
    "xwayland": false,
    "pinned": false,
    "fullscreen": false,
    "fullscreenMode": 0,
    "fakeFullscreen": false,
    "grouped": [],
    "swallowing": "0x0"
  },

So the class doesn't work as you expect, that's why pypr isn't able to set the floating state. So that's not a bug, the class of the window must match the "class" attribute in pyprland configuration .

I'm sure it will work as you expect once you figured how to set firefox's class, I'm not using it so I can't help for that.

@fdev31 fdev31 closed this as completed Dec 1, 2023
@realsnick
Copy link
Author

Thanks! though i thought without the class it should go with the pid but that didn't work either so got confused on the usage. Any browser recommendations that will work? i'll try to dig to the class of firefox and reply if i find it.

@fdev31
Copy link
Collaborator

fdev31 commented Dec 1, 2023

Welcome! I don't have much experience using webapps as scratchpads but you may be interested in #31 . On google I found some bugs for chrome regarding "class" handling, I can imagine there are similar issues with firefox.
If you get it to work feel free to share, I'll add it to some example in the wiki.

@CaptaiNiveau
Copy link

I was able to make it work using some additional flags and a separate profile:

command = "firefox --no-remote -P your-separate-profile-name --name your-class-name your-default-url"

It's important to use a different profile, otherwise firefox will refuse to open a new instance. Also, --class seems to have been deprecated in favor of --name, so keep that in mind. Using these options, I was able to make it work.

Optionally you can go into your profile and change the CSS to hide the tab and url bars, to get a pseudo full screen window. I'm using this to display some documents for work, it's really nice this way :)

@realsnick
Copy link
Author

thank you @CaptaiNiveau i'll give it a try later this week

@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

3 participants