Coder Social home page Coder Social logo

opticos / gwsl-source Goto Github PK

View Code? Open in Web Editor NEW
1.1K 1.1K 76.0 95.31 MB

The actual code for GWSL. And some prebuilt releases.

Home Page: https://opticos.github.io/gwsl/

License: Other

Python 86.32% Makefile 0.57% Shell 1.77% M4 0.31% Tcl 11.03%
bashonwindows donations gwsl-source microsoft-store premade-binaries windows-10 wsl wsl2 wsl2-forwarding-port xserver

gwsl-source's Introduction

Hi there πŸ‘‹

Opticos' GitHub stats

gwsl-source's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gwsl-source's Issues

Not working with WSLg plus Ubuntu on Windows Community Preview

Nice tool, tested and works with Ubuntu 20.04 LTS but not once you install and run WSLg in combination with the actual Ubuntu on Windows Community Preview.

I expect for that it’s now needed that you implement what was stated here:

What will happen when WSL2 gets official Wayland support? I am just as excited about this as you are. Till it is available, GWSL will only function as an XServer. When Wayland is available, there will be an option to swicth between Wayland and X as a GWSL backend. The shortcut creator and app launcher will continue to work in the new Wayland mode.

Beside the Ubuntu Preview I installed Debian and Ubuntu 20.04 under WSL2 and all 3 distros are discovered by your tool and work when I start already working GUI Apps via Windows Start menu (new option in the preview). In your Linux Apps Menu they show up but don’t open when clicking them.

Alert always pop up

as the title, the Alert keep pop up after I click Yes, but look like it not affect using

image

there is also no any log in the service.log

image

[Solution] Service crashes with RDP

I installed GWSL from the store to an older PC (Version 1.3.6 (store)).
When GWSL is started, then it reports "LoadLibrary failed with error 87: Wrong parameter".
Then GWSL says: "Hmm... The GWSL service just crashed or was closed. Do you want to restart the service?".
Doing "Yes" repeats the whole process, and saying "No" closes GWSL.
As long as the dialogs are open, the system tray menu of GWSL works, and I can also start the "Distro Tools" etc.
But no X-Server function.

  1. The log-files (dashboard.log and service.log) are both empty (0 bytes).
  2. It's started on an AMD Phenom(tm) II X4 945 Processor (SSE_42 instructions not supported), 16 GByte RAM, Windows 10 20H2, x64.
  3. In wsl2 a "Ubuntu 20.04.1 LTS" distribution is running, however the WSL instance is still called "Ubuntu-18.04" (I made a distribution upgrade).
  4. The PC on which WSL2 and GWSL are running is used via Microsoft's RemoteDesktop.
  5. A test with commercial X410 X-Server in the same situation has worked without problem, i.e. the Ubuntu distribution should not be a functional problem.

What could I try?

I tried GWSL on another PC with Intel CPU. There everythings works fine! But I would also like to use it on this older system...

I appreciate your help!

(Edited: Added GWSL's version)

Spikes in CPU load

While running the app in background I noticed that there are usage spikes about every 5 seconds. I was not yet able to pinpoint which component is directly responsible, but it directly correlates with GWSL running.

I can probably exclude VcXsrv as the culprit since I had been running the most recent standalone version and haven't notices this behavior before.

The 5 second interval of usage of about one full core is a bit annoying, since that keeps the CPU from reducing the core frequency and therefore my fan is constantly spinning.

Further system info: latest Windows 10 2009 Release Preview build, 2 Ubuntu WSL instances, one WSL1 (always running), one WSL2 (running on demand).

GWSL freezes when I try to launch app from Linux Apps

When I try to launch an app from Linux Apps, the GWSL just freezes until I force close it
image

My default shell is fish and I installed it from the store. Yes, I added this to my config.fish

Also, an app look gigantic if I set both dpis

### Export DPI
export GDK_SCALE=2
export QT_SCALE_FACTOR=2

image

Why do my windows close when my internet changes? WSL BUG

If the internet connection is lost, the active windows on the x11 server will close, but the process will remain active.

Steps to reproduce

  1. On any smartphone, turn on both mobile data and mobile hotspot
  2. On the pc, connect to the hotspot network
  3. Start any graphical app on GWSL
  4. On the smartphone, turn off mobile data
  5. The window with the graphical app will close
  6. Use ps to check for running processes - the app process will still be active, but you won't be able to use it

GIMP crashing on startup

I am unable to get GIMP running. It crashes on startup.
Are there any necessary details you would require from me?

[Feature Request] Add option for run app in wayland mode

Microsoft has released initial support for wayland in the latest preview version, it's time to add the option.
And the command line for launch app will looks like C:\Windows\System32\wslg.exe ~ -d <Distro> gedit

image

(DPI Scaling is still an issue in the initial version)

[Question] Using GWSL with ZSH

I have ZSH as my default shell and was wondering if I needed to add any extra lines to zshrc like for Fish? Thanks and really love the application!

Can't open a single app

Hello! I don't know to contact you so I do it here πŸ˜…

Thanks for sharing your work it is very cool. The problem is I can't see a single application launching on my Windows desktop.
I'm using Ubuntu 20.04 in WSL2 mode.
I just want to open gitkraken for example by launching the gitkraken command. How do I do this ?
Just tried to use a shortcut and test the config.
I know that gitkraken is running on the Ubuntu but nothing happens on the windows side.
Can you help me with that ?
Thanks a lot

Stuck keys when editing text files

This is the same issue as VcXsrv https://sourceforge.net/p/vcxsrv/bugs/59/
However, the workaround described there (clicking on the X icon) does not work in GWSL. I realize that GWSL is based on VcXsrv, so probably can't fix the issue itself, but is there at least a workaround like there is in VcXsrv? Otherwise I'm forced to kill either X or WSL in general every time this happens.

Syntax errors when opening wsl terminal

Opening a shell with "Linux Shell" option results in syntax errors.

expr: syntax error: unexpected argument β€˜4’
sed: -e expression #1, char 1: unknown command: `,'
expr: syntax error: unexpected argument β€˜4’
sed: -e expression #1, char 1: unknown command: `,'
thearcanebrony@DESKTOP-0ABLLGL:~$```

WSL distro: Ubuntu 20.04.1

Error in .bashrc after instrumentation

GWSL has modified my .bashrc in a way that breaks it:

expr: syntax error: unexpected argument  '4'
sed: -e expression #1, char 1: unknown command: `,'

This is in a clean WSL2 Ubuntu 20.04 install.

Issues Debugging Code Due to Calls to GWSL.exe

I can run GWSL for debugging purposes like so: python main.py

However, the tray menu doesn't work correctly for the dashboard, etc. as these menu items call GWSL. It is expecting to find GWSL at the root of the repo (and it isn't there).

I can run python build.py and build GWSL so that the files exist in the dist/GWSL folder but it looks like there are a lot of files in the distribution and I probably can't copy GWSL by itself into the root of my repo and would like to avoid cluttering the root of the repo with distribution files.

How are you handling this? I'm guessing I'm doing something simple wrong, but haven't figured it out yet!

Disable PRIMARY when using clipboard

Hello!
Could you add the ability to disable PRIMARY when using clipboard?
In VcXsrv this is implemented, but in GWSL it is hardcoded:

if clipboard == True:
  default_arguments.append("-clipboard")
  default_arguments.append("-primary")
else:
  default_arguments.append("-noclipboard")
  default_arguments.append("-noprimary")

Display auto export doesn't work

I having problems with Display Auto Export
I'm getting these erros.

image

It is showing 5 times because I clicked 5 times in menu option. I thought that by clicking again it will uncheck the option and undo all changes.

So, how can a undo all changes by myself? Which files I have to watch?

[Bug] Some Windows Accent Colors Cause Crashes

I am using the Store version 1.3.6.0, even after reinstall the app, there are icon on taskbar and notification are but I do not have any windows display
Edition Windows 10 Education
Version 20H2
Installed on β€Ž12/β€Ž14/β€Ž2019
OS build 19042.508
Experience Windows Feature Experience Pack 120.2212.31.0

