vince
vince

Reputation: 1653

Add custom parameters to a programm called by wofi

I am using wofi on an arch-linux system with swaywm.

I want to use the Wofi drun menu to launch the Brave Browser. Sadly Brave doesn't support wayland by default so I have to add these parameters to make it work

--enable-features=UseOzonePlatform --ozone-platform=wayland

Is there a way to configure wofi to call

/usr/bin/brave --enable-features=UseOzonePlatform --ozone-platform=wayland

instead of just /usr/bin/brave?

Upvotes: 1

Views: 985

Answers (2)

Thijs
Thijs

Reputation: 1546

If you set Wofi to run with drun so it uses .desktop files you can create a local desktop file with the parameters you need. This may be different for you based on your Linux distribution, this answer is based on Arch.

  1. check your Sway config (~/.config/sway/config) for the right wofi show option, for example: set $menu wofi --style ~/.config/wofi/style.css --show drun
  2. make sure you have an applications folder in ~/.local/share
  3. copy the shared desktop file to your user with cp /usr/share/applications/obsidian.desktop ~/.local/share/applications in this example I use the Obsidian desktop file
  4. edit the local desktop file Exec, for example for Obsidian: Exec=/usr/bin/obsidian --ozone-platform-hint=auto
  5. reload your Sway config

Upvotes: 0

vince
vince

Reputation: 1653

I have found a fix but sadly not how to call custom parameters with wofi. For sway if you want to enable software to run nativly on wayland you need to set these enviroment variables. This allows Brave to run fine without having to use parameters.

export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_FORCE_DPI=physical
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
export ECORE_EVAS_ENGINE=wayland_egl
export ELM_ENGINE=wayland_egl
export SDL_VIDEODRIVER=wayland
export _JAVA_AWT_WM_NONREPARENTING=1
export MOZ_ENABLE_WAYLAND=1

NOTE: You don't need all these Parameters just to run Brave but with these you will be able to run almost every software naively.

Upvotes: 1

Related Questions