Ubuntu keyboard shortcut to open terminal window and run shell script

Posted on 2012-09-12
Last Modified: 2012-09-12
I have a simple bash script that I want to run when I use a certain keyboard shortcut. Right now it seems to kind of work - I see a terminal window open momentarily but the commands don't seem to run correctly. This is the script I'm using:

killall chrome
rm ~/.config/google-chrome/Default/Cookies

Open in new window

Basically all it does it kills Chrome, gets rid of the cookies, then relaunches Chrome. I want this to run with a simply keyboard shortcut. The script itself runs fine inside of Terminal. The only problem I'm having is when trying to run it as the shortcut.
The command I'm using for the shortcut is
gnome-terminal -e "bash ~/Desktop/"

Open in new window

Question by:bhilgenkamp
    1 Comment

    Accepted Solution

    Well, it seems I have answered my own question. I used a different command:

    gnome-terminal -x /home/mvp/Desktop/

    All seems to work now.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
    The purpose of this article is to demonstrate how we can use conditional statements using Python.
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now