Skip to content

Instantly share code, notes, and snippets.

@marfillaster
Last active February 1, 2023 10:07
Show Gist options
  • Star 24 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save marfillaster/85a3da3a19902236655db1232fa9d8df to your computer and use it in GitHub Desktop.
Save marfillaster/85a3da3a19902236655db1232fa9d8df to your computer and use it in GitHub Desktop.
WSL Desktop Launched i3wm

WSL Desktop Launched i3wm

Requirements VcXsrv, i3wm in wsl.

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

Install gnome-terminal for default terminal. unity-settings-daemon and light-themes are also needed for the terminal to run and look nice.

Exit i3 and VcXsrv using i3-nagbar

# cat ~/.config/i3/config
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' '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

Do you need to disable wslg?

@marfillaster
Copy link
Author

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

@eyadsibai
Copy link

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

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