hyprland-community / pyprland

Scratchpads & many goodies for Hyprland [maintainer=@fdev31]
MIT License
348 stars 15 forks source link

opening firefox - open a normal hyprland window #35

Closed i-am-logger closed 9 months ago

i-am-logger commented 9 months ago

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 commented 9 months ago

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 ?

i-am-logger commented 9 months ago

shouldn't the window appear floating?

fdev31 commented 9 months ago

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.

i-am-logger commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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 :)

i-am-logger commented 9 months ago

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