LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-28-2011, 06:07 AM   #1
aromaman
LQ Newbie
 
Registered: Dec 2007
Location: Scotland
Distribution: Ubuntu
Posts: 21

Rep: Reputation: 0
'One click' application launcher for get-iplayer


I've just downloaded and installed get_iplayer in my Ubuntu 10.04 system. I've also downloaded the Phil Lewis PVR gui from Linux Centre into /home/don/Desktop/get_iplayer-2.80 and it seems to work fine. To launch it I need to issue the terminal commands

cd /home/don/Desktop/get_iplayer-2.80
perl get_iplayer.cgi –port=1935

Then launch Firefox and point to http://127.0.0.1:1935/

Is there any way that these steps can be put into a 'one click' launcher on the desktop?

Don
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 11-28-2011, 06:43 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Hello,

Create a script with the appropriate commands, chmod +x the script, then you can create an icon shortcut on either your desktop or toolbar of your choice.

Cheers,

Josh
 
Old 11-28-2011, 07:03 AM   #3
klearview
Member
 
Registered: Aug 2006
Location: London
Distribution: Debian, Kubuntu
Posts: 572

Rep: Reputation: 75
Here is how I did it:

Create a text file and name it whatever you like.
Enter this, adjusting the path to your get_iplayer folder:

Quote:
#!/bin/bash
ps -C get_iplayer.cgi >& /dev/null
if [[ $? -ne 0 ]]; then
/home/my_username/Desktop/get_iplayer-2.77/get_iplayer.cgi -p 1935 --getiplayer /home/my_username/Desktop/get_iplayer-2.77/get_iplayer &
firefox -new-window http://localhost:1935 &
else
firefox -new-window http://localhost:1935 &
fi
Next
Do not forget to make the file executable!
Click on it.

What the script does:
first it checks if you already have a get_iplayer running.
if you don't, it starts it and firefox with get_iplayer tab in a new window.
if you do - only starts firefox with get_iplayer tab in a new window.
 
1 members found this post helpful.
Old 11-28-2011, 07:14 AM   #4
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Code:
#!/bin/bash
ps -C get_iplayer.cgi >& /dev/null
if [[ $? -ne 0 ]]; then
/home/my_username/Desktop/get_iplayer-2.77/get_iplayer.cgi -p 1935 --getiplayer /home/my_username/Desktop/get_iplayer-2.77/get_iplayer &
fi
firefox -new-window http://localhost:1935 &
Technically, that's how you should do it, since all you are testing is if get_iplayer.cgi is running. You only need one command to run firefox. Just optimizing for you, that's all
 
2 members found this post helpful.
Old 11-29-2011, 05:15 AM   #5
aromaman
LQ Newbie
 
Registered: Dec 2007
Location: Scotland
Distribution: Ubuntu
Posts: 21

Original Poster
Rep: Reputation: 0
Thanks to all. The suggested script worked after I removed the bit:-

--getiplayer /home/don/Desktop/get_iplayer-2.80/get_iplayer

With that bit included, firefox gave message 'could not contact localhost:1935'. I looked in my /get_iplayer-2.80 folder and could not see the item get_iplayer therein (actually I found it in /usr/bin), so I tried without it and it worked. I'm guessing that, since I installed get_iplayer separately from the PVR program, the get_iplayer.cgi script is taking care of the launch of get_iplayer somehow. I'd appreciate a confirmation of that from a scripting expert .

Also, I changed 'new-window' to 'new-tab' and that seems to work too, whether or not firefox is already running.

Many thanks again.
 
Old 11-29-2011, 05:46 AM   #6
klearview
Member
 
Registered: Aug 2006
Location: London
Distribution: Debian, Kubuntu
Posts: 572

Rep: Reputation: 75
Yes, in my case I need to include '--getiplayer ...' because get_iplayer is not in my path and I need to specify it (it's on my desktop in the same folder as .cgi). If you have it in /usr/bin, it's in your path and get_iplayer.cgi is able to call it.

Using '-new-tab' is fine - that's just a matter of preference
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a launcher for an application Darkestfilth Ubuntu 10 04-15-2010 01:42 AM
Application launcher MTK358 Linux - Software 4 01-21-2010 01:45 PM
[SOLVED] how to move the KDE application launcher james2b Fedora 2 08-30-2009 03:11 AM
Application launcher box General Linux - Desktop 0 03-23-2007 03:07 AM
Application Launcher jamoraqui Linux - Newbie 9 08-23-2004 06:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration