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!

1 Answers1

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.

Seth
  • 58,122