question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:25 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
fquinnercommented, Aug 25, 2020

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 %}
0reactions
haosmoscommented, Aug 26, 2020

You haven’t passed it to the script… its wsl-windows-toolbar with that argument after. The script will parse the template you don’t need j2cli.

— I did:

wsl-windows-toolbar -J /home/haosmos/template.j2

After that, the menu creation process was started again and after creating the toolbar, the applications are not started again.

There is probably something wrong with the wsl, which prevents your script from being installed and working properly.

I think it’s better if I stop torturing you with my dilettantish questions. Please forgive me for taking up a lot of your time.

Thank you for your help, anyway!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run Linux GUI apps with WSL
Run Linux GUI apps. You can run the following commands from your Linux terminal to download and install these popular Linux applications. If...
Read more >
Running graphical Linux desktop applications from WSL 2 ...
In WSL1, Linux uses the same IP addresses than the Windows host, then, you can access the applications using localhost or 127.0.0.1; In...
Read more >
[support] Not able to run Jetbrains Toolbox · Issue #43
I'm trying to run jetbrains toolbox that is installed in WSL2 but ... I am able to run other gui apps, like xeyes...
Read more >
How to run Linux GUI apps on Windows 10 with WSL and ...
(Run winver to see what version of Windows you have.) If you want to try it out, all you have to do is...
Read more >
Using WSL 2 to run Linux GUI applications in Windows 10 ...
If you use Linux without a Desktop Environment, you just have a terminal to communicate with Linux kernel which is good when you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found