Link to home
Start Free TrialLog in
Avatar of bhilgenkamp
bhilgenkampFlag for United States of America

asked on

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

ASKER CERTIFIED SOLUTION
Avatar of bhilgenkamp
bhilgenkamp
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial