wslu
wslu copied to clipboard
[wslusc] Shortcut is invalid after I change the icon of it.
Background Information:
- wslu v2.3.6; wslusc v37
- WSL: Ubuntu 20.04
Describe the bug
I use this command wslusc -g -e "export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0 LIBGL_ALWAYS_INDIRECT=1;" $(which emacs)
to create a shortcut for emacs.
That shortcut works. But after I changed the icon of it, it doesn't work anymore. (spacemacs.ico downloaded from here: https://github.com/nashamri/spacemacs-logo)
Can you show the results from the Windows PowerShell using $s=(New-Object -COM WScript.Shell).CreateShortcut("<PATH/TO/YOUR/SHORCUT>"); $s
and replace <PATH/TO/YOUR/SHORCUT>
with the path to your shortcut? Thank you!
Also, please try out the PPA version of wslu using the method here: https://wslutiliti.es/wslu/install.html#ubuntu
PS C:\Users\stskyblade> $s=(New-Object -COM WScript.Shell).CreateShortcut("C:\\Users\\stskyblade\\Desktop\\emacs.lnk"); $s
FullName : C:\Users\stskyblade\Desktop\emacs.lnk
Arguments : C:\\Users\\stskyblade\wslu\runHidden.vbs "C:\\Users\\stskyblade\\AppData\\Local\\Microsoft\\WindowsApps\\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\\ubuntu2004.exe" run "cd ~;
. /usr/share/wslu/wsl-integration.sh; export DISPLAY=172.21.0.1:0 LIBGL_ALWAYS_INDIRECT=1; /usr/bin/emacs"
Description :
Hotkey :
IconLocation : C:\\Users\\stskyblade\wslu\wsl.ico,0
RelativePath :
TargetPath : C:\Windows\System32\wscript.exe
WindowStyle : 1
WorkingDirectory :
I have reinstalled wslu using PPA. Here is wslu version:
> wslusc --version ─╯
wslu v3.2.2-1; wslusc v40
The new generated shortcut emacs-27.127
is invalid as well.
Here is output of your command:
PS C:\Users\stskyblade> $s=(New-Object -COM WScript.Shell).CreateShortcut("C:\\Users\\stskyblade\\Desktop\\emacs-27.127.lnk"); $s
FullName : C:\Users\stskyblade\Desktop\emacs-27.127.lnk
Arguments : C:\\Users\\stskyblade\wslu\runHidden.vbs C:\\Users\\stskyblade\\AppData\\Local\\Microsoft\\WindowsApps\\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\\ubuntu2004.exe run export D
ISPLAY=172.23.16.1:0 LIBGL_ALWAYS_INDIRECT=1; /usr/share/wslu/wslusc-helper.sh "/usr/bin/emacs-27.127 "
Description :
Hotkey :
IconLocation : C:\\Users\\stskyblade\wslu\wsl-gui.ico,0
RelativePath :
TargetPath : C:\Windows\System32\wscript.exe
WindowStyle : 1
WorkingDirectory :
Are you using Windows 11 with WSLg?
I'm using Windows 10.
Can you print the content of the shortcut after you change the icon? Thanks!
Do you mean the output of $s=(New-Object -COM WScript.Shell).CreateShortcut("C:\\Users\\stskyblade\\Desktop\\emacs-27.127.lnk"); $s
?
This is a shortcut with original icon, and it doesn't work now.
PS C:\Users\stskyblade> $s=(New-Object -COM WScript.Shell).CreateShortcut("C:\\Users\\stskyblade\\Desktop\\emacs-27.127.lnk"); $s
FullName : C:\Users\stskyblade\Desktop\emacs-27.127.lnk
Arguments : C:\\Users\\stskyblade\wslu\runHidden.vbs C:\\Users\\stskyblade\\AppData\\Local\\Microsoft\\WindowsApps\\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\\ubuntu2004.exe run export D
ISPLAY=172.21.128.1:0 LIBGL_ALWAYS_INDIRECT=1; /usr/share/wslu/wslusc-helper.sh "/usr/bin/emacs-27.127 "
Description :
Hotkey :
IconLocation : C:\\Users\\stskyblade\wslu\wsl-gui.ico,0
RelativePath :
TargetPath : C:\Windows\System32\wscript.exe
WindowStyle : 1
WorkingDirectory :
Interesting... Since I see nothing wrong in this but only this part: export DISPLAY=172.21.128.1:0 LIBGL_ALWAYS_INDIRECT=1;
Can you check your IP changed? Also /usr/share/wslu/wslusc-helper.sh
(https://github.com/wslutilities/wslu/blob/master/src/etc/wslusc-helper.sh) should already handle DISPLAY
part
I have confirmed there is a network adapter which has IP 172.21.128.1
in the Task Manager of Win10.
And I can open an Emacs window successfully while using this command DISPLAY=172.21.128.1:0 emacs
.
Interesting... I am really unable to reproduce your bug. I will try to look for some other people who can help reproduce the bug so I can see what's wrong.