Only 28 lines to start an X Session from TTY
sx is a replacement for
xinit which i’m currently using to start XFCE.
sx is a tiny fraction of the size of
xinit showing what cutting a few features and edge cases can do for making code easy to read and hack on.
Compare https://github.com/Earnestly/sx -to- https://github.com/freedesktop/xorg-xinit
# Set up the init script for sx mkdir -p ~/.config/sx/ touch ~/.config/sx/sxrc # sx requires this be executable chmod 700 ~/.config/sx/sxrc vim ~/.config/sx/sxrc # Paste what would normally be in your ~/.xinitrc file # For example, I need my dunst notifier started along with # startxfce4 so my ~/.config/sx/sxrc looks like this:
# Download script and install to /usr/local/bin/ sudo sh -c "wget -q -O - https://raw.githubusercontent.com/Earnestly/sx/master/sx > /usr/local/bin/sx" # Confirm against original cat /usr/local/bin/sx sudo chmod 755 /usr/local/bin/sx # sx is now ready! Enter a TTY and launch an X Session using: sx
Note: I boot to a TTY but If you’re using a Desktop Manager like LightDM you’ll need to configure it to use
sx. Alternatively you can switch to a TTY and start an additional X Session using
sx as it uses the TTY you’re in not TTY7.