SpacingBat3 / WebCord

A Discord and SpaceBar :electron:-based client implemented without Discord API.
MIT License
1.88k stars 94 forks source link

flags file #382

Open boredland opened 1 year ago

boredland commented 1 year ago

Is your feature request related to a problem? Please describe.

It would be nice if one could provide a ~/.config/webcord-flags.conf to configure electron runtime flags (--enable-features=WaylandWindowDecorations --ozone-platform-hint=auto in my case). Other applications I use (vscode, tons of browsers) provide such a file and thus are easy to configure.

Describe the solution you'd like

Either a hint to an existing flags-file or an implementation of such.

Describe alternatives you've considered

Setting the flags in the .desktop file. Vanishes with each update.

SpacingBat3 commented 1 year ago

Is your feature request related to a problem? Please describe.

It would be nice if one could provide a ~/.config/webcord-flags.conf to configure electron runtime flags (--enable-features=WaylandWindowDecorations --ozone-platform-hint=auto in my case). Other applications I use (vscode, tons of browsers) provide such a file and thus are easy to configure.

Describe the solution you'd like

Either a hint to an existing flags-file or an implementation of such.

Describe alternatives you've considered

Setting the flags in the .desktop file. Vanishes with each update.

This is impossible to implement via the application itself (at least without expecting the bugs to occur). The problem is that some flags such as --ozone-platform-hint=auto aren't applied correctly via the Electron API (at least once I've been testing that). On Arch some apps like even the Chromium itself provide such file by wrapping the binary into a shell script, so I guess I could implement something like this in my AUR PKGBUILD.

boredland commented 1 year ago

I did not know that those are just little wrappers. Would be very nice if we could have one along with webcord!

SpacingBat3 commented 1 year ago

I did not know that those are just little wrappers. Would be very nice if we could have one along with webcord!

You might as well request this for another AUR packages. I do not maintain all of them and flags support would be highly dependant on app packaging. Also for Electron Forge (non-arch stuff) I don't think there will be anything close, TBH I've only saw Arch Linux doing that weird thing to wrap Electron binaries into a shell script and provide a flags config implementation in such way.

As of me, I'll probably work on webcord-git PKGBUILD once I'll be sure what should I do with v4.

boredland commented 1 year ago

You might as well request this for another AUR packages.

Good idea, will do. Perhaps first you add it to webcord-git, so one can point to a diff as an example.

boredland commented 1 year ago

Actually setting --ozone-platform-hint=auto seems to be enough to start the current version on wayland without the "blur". I guess we could just add that to the regular .desktop file? That way even non-arch wayland users would profit.

SpacingBat3 commented 1 year ago

Actually setting --ozone-platform-hint=auto seems to be enough to start the current version on wayland without the "blur". I guess we could just add that to the regular .desktop file? That way even non-arch wayland users would profit.

Native Wayland support in Chromium (as well as in some other browsers like Firefox/Gecko-based ones) as well as in Electron itself is still considered to be experimental through and while it could actually work better for some, others might experience more crashes and visual artifacts when switching to native Wayland than staying with XWayland. Using WebCord for that reason is still a bit problematic, although I'm trying my best to make it the best experience possible. For that reason, I think it should be kept the way it is.

HanabishiRecca commented 1 year ago

Setting the flags in the .desktop file. Vanishes with each update.

You can place modified .desktop file into ~/.local/share/applications/ directory and it will override the system one. https://wiki.archlinux.org/title/Desktop_entries#Modify_desktop_files

boredland commented 1 year ago

Setting the flags in the .desktop file. Vanishes with each update.

You can place modified .desktop file into ~/.local/share/applications/ directory and it will override the system one. https://wiki.archlinux.org/title/Desktop_entries#Modify_desktop_files

Uh, thank! Never knew that.

SpacingBat3 commented 1 year ago

@boredland Implemented for @reforged/maker-appimage in cb7a7ab. This will both affect WebCord in the future release of ReForged as well as other Electron projects which will toggle this feature.

As described in docs, it follows the same file format as described in Arch Wiki, including the support for ignoring the lines starting with hash (#).

SpacingBat3 commented 1 year ago

As WebCord v4.3.0 now comes with new AppImages supporting these flags, the only thing that holds me from closing this issue ticket is to implement this in webcord-git on AUR. And even inside AppImages this feature might only be Arch-dependant, as I don't want to implement something that is non-standard in other distros or packages.

If I would want to make this feature work across all distributables, I would probably need to use hooks and generate a wrapper that would be used instead of Electron binary to make this happen.

SpacingBat3 commented 1 year ago

(...) the only thing that holds me from closing this issue ticket is to implement this in webcord-git on AUR.

Or maybe it is better to rely on currently available Arch Linux wrapper for Electron that already interprets electron-flags.conf and do no updates? @boredland any thoughts?