Describe the bug
In WSL1, there are 2 issues:
In WSL2, there is an additional issue:
To Reproduce
Take firefox as an example:
Steps to reproduce the behavior:
1) install firefox
sudo apt install firefox-esr
2) run pengwin-setup, select "GUI", select and run "STARTMENU"
3) close pengwin terminal
4) double-click "Firefox ESR (ESL)"
Firefox is not launched.
I had just worked out a "temporary" solution.
I documented my notes on this workaround at:
https://github.com/eliranwong/wsl2/blob/master/gui_tricks/windows_shortcuts.md
But I hope it is a "temporary" solution. I am looking forward to a better solution if possible.
Hello,
Thank you for the detailed reporting. A version of wsl utilities 2.3.4 will be released soon with a fix that will load the whole environment as if you open pengwin for the shortcuts. This should fix the problem.
About WSL2 we are working hard but it will take time. We will look at your script.
Regards,
Carlos
I would like to share some findings after a few more days of testing, so that you may consider to perfect the future updates of pengwin with regards if generating windows shortcut.
After a lot of testing Windows shortcuts with Linux GUI apps, I finally need two slightly different scripts to run different GUI apps. They are:
https://github.com/eliranwong/wsl2/blob/master/bin/startmenu
and
https://github.com/eliranwong/wsl2/blob/master/bin/startmenu2
In the script "startmenu" above, I simply use export $(dbus-launch --exit-with-x11), without using dbus-launch with the input method and the GUI app.
In script "startmenu2", I need to use dbus-launch for both the input method and the GUI app.
They difference is slight, but things get complicated when I want to get the input method to work for the GUI app after launching via Windows shortcut file.
I try to write some notes on it at: https://github.com/eliranwong/wsl2/blob/master/gui_tricks/windows_shortcuts.md
In short, taking "firefox" and "gnome-terminal" as examples,
both scripts can launch both apps without consideration of input method.
However, launching "firefox" is perfect only with "startmenu" script. Launching "firefox" with "startmenu2" script breaks the input method.
In contrast, launching "gnome-terminal" is perfect only with "startmenu2" script. Launching "gnome-terminal" with "startmenu" script breaks the input method.
I didn't go deep to investigate the reasons. I leave that to professionals like you.
To me, all GUI apps, at least work with one of the scripts, including input method. so it is fine for me for now.
but I can imagine there may be a factor to consider in order to find out a unified solution for future update of pengwin, regarding Windows shortcut files. May I suggest when you guys find a solution on it, please test with both firefox and gnome-terminal and please test the input method as well?
Appreciate your work so much.
Thanks for working on pengwin.
another issue on Windows shortcut file found.
I installed "thunar", one of its Windows shortcut file, generated with pengwin-setup > GUI > STARTMENU has a target string too long to be complete.
... export DISPLAY=:0; /usr/lib/x86_64-linux-gnu/Thunar/Thun
the string should end with:
... /usr/lib/x86_64-linux-gnu/Thunar/ThunarBulkRename"
I think the target field has a limit on the number of allowed characters. that's why the shortcut generated by pengwin-setup doesn't work in this case.
for now, I use the solution mentioned above to open this shortcut file.
@eliranwong Check this PR: https://github.com/WhitewaterFoundry/pengwin-setup/pull/216 I was able to run all your examples there. Tomorrow I will repeat the test with WSL2. If you want to test with WSL2 make sure you use the modified 00-pengwin.sh as well
Thanks for checking. Could you please also check if input method break after applications launch with shortcuts? May I also suggest when you test WSL2, can you also test google-chrome, falkon, which runs in WSL2 only? many thanks.
I should be run as always with pengwin-setup. If you want, run this script with sudo to change your configuration to dev and pengwin-setup will be updated.
Or you can apply the change in /usr/local/pengwin-setup.d/shorcut.sh and add the generate-shorcut.sh to this directory
@crramirez
I tried the shortcuts, created your script, generate-shorcut.sh, with firefox and gnome-terminal
Firefox:
gnome-terminal:
expr: syntax error: unexpected argument ‘4’
sed: -e expression #1, char 1: unknown command: `,'
<3>init: (25863) ERROR: UtilConnectToInteropServer:300: connect failed 2
though with these errors, the gnome-terminal is launched, input method is working with it too.
as I mentioned somewhere above, I managed to run both firefox & gnome-terminal, perfectly together with input method, but only with two slightly different approaches. For now, it is okay for me, but I am still looking forward to a unified approach.
https://github.com/WhitewaterFoundry/Pengwin/issues/551#issuecomment-562151978
I am now using pengwin version 1.3.4. I found previous issues had been fixed. Many thanks for that.
To make the shortcuts to work with ibus, I created a file
/etc/profile.d/ibus.sh
with the following content:
export LC_CTYPE="zh_CN.UTF-8"
export XIM=ibus
export XIM_PROGRAM=/usr/bin/ibus
export QT_IM_MODULE=ibus
export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export DefaultIMModule=ibus
ibus-daemon -drx
with this, ibus works with GUI apps launched with shortcuts, even terminal is not opened.
Excellent thanks for testing and for the script. We will include it in pengwin-setup when we have time.
Regards
Most helpful comment
I am now using pengwin version 1.3.4. I found previous issues had been fixed. Many thanks for that.
To make the shortcuts to work with ibus, I created a file
/etc/profile.d/ibus.sh
with the following content:
with this, ibus works with GUI apps launched with shortcuts, even terminal is not opened.