wsl-windows-toolbar-launcher: I can run Linux GUI applications via terminal, but can't run via wsl-windows-toolbar.

My environment:

Windows 10 OS version: 2004 OS build: 20190.1000 (insider preview “dev”) WSL: Ubuntu-20.04.1 Linux kernel: 4.19.121 X-server: VcXsrv Ubuntu desktop environment: KDE plasma

Can you tell me, please, why Linux applications don’t run via wsl-toolbar, but they run through a terminal?

For reasons I don’t understand, I can’t run Linux GUI applications with the DISPLAY variable defined in the recommended way:

export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0.0.

Instead of this command, I use the IPv4 address: 192.168.0.107 as the value of the DISPLAY variable.

I found this value of the DISPLAY variable by a random choice method and the applications started to run.

In my .zshrc file I put the following lines of code — as recommended in the already closed question: https://github.com/cascadium/wsl-windows-toolbar-launcher/issues/4:

export DISPLAY=192.168.0.107:0.0
# If not running interactively, don't do anything (wsl-launcher)
[ -z "$PS1" ] && return

Still, applications are not launched via wsl-toolbar.

I can run Linux GUI applications through the terminal, but can’t via wsl-windows-toolbar.

Tell me, please, what other information do I need to give you so that you can determine what I did wrong?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 25 (12 by maintainers)

Most upvoted comments

Hmm there must be something on down which is switching you back to .bashrc. My point was more when you run this command, does “Yes I am getting parsed 😃” get printed to make sure you’re getting that far.

Maybe we should just embrace it and lean into zsh (which is what i meant originally but I’m at a computer now 😃)

  1. Passing --rc-file ~/.zshrc to your toolbar launcher script command (though that launches within bash so could cause issues, but is the least invasive option)
  2. Using --jinja-template-shell /path/to/template.j2 where template.j2 is a file with these contents:
#!/bin/zsh -i

~/.zshrc

{% if exec_dir is defined and exec_dir != "" %}

cd "{{exec_dir}}"

{% endif %}

{% if run_in_terminal is defined and run_in_terminal == True %}

{{command}}

{% else %}

{{command}} > /dev/null 2>&1 &
disown

{% endif %}