Skip to content

Instantly share code, notes, and snippets.

@tarao
Last active June 6, 2024 02:40
Show Gist options
  • Save tarao/4470b44e615e2a6ce37fab2767830f39 to your computer and use it in GitHub Desktop.
Save tarao/4470b44e615e2a6ce37fab2767830f39 to your computer and use it in GitHub Desktop.
WSL launcher with custom weston.ini
var args = [];
for (var i=0; i < WScript.Arguments.length; i++) {
args.push(WScript.Arguments(i));
}
var sh = new ActiveXObject('WScript.Shell');
sh.Run(args.join(' '), 0 /* hidden */);
sh = null
[xwayland]
disable_access_control=true
[input-method]
path=
[keyboard]
repeat-delay=200
repeat-rate=20
set title=%~1
if [%title%] == [] (
set title=WSL
)
start wt.exe --title "%title%" wsl.exe --cd ~
rem Move to the directory where this .bat file is located
cd %~dp0
rem Wait for WSL to run
:Check
wsl.exe --list --running
if %ERRORLEVEL% neq 0 ( goto :Check )
rem Overwrite weston.ini
if exist weston.ini (
wsl.exe -u root --system -e cp weston.ini /home/wslg/.config/weston.ini
wsl.exe -u root --system -e pkill -HUP weston
)
@tarao
Copy link
Author

tarao commented Jun 6, 2024

  1. Put these files somewhere (e.g. %USERPROFILE%\bin)
  2. Make a shortcut to wscript.exe %USERPROFILE%\bin\nowindow.js %USERPROFILE%\bin\wsl.bat
    • Optionally you can put tab title at the end for example wscript.exe %USERPROFILE%\bin\nowindow.js %USERPROFILE%\bin\wsl.bat Ubuntu

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