LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 06-10-2008, 02:23 PM   #1
Mr. Swillis
Member
 
Registered: Sep 2005
Distribution: Arch
Posts: 94

Rep: Reputation: 16
Create Desktop Links to Web URLs in DFM


Yes, that's right... DFM...

None of the newer guys/girls will probably even know what DFM is since it hasn't been updated since 2001, but I figured I'd throw this question out there and hope for the best.

I work for a software company that develops Retail POS software (among other Retail apps) and our legacy POS system runs on systems as old as RH 6 and as new as RHEL 4. Despite the version of Red Hat, we have stuck with an IceWM/DFM desktop over the years (don't ask me why).

My issue is that I have a request to create shortcuts on the desktops of some systems that will point to web URLs. I know you can do this on all the modern desktops like Gnome and KDE, but I couldn't find a way to do this with DFM. It's quite possibly a feature that doesn't exist, but I figured I'd check.

If anyone knows a way to create these in DFM or possibly even how to create a web link with "ln" (or some other command line tool) it would be greatly appreciated. This is for a massive number of production systems, so changing the Desktop or File Manager is not an option.

Thanks!

Swill
 
Old 06-10-2008, 04:19 PM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,040

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Quote:
Originally Posted by Mr. Swillis View Post
Yes, that's right... DFM...

None of the newer guys/girls will probably even know what DFM is since it hasn't been updated since 2001, but I figured I'd throw this question out there and hope for the best.
I perfectly remember about it

Quote:
My issue is that I have a request to create shortcuts on the desktops of some systems that will point to web URLs. I know you can do this on all the modern desktops like Gnome and KDE, but I couldn't find a way to do this with DFM. It's quite possibly a feature that doesn't exist, but I figured I'd check.
It's hard to remember the limits and capabilities of dfm after so many years. But, in the worst case, you should always be able to use bash scripts or something like that. A simple script would be this:

Code:
#!/bin/bash
$BROWSER http://www.google.com
Save it, chmod u+x it and then put it into your desktop just like any other executable file. If this is not enough for you, then you must elaborate a bit more on what do you want to do. You would need at least, some kind of file to hold the url like the lnk ur url files that some other desktops use, and you would also need to use a mime type association to associate a given program (the browser) to this kind of file. I can't remember what mime capabilities did dfm have. But even the simplest association mechanism should suffice, maybe needing a bit of bash scripting. I will try to remind a bit about my dfm times and will let you know if I find a simple way to do this.

There's probably not a justification to change the file manager just for this.
 
Old 06-10-2008, 06:14 PM   #3
Mr. Swillis
Member
 
Registered: Sep 2005
Distribution: Arch
Posts: 94

Original Poster
Rep: Reputation: 16
Hmm, that bash method might just do the trick. I'm not yet sure how pretty it needs to really be, but we'll be hitting a mix of Galleon, Netscape, and Firefox browsers due to the varying default browsers in Red Hat over the years. I'll see how the script approach works and post back.

Thanks!

Swill
 
Old 06-10-2008, 07:03 PM   #4
Mr. Swillis
Member
 
Registered: Sep 2005
Distribution: Arch
Posts: 94

Original Poster
Rep: Reputation: 16
Well, that worked just fine with Firefox. I still need to test with galleon and netscape, but my guess is that it will work just fine. Now I feel kinda dumb for not thinking to pass the URL as a command line argument

Thanks again!

Swill
 
Old 06-10-2008, 11:43 PM   #5
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,040

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Quote:
Originally Posted by Mr. Swillis View Post
Well, that worked just fine with Firefox. I still need to test with galleon and netscape, but my guess is that it will work just fine. Now I feel kinda dumb for not thinking to pass the URL as a command line argument

Thanks again!

Swill
Glad that it worked for you.

The $BROWSER variable is usually set by your distro, if not, the users can always do it themselves in .bashrc or .bash_profile

You can as well just hardcode the browser, that that's less flexible.

The best solution would be to add some checks into the script to:

Code:
if the $BROWSER string is not empty
  if $BROWSER is executable
    run it
else
  if firefox is executable run it
else
  if konqueror executable run it
else
  xmessage "no working browser was found"
This is easy to code in bash, a -x test checks if a file is executable. If successful, that directly implies it's somewhere on the user $PATH and it's readable and executable by that user.

To check for non empty variables use -n, to check for zero length use -z. The rest is just if...else...fi. This way, you ensure that the script is going to behave under extreme circumstances.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
FC6 - Creating web links on Desktop trevor4706 Fedora 2 11-10-2006 09:54 PM
Restricting URLs on desktop - squid? pete_bogg Slackware 6 06-20-2006 08:47 AM
how to check urls and stop internet urls in network gface Linux - Networking 5 03-24-2005 09:48 PM
how do I create links to folders? liontamer13 Linux - Newbie 2 12-18-2004 03:05 AM
Magic script to create rc.d links Rachel Carter Linux - Distributions 2 02-02-2003 02:47 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration