Making a desktop launcher for "cd" + bash script

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
User avatar
Ranthe
Level 2
Level 2
Posts: 94
Joined: Fri Sep 05, 2014 9:01 pm
Location: Paraparaumu, New Zealand

Making a desktop launcher for "cd" + bash script

Post by Ranthe » Mon Dec 17, 2018 3:28 am

Occasionally I do art streaming on Picarto, and I have a nifty little CLI utility "grab-song" which allows me to pass details of the currently playing song (from Rhythmbox or Clementine) into a text file that I can then display in my stream. The commands I use to run grab-song are:

Code: Select all

cd grab-song-master/
bash grab-song.sh rhythmbox
I'm wanting to combine these two commands into something that I can start from a desktop launcher, but I can't seem to figure out how to start a bash script from somewhere other than from inside the directory it is located. I've tried prefixing the directory path as follows but I can't get it to work.

Code: Select all

bash grab-song-master/grab-song.sh rhythmbox
bash /<user>/home/grab-song-master/grab-song.sh rhythmbox
Any ideas what I am missing?

User avatar
xenopeek
Level 24
Level 24
Posts: 24134
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Making a desktop launcher for "cd" + bash script

Post by xenopeek » Mon Dec 17, 2018 4:26 am

Ranthe wrote:
Mon Dec 17, 2018 3:28 am

Code: Select all

bash /<user>/home/grab-song-master/grab-song.sh rhythmbox
That one is the wrong way around. It should be:
bash /home/<user>/grab-song-master/grab-song.sh rhythmbox
Image

Post Reply

Return to “Newbie Questions”