Skip to content

Instantly share code, notes, and snippets.

@marfillaster
Last active February 1, 2023 10:07
Show Gist options
  • Select an option

  • Save marfillaster/85a3da3a19902236655db1232fa9d8df to your computer and use it in GitHub Desktop.

Select an option

Save marfillaster/85a3da3a19902236655db1232fa9d8df to your computer and use it in GitHub Desktop.
WSL Desktop Launched i3wm

WSL Desktop Launched i3wm

A guide on how to launch i3wm from the windows desktop. The three files below must be stored in the same directory (%UserProfile%\Desktop).

i3.vbs - This is the entrypoint script. It runs i3.bat in the background.

i3.bat - Runs VcXsrv using d0.xlaunch profile then starts i3

d0.xlaunch - VcXsrv in "One window without titlebar" mode at DISPLAY=:0

Exit i3 and VcXsrv using i3-nagbar

bindsym Mod1+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes' '~/stop-vcxsrv.sh'"

# cat ~/stop-vcxsrv.sh
taskkill.exe /IM vcxsrv.exe /T
<?xml version="1.0" encoding="UTF-8"?>
<XLaunch WindowMode="Nodecoration" ClientMode="NoClient" LocalClient="False" Display="0" LocalProgram="xcalc" RemoteProgram="xterm" RemotePassword="" PrivateKey="" RemoteHost="" RemoteUser="" XDMCPHost="" XDMCPBroadcast="False" XDMCPIndirect="False" Clipboard="True" ClipboardPrimary="True" ExtraParams="" Wgl="True" DisableAC="False" XDMCPTerminate="False"/>
"C:\Program Files\VcXsrv\xlaunch.exe" -run "d0.xlaunch"
wsl DISPLAY=:0 i3
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "i3.bat" & Chr(34), 0
Set WshShell = Nothing
@eyadsibai
Copy link
Copy Markdown

Do you need to disable wslg?

@marfillaster
Copy link
Copy Markdown
Author

I believe this is no longer needed for wslg. Not sure if wslg supports fullscreen borderless app such as i3wm.

@eyadsibai
Copy link
Copy Markdown

I was trying to run it with wslg and failed ... I might not know what I am doing!
diabled wslg .. still doesn't work! it could be some changes they made with the upgrade of wsl

@KiLLeRRaT
Copy link
Copy Markdown

I set this up and it did not work for me. I figured that many of the other VBS scripts had a sleep between starting vcxsrv and i3, so I stuck a sleep in there for me and that works. I think vcxsrv needs a moment to init before you can run i3....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment