DMShropshire
Posts: 15
Joined: Thu Oct 11, 2012 3:29 am

Open Terminal hotkey?

Wed Oct 17, 2012 12:35 am

I know in ubuntu there is a hotkey to open a terminal using alt+t or something like that. Im using wheezy for the pi, is there any hotkey for terminal? How would I go about making one or editing the current?

Thanks!

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Open Terminal hotkey?

Wed Oct 17, 2012 7:03 am

Ctrl-Alt-T opens a windowed terminal in Gnome/Unity in Ubuntu - it doesn't work in Wheezy on the Pi, however you can jump direct to a tty screen. It also works in Ubuntu as well.

Ctrl-Alt-F1 for tty1
Ctrl-Alt-F2 for tty2

Ctrl-Alt-F7 to return to X
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

DMShropshire
Posts: 15
Joined: Thu Oct 11, 2012 3:29 am

Re: Open Terminal hotkey?

Wed Oct 17, 2012 11:52 pm

Ahh perfect thanks! Is there any difference between terminal and tty?

JeremyF
Posts: 515
Joined: Wed Jan 25, 2012 9:06 pm
Contact: Website

Re: Open Terminal hotkey?

Thu Oct 18, 2012 12:35 am

DMShropshire wrote:Ahh perfect thanks! Is there any difference between terminal and tty?
tty is a separate instance and is a raw terminal, but generally Ctrl-Alt-T in Ubuntu opens a terminal emulator within the X server (the GUI, that is)
{sig} Setup: Original version Raspberry Pi (B, rev1, 256MB), Dell 2001FP monitor (1600x1200), 8GB Class 4 SD Card with Raspbian and XBMC, DD-WRT wireless bridge

TillM
Posts: 36
Joined: Wed Oct 17, 2012 7:54 am

Re: Open Terminal hotkey?

Tue Oct 30, 2012 12:19 pm

"sudo apt-get install xbindkeys" Then you can map any key to do what you want. There's also a graphical configuration tool for xbindkeys " sudo apt-get install xbindkeys-config"

Oh and you'll have to start this program with your session usually in .xinitrc or whatever startup file your desktop/window manager provides.

M_Carey
Posts: 5
Joined: Tue Oct 22, 2013 6:38 am

Re: Open Terminal hotkey?

Wed Oct 23, 2013 12:17 am

Oops, wrong password (sheepish grin)

aristocrates
Posts: 5
Joined: Sun Apr 14, 2013 2:31 am

Re: Open Terminal hotkey?

Fri Jul 11, 2014 4:46 am

I'm assuming you want to replicate what Ubuntu does when you press "Ctr-Alt-t", which is open a terminal in the GUI. To do this in the current version of Raspbian as of this writing, you will need to add a keyboard shortcut by editing the ~/.config/openbox/lxde-rc.xml file (note that some other guides for openbox shortcuts say you need to edit the ~/.config/openbox/rc.xml; for Raspbian it appears they renamed rc.xml to lxde-rc.xml)

To do this, open the file in a text editor of your choice. I like using nano, so from a terminal session type:

Code: Select all

nano ~/.config/openbox/lxde-rc.xml
Then, add the following lines somewhere within the <keyboard> and </keyboard> tags:

Code: Select all

<!-- Launch terminal when ctr-alt-t is pressed -->
  <keybind key="C-A-t">
    <action name="Execute"><command>lxterminal</command></action>
  </keybind>
Note that the first line (the comment) is optional but aids the organization of the file. The first actual line, <keybind key="C-A-t"> stands for the command "Control-Alt-t" (as in the letter t), and the second line says to open the GUI terminal application, in this case lxterminal.

For anyone who is confused as to where to put these lines, I personally put it in as the last shortcut before the </keyboard> tag. So it should look something like this when you're done:

Code: Select all

<!-- Launch gnome-screenshot when Print is pressed -->
  <keybind key="Print">
    <action name="Execute"><command>gnome-screenshot</command></action>
  </keybind>
<!-- Launch terminal when ctr-alt-t is pressed -->
  <keybind key="C-A-t">
    <action name="Execute"><command>lxterminal</command></action>
  </keybind>
</keyboard>
If you want to read more about shortcuts in openbox, you can look here: http://openbox.org/wiki/Help:Bindings (again, note that instead of rc.xml, you want lxde-rc.xml)

(sorry about posting to an old thread, but the proper way to do this is kind of buried in google's search results so I'm hoping it will be useful for anyone who wants to know how to set shortcuts and ends up on this forum)

User avatar
Cancelor
Posts: 776
Joined: Wed Aug 28, 2013 4:09 pm
Location: UK