How to Use GWSL for KeX?

I see you had left a comment on reddit that GWSL can be used by Kex instead of the default tiger vnc. How can I do that?

Network disconnect closes X11 windows

The GWSL_EXPORT_DISPLAY script uses the IP address attached to my WiFi interface. Replacing this IP address with the IP of the virtual interface labeled "WSL" resolves this issue.

Fish Theming can break app launcher.

I am using ArchWSL in WSL2. Default shell is fish. Before using gwsl, I tried VcXsrv. I have this in my config.fish : set -x DISPLAY (ip route | awk '/^default/{print $3; exit}'):0.0 and I can launch Linux GUI apps properly (e.g. emacs). When trying gwsl, I can't launch emacs from "Linux Apps" or "Shourcut Creator". But if I manually use "Linux Shell", and then execute emacs, Emacs opened. Here is my logfile: dashboard.log

Use lint tool

I would love to participate (at least on my first issue about display variable.) but I found extra spaces in files for no reason.

In order to get help, adding a linter to project and CI would be a nice addition imho

Choosing a Dependency Management Solution

I'd like to contribute to the code. I noticed that there doesn't appear to be any dependency management setup at the moment. I'd be happy to do so but was wondering what dependency management solution you want to use:

  • requirements.txt
  • pyproject.toml (poetry)
  • pipfile (pipenv)

The latter two have some significant advantages over requirements.txt option, but between pyproject and pipfile I have no preference.

Dashboard Empty When HDR Enabled.

On a fresh install with Windows 10 Pro Build 21364.co_release.210416-1504, opening the dashboard only renders the backdrop. It appears the buttons are present and clickable, but there's no text or images rendered on the backdrop. Even more interesting, when attempting to take a screenshot, the text IS visible!

image

Running on 1809 ?

The latest version of Windows 10 LTS* is 1809, which I'm using on my PC. Is it possible to target this project for 1809? Or is there something required by this software not exist in 1809?
image
image

DISPLAY exporter fails if ipconfig.exe is not found in $PATH

Error occurs if Windows' $PATH env var is not merged into WSL's $PATH. Fails with "expr: syntax error: unexpected argument '4' ":

ipconfig_exec=$(wslpath "C:\\Windows\\System32\\ipconfig.exe")
> if [ -x $(which ipconfig.exe) ]
> then
>     ipconfig_exec=$(which ipconfig.exe)
> fi
> wsl2_d_tmp=$($ipconfig_exec | grep -n -m 1 "Default Gateway.*: [0-9a-z]" | cut -d : -f 1)
> if [ -n $wsl2_d_tmp ]
> then
rst_lin>     first_line=$(expr $wsl2_d_tmp - 4)
>     wsl2_d_tmp=$($ipconfig_exec | sed $first_line,$wsl2_d_tmp!d | grep IPv4 | cut -d : -f 2 | sed -e "s|\s||g" -e "s|\r||g")
>     export DISPLAY="$wsl2_d_tmp:0"
> else
>     export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk "{print $2}"):0
> fi'
++ wslpath 'C:\Windows\System32\ipconfig.exe'
+ ipconfig_exec=/c/Windows/System32/ipconfig.exe
++ which ipconfig.exe
+ '[' -x ']'
++ which ipconfig.exe
+ ipconfig_exec=
++ grep -n -m 1 'Default Gateway.*: [0-9a-z]'
++ cut -d : -f 1
+ wsl2_d_tmp=
+ '[' -n ']'
++ expr - 4
expr: syntax error: unexpected argument β€˜4’

Dual screen apps opening in middle

I have a two monitor setup on my computer. When a new linux app starts up that is not maximized, it will default to the exact center of the desktop instead of the center of the main monitor or one of the monitors. It is not really an issue since I can move the window after it opens but it would look a lot nicer if it did not perform like that.

Amazing software otherwise! Everything else has worked without issue so far!

Windows compose-key combos fail

