November 24

I’m gshark lazy..

     Although I’m a huge KDE fan, I simply stoped using the menu launcher a while back. I’ve resorted to launching pretty much everything from the run dialogue, available as Alt+F2 keyboard shortcut on machine.

     I listen to grooveshark quite a lot, looking for new sounds or bands I haven’t heard before, but I’m quite lazy in opening a new firefox window/tab, typing in the complete url, or even simply just grooveshark and then clicking on the relevant search result.. and THEN finally typing in the artist/song I heard about and I’m looking for.. it’s just too damn long!

     So I now use a file in /bin symlinked to a script which I can change at any tie, all owned by root. I first create a bin directory in my user directory, then create a script file in it:
mkdir ~/bin
touch ~/bin/gshark

     I then add the following in the gshark script file:
firefox!/search?q=$1 &

     When done, I just change the mode, ownership, and create the symlink:
chmod 755 ~/bin/ghsark
sudo chown root:root ~/bin/gshark
sudo ln -s ~/bin/gshark /bin/gshark

     Now when I’d like to do a general search for something, I hit Alt+F2 and type something like gshark lcd+soundsystem

note: I’m performing a default search with this script, but an improvement could be to add a parameter to the script to search for specific categories using a case switch for $1 and using $2 as the search string such as gshark option search-string where option becomes:

  • -a:!/search/artist?q=$2
  • -l:!/search/album?q=$2
  • -p:!/search/playlist?q=$2
  • -u:!/search/user?q=$2

Tags: ,

Posted November 24, 2014 by wm in category scripts