Re: Open Terminal hotkey?

Fri Jul 11, 2014 5:56 am

pluggy wrote:Ctrl-Alt-T opens a windowed terminal in Gnome/Unity in Ubuntu - it doesn't work in Wheezy on the Pi, however you can jump direct to a tty screen. It also works in Ubuntu as well.

Ctrl-Alt-F1 for tty1
Ctrl-Alt-F2 for tty2

Ctrl-Alt-F7 to return to X
Wish I had read the last line before trying Ctrl-Alt-F1 :oops:
Can't find the thread you want? Try googling : YourSearchHere site:raspberrypi.org

estc.jones
Posts: 1
Joined: Mon Mar 23, 2015 9:46 pm

Re: Open Terminal hotkey?

Mon Mar 23, 2015 9:53 pm

aristocrates wrote:I'm assuming you want to replicate what Ubuntu does when you press "Ctr-Alt-t", which is open a terminal in the GUI. To do this in the current version of Raspbian as of this writing, you will need to add a keyboard shortcut by editing the ~/.config/openbox/lxde-rc.xml file (note that some other guides for openbox shortcuts say you need to edit the ~/.config/openbox/rc.xml; for Raspbian it appears they renamed rc.xml to lxde-rc.xml)

To do this, open the file in a text editor of your choice. I like using nano, so from a terminal session type:

Code: Select all

nano ~/.config/openbox/lxde-rc.xml
Then, add the following lines somewhere within the <keyboard> and </keyboard> tags:

Code: Select all

<!-- Launch terminal when ctr-alt-t is pressed -->
  <keybind key="C-A-t">
    <action name="Execute"><command>lxterminal</command></action>
  </keybind>
Note that the first line (the comment) is optional but aids the organization of the file. The first actual line, <keybind key="C-A-t"> stands for the command "Control-Alt-t" (as in the letter t), and the second line says to open the GUI terminal application, in this case lxterminal.

For anyone who is confused as to where to put these lines, I personally put it in as the last shortcut before the </keyboard> tag. So it should look something like this when you're done:

Code: Select all

<!-- Launch gnome-screenshot when Print is pressed -->
  <keybind key="Print">
    <action name="Execute"><command>gnome-screenshot</command></action>
  </keybind>
<!-- Launch terminal when ctr-alt-t is pressed -->
  <keybind key="C-A-t">
    <action name="Execute"><command>lxterminal</command></action>
  </keybind>
</keyboard>
If you want to read more about shortcuts in openbox, you can look here: http://openbox.org/wiki/Help:Bindings (again, note that instead of rc.xml, you want lxde-rc.xml)

(sorry about posting to an old thread, but the proper way to do this is kind of buried in google's search results so I'm hoping it will be useful for anyone who wants to know how to set shortcuts and ends up on this forum)
This all depends on OS you're using I tried this using raspbian (NOOBS) on my pi 2 and it didn't work. I found the problem eventually after much trawling.
Substitute the line "lxterminal" for "x-terminal-emulator" worked for me

Kyle Keane
Posts: 1
Joined: Sat Jul 25, 2015 12:17 am
Contact: Website

Re: Open Terminal hotkey?

Sat Jul 25, 2015 12:20 am

Thank you for posting this here, it worked like a charm using lxterminal on my rpi2 running raspian!

ananda9470
Posts: 8
Joined: Tue Nov 10, 2015 6:28 pm

Re: Open Terminal hotkey?

Sun Nov 22, 2015 8:30 pm

When I tried opening

Code: Select all

nano ~/.config/openbox/lxde-rc.xml
it shows an empty file in while nothing is written. Any suggestions?

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Open Terminal hotkey?

Sun Nov 22, 2015 10:44 pm

ananda9470 wrote:When I tried opening

Code: Select all

nano ~/.config/openbox/lxde-rc.xml
it shows an empty file in while nothing is written. Any suggestions?
With the changes to the user interface, the file you are looking for is now called lxde-pi-rc.xml. Try:

Code: Select all

nano ~/.config/openbox/lxde-pi-rc.xml

cmullen
Posts: 22
Joined: Mon Feb 17, 2014 7:44 am

Re: Open Terminal hotkey?

Fri Dec 11, 2015 7:42 pm

Has anyone used this method to use and/or USB mouse or Powermate to control a headless rpi2?
Once properly configured in xbindkeys using the GUI would you have to start X on reboot for headless operation of the USB mouse issuing shell commands thru xbindkeys? Easy way to get a solderless shutdown button. :)

Return to “Beginners”