Ubuntu – How to start Pantheon from the command line

command linelightdmpantheonxorg

Long story as to why I've chosen to go this route, but I've installed Ubuntu Trusty without a desktop, and then installed pantheon, pantheon-shell, pantheon-greeter and elementary-desktop packages.

The question is: how do I now start the desktop from the command line?

Many thanks.

Best Answer

The typical route to starting X from the command line (TTY) is to use .xinitrc and/or startx.

First, find out which command starts the Pantheon session. Look in /usr/share/xsessions for a .desktop file named after Pantheon, and check the Exec line in that file:

$ grep Exec -R /usr/share/xsessions/pantheon.desktop
Exec=gnome-session --session=pantheon

For a one-time run, you can do:

startx /usr/bin/gnome-session --session=pantheon

For a long-term setting, use .xinitrc. Usually, you wouldn't have an .xinitrc present. So, create one containing:

#! /bin/sh
exec /usr/bin/gnome-session --session=pantheon

Then run startx.

Check the Arch Wiki article on .xinitrc to see how to make more a full-fledged one.