I wish to enter characters that in native Windows apps I can enter by pressing AltGr+[key].

In GWSL apps the effect of the AltGr key is apparently ignored. Is there a way to enable these combos to work? Or a workround, such as creating an .XCompose file?

Sharing clipboard problem

Hi,

Thanks for your work, this is a really cool project. I am currently using the GWSL version from github (1.3.7). When I use "test configuration" in the shortcut creator, I have no problem sharing clipboard between linux and windows. However, once I create the short cut with the "add to start menu" button and launch linux from there, clipboard sharing stops working. If it helps, I am using Windows 10 Home Insider Preview Build 21296. Thanks !

Run with xlaunch created profile

Hi, thanks for the awesome app!!

I have small issue to run qtCreator and make the launch apps works with OpenGL I need the Native opengl box of vcxsrv disabled I'm trying to get the same behavior with gwsl but not luck, any idea how can i get this?

Attached is the profile saved from xlaunch of vcxsrv

<?xml version="1.0" encoding="UTF-8"?>
<XLaunch WindowMode="MultiWindow" ClientMode="NoClient" LocalClient="False" Display="-1" LocalProgram="xcalc" RemoteProgram="xterm" RemotePassword="" PrivateKey="" RemoteHost="" RemoteUser="" XDMCPHost="" XDMCPBroadcast="False" XDMCPIndirect="False" Clipboard="True" ClipboardPrimary="True" ExtraParams="" Wgl="False" DisableAC="True" XDMCPTerminate="False"/>

Update:

configuring GSWL vcxsrv flags i get this

Error: couldn't get an RGB, Double-buffered visual
thanks!!

ERROR: Could not find a version that satisfies the requirement pywin32

$ python --version
Python 3.8.6

$ sudo -H pip3 install 'pywin32==300'
ERROR: Could not find a version that satisfies the requirement pywin32
ERROR: No matching distribution found for pywin32

The pywin32 package exists for all Python3 versions released to date.
I had upgraded the pip dependency resolver, so I tried:

$ sudo -H pip3 install --use-deprecated=legacy-resolver pywin32
ERROR: Could not find a version that satisfies the requirement pywin32 (from versions: none)
ERROR: No matching distribution found for pywin32

Still no luck :(

Then I found this pywin32 issue: "WSL does not support pywin32". Seems the GWSL-Course installation instructions are for installing on Windows, not WSL. Gee, it would have been really nice to know this up front.

Only after fussing for an hour did I find that I could simply download the prebuilt package using Microsoft Store. Perhaps this information should be put in the project README.

Any Linux app is not opening

Any of the linux apps is not opening from "linux apps" section. Is there any step which I might me missing. I have wsl2 with ubuntu 20.04 and its completely working in terminal and also I have xfce gui and its also working.

Edit: Just found that I can open apps through the "linux shell" and also the resolution is low but isn't it supposed to also open apps through "linux apps" section. Also can I also open the xfce gui through this app or in this case I am limited to windows "remote desktop connection" app.

Root Password Saved as Plain Text in dashboard.log

Instances of plain text root password showing in dashboard.log:
21-02-10 09:49:21,482 - GWSL 1.3.7 - INFO - (run) WSL SHELL $ wsl.exe ~ -d Ubuntu . ~/.profile;nohup /bin/sh -c "echo "therootuserspassword" | sudo -H -S sudo /etc/init.d/dbus start &"

Dashboard is not showing

I've tried both the Store and the Windows Traditional release, but the dashboard just does not show.
It doesn't matter whether I click the taskbar icon on the right or the open window.

image

Using Win 10 Pro

Resolution too low (Store version only)

First of all, thanks for this awesome work. Secondly, the resolution seems too low. And this is after changing the LOW-DPI and HIGH-DPI options on the GWSL dashboard.

Any guidance will be appreciated. Thanks !!

image

Stutter with glxgears.

Greetings, I'm using GWSL to connect to my prooted linux distro which is running within Termux on my android device. Everything works fine except two things:

  1. 3D applications seems like not working except VcXsrv is in multi window configuration. (Error: couldn't get an RGB, Double-buffered visual.)
  2. I get 1000+ fps in glxgears while in multi window configuration but the spin animation constantly stutters. Seems like stutters are not random and happening in regular intervals. This made me think like it may be a refresh rate / (v)sync problem with my Windows desktop.

I would be so glad if you help me out.

Exception after setting display

After setting auto display parameter through tool and rebooting WSL, here's my error :

expr: syntax error: unexpected argument β€˜4’
sed: -e expression #1, char 1: unknown command: `,'
expr: syntax error: unexpected argument β€˜4’
sed: -e expression #1, char 1: unknown command: `,'
expr: syntax error: unexpected argument β€˜4’
sed: -e expression #1, char 1: unknown command: `,'
expr: syntax error: unexpected argument β€˜4’
sed: -e expression #1, char 1: unknown command: `,'

I used this in bashrc export DISPLAY="grep nameserver /etc/resolv.conf | sed 's/nameserver //':0" and it's working

Shortcuts not working if default WSL shell is fish

Hi there, first of all thank you so much for this tool!

After some trial and error I discovered that if I set fish as my default shell in WSL2, then the shortcuts don't work.
I can see some processes spawning and then exiting, no log is produced.

The same happens if I use cmd to run the shortcut command.

switching back to bash "solved" the problem.

I tried to run the various commands and script directly in my fish shell, here's what I found:

The first problem is in the get_ip function:

$ /bin/sh -c "echo $(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}')"
fish: $(...) is not supported. In fish, please use '(cat)'.

I set my DISPLAY in both .profile and .config/fish/config.fish, so maybe the ip discovery and DISPLAY setting can be omitted here (but I suppose it will break many things).

also setting the envvars doesn't work; in my simple case (no GTK theme set, dark windows theme and everything default):

$ GTK_THEME=Adwaita:dark /opt/pycharm-2020.2.3/bin/pycharm.sh                  (base)
fish: Unsupported use of '='. To run '/opt/pycharm-2020.2.3/bin/pycharm.sh' with a modified environment, please use 'env GTK_THEME=Adwaita:dark /opt/pycharm-2020.2.3/bin/pycharm.sh…'

In short, it would be wonderful if you can also add support to fish!

BTW, reading your code I saw many things that could be improved; are you open to code reviews/PRs? If so, can you please describe your build environment?
Of course, I could also try to fix this issue myself once I know which tools you use

Shortcut creator appears to throw error in log

Steps to Reproduce

  1. Left-click GWSL icon in tray
  2. Menu pops up
  3. Click "Shortcut creator"

Expected behavior

The shortcut creator dialog box shown in the manual should appear.

Actual behavior

No dialog appears. dashboard.log has the following lines appended:

2021-03-23 14:54:46,938 - GWSL 1.3.7 - ERROR - Exception occurred - Error in Mainloop
Traceback (most recent call last):
  File "manager.py", line 3244, in <module>
  File "manager.py", line 2901, in draw
  File "manager.py", line 2851, in short
  File "manager.py", line 2176, in shortcut
  File "manager.py", line 1897, in get_light
FileNotFoundError: [WinError 2] The system cannot find the file specified

Environment

Windows 10.1803.02.0006

Running Ubuntu 20.04 under WSL2.

Can't I install this on a different drive

Is it not possible to install this app on a different drive, Sorry I know that this is not an issue and should not be asked but I had doubts about it. When I first saw this app I thought that this app would allow me to to install a Linux Graphical Environment (GUI) seamlessly πŸ˜…

Colemak

Hi ,

How I configure support for Colemak layout?

Thank You.

[Feature request] Search bar in App List

Hi! I've been using GWSL to run graphical Linux apps alongside WSL2, and the experience has been great, so thank you for all this awesome work.

The one thing I would improve about the software, is adding a search bar to the App List, as that's something that I find myself missing each time I want to open a program. Other than that, great product as a whole.

Thank you!

Unable to start

I have installed gwsl from the Microsoft store but when i try to start it say "failed to execute script manager"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.