Skip to content

Instantly share code, notes, and snippets.

@mslinn
Last active August 19, 2020 19:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mslinn/0dbce05b1e0997f256eea15cc19b7181 to your computer and use it in GitHub Desktop.
Save mslinn/0dbce05b1e0997f256eea15cc19b7181 to your computer and use it in GitHub Desktop.
WSL2 XFCE4 setup
sudo apt install xfce4 xfce4-terminal xubuntu-desktop
#!/bin/bash
# Place this script in a directory on the PATH
# Launch from Windows with Windows-R then
# ubuntu.exe run restartXFCE4
export DISPLAY=`echo $(cat /etc/resolv.conf | grep 'nameserver' | awk '{print $2}')`:0
xfwm4 --replace --daemon --display=$DISPLAY &
#!/bin/bash
# Place this script in a directory on the PATH
# Launch from Windows with Windows-R then
# ubuntu.exe run startGnome
sudo /etc/init.d/dbus start &> /dev/null
export DISPLAY=`echo $(cat /etc/resolv.conf | grep 'nameserver' | awk '{print $2}')`:0
gnome-session --display=$DISPLAY &
#!/bin/bash
# Place this script in a directory on the PATH
# Launch from Windows with Windows-R then
# ubuntu.exe run startXFCE4
sudo /etc/init.d/dbus start &> /dev/null
export DISPLAY=`echo $(cat /etc/resolv.conf | grep 'nameserver' | awk '{print $2}')`:0
xfce4-panel -r --display=$DISPLAY
xfce4-session --display=$DISPLAY &
# This is the only way to ensure that xfce4-screensaver is truly inactive.
# Otherwise the screen will go unresponsive when xfce4-screensaver activates.
# Wait a minute before trying to kill it
sleep 60 && sudo pkill -9 xfce4-screensaver &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment