3

everyone. I'm new to Ubuntu Gnome, and I just wanted to know if it's possible to create a shortcut such as CTRL+1, and have the terminal popup and run a command such as 'sudo apt-get upgrade'.

Is this possible, and if so how can it be done?

Thank you!

4
  • possible duplicate of Apply icons to bash scripts
    – Panther
    Feb 12, 2013 at 23:29
  • 1
    @bodhi.zazen This isn't a duplicate. The OP wants a keyboard shortcut to run an update.
    – Seth
    Feb 13, 2013 at 0:03
  • askubuntu.com/questions/254424/…
    – Panther
    Feb 13, 2013 at 0:15
  • @bodhi.zazen That's quite helpful, but far broader than this. What the OP wants to do here is useful in a variety of circumstances and is now answered; I see no reason not to just keep this open. Feb 13, 2013 at 0:28

1 Answer 1

1

Yes, this can be done.

Install xbindkeys:

sudo apt-get install xbindkeys  

And create the config file:

touch .xbindkeysrc 

And now edit the file:

gedit .xbindkeysrc

Add this to the file:

"gnome-terminal -e 'sudo apt-get upgrade'"
Control+1

Save the file.

Now you need to add xbindkeys to "Startup Application". That is addressed near the bottom of this answer on remapping keys.

The only problem with this solution is, if there aren't any prompts, the terminal will only stay open long enough to get your password and ask if you want to run the upgrade. I don't know of a way to keep the terminal open, but maybe someone else will.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .