Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1209
  • Last Modified:

Ubuntu keyboard shortcut to open terminal window and run shell script

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:

#!/bin/bash
killall chrome
rm ~/.config/google-chrome/Default/Cookies
google-chrome

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/test.sh"

Open in new window

0
bhilgenkamp
Asked:
bhilgenkamp
1 Solution
 
bhilgenkampAuthor Commented:
Well, it seems I have answered my own question. I used a different command:

gnome-terminal -x /home/mvp/Desktop/test.sh

All seems to work now.
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now