29

I've launched into X using startx, but now can't shutdown my pi, as I have no mouse, and I can't seem to access anything with the keyboard alone. What can I do?

Tom Medley
  • 4,089
  • 8
  • 33
  • 46

5 Answers5

23

Try pressing Ctrl+Alt+F1.

This will switch you to a different tty. After logging in on this you can run commands as normal

Any F key under 6 will do.

Oliver Salzburg
  • 1,794
  • 1
  • 19
  • 33
Jivings
  • 22,656
  • 11
  • 94
  • 140
6

Why not stop it with sudo /etc/init.d/lightdm stop

flomar
  • 71
  • 1
  • 1
4

Pressing Ctrl+Esc brings up the 'start' menu (for want of a better word) and then you can use the arrow keys to select 'logout'.

Which is the same as Windows - if you've not got a Windows key then Ctrl+Esc does the same thing (OK, a bit off topic but thought I'd make sure everyone understood I wasn't just thinking it was Windows and that it also works on the default Pi desktop).

techraf
  • 4,353
  • 10
  • 32
  • 43
Skizz
  • 323
  • 1
  • 2
  • 10
4

Try Ctrl+Alt+Backspace.

This will kill the running X server.

Jivings
  • 22,656
  • 11
  • 94
  • 140
Alex Chamberlain
  • 15,638
  • 15
  • 69
  • 113
1

If sudo /etc/init.d/lightdm stop works, then make bash script in /bin:

$ cd /bin
$ sudo nano stopx

In the new file insert the following code:

#!/bin/bash
sudo /etc/init.d/lightdm stop

save and exit nano, i.e. Ctrl+x and then Enter

Make the file executable:

$ chmod +x stopx

Finally one may use stopx as opposite of startx!

techraf
  • 4,353
  • 10
  • 32
  • 43
drgrujic
  • 111
  • 1