Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- cd ~
- if [ -z "$(grep custom-hosts-added /etc/hosts)" ]; then
- sudo sh -c 'echo "# custom-hosts-added " >> /etc/hosts'
- # add your hosts here
- else
- echo "/etc/hosts is up to date"
- fi
- export WSLHOST=$(ip address show dev eth0 | awk -F '[ /]+' '/inet / { print $3 }')
- export WINHOST=$(grep -oP "(?<=nameserver ).+" /etc/resolv.conf)
- export DISPLAY=127.0.0.1:0.0
- WSLENV="$WSLENV:DISPLAY"
- powershell.exe -Command 'taskkill /f /im vcxsrv.exe'
- powershell.exe -Command '& "C:\Program Files\VcXsrv\vcxsrv.exe" -multiwindow -clipboard -nowgl'
- powershell.exe -Command '& "C:\Program Files\VcxSrv\xhost.exe" '+$WSLHOST
- sleep 1
- export DISPLAY=$WINHOST:0.0
- sudo service dbus start
- nohup unity-settings-daemon >/dev/null 2>&1 &
- gnome-terminal
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement