Bug 134671

Summary: Klipper doesn't open link in Firefox (wrong action pre-configuration)
Product: [Applications] klipper Reporter: René Krell <rkrell>
Component: generalAssignee: Esben Mose Hansen <kde>
Status: RESOLVED FIXED    
Severity: normal CC: a.m.p.boelens, gilles.quenot, paul.f.fee, renda.krell
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description René Krell 2006-09-26 09:29:50 UTC
Version:           v0.9.7 (using KDE 3.5.4 "release 78.1" , openSUSE )
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.16.21-0.21-default

In some cases, on enabled actions Klipper does not open links in the Firefox browser due to a bad action command:

ps x |grep -q '[f]irefox' \
&& firefox -remote openURL\(%s, new-window\) || firefox %s

In most cases the 'grep -q '[f]irefox' command itself occurs in the process list and therefore is assumed a running firefox process even if Firefox doesn't actually run.
The command should be:

ps x |grep -q '[f]irefox'|grep -v grep \
&& firefox -remote openURL\(%s, new-window\) || firefox %s

which worked for me.

The same error can happen on 'Open with Mozilla'.

Of course, this is only a bad pre-configuration instead of a program bug.
Comment 1 Dawid Wróbel 2007-10-22 15:44:45 UTC
I think that there is no need for this complex action anymore. It's now just enough to just set it to "firefox %s" and the link will be opened in an existing instance of firefox or in a new one if no instance is running.
Comment 2 Dmitry Suzdalev 2008-11-26 07:57:24 UTC
*** Bug 165133 has been marked as a duplicate of this bug. ***
Comment 3 gilles Quenot 2009-01-14 03:49:43 UTC
Version: v0.9.7 (using KDE 4.1.4, debian Lenny packages )
Compiler: Target: i686 GNU/Linux
OS: Linux (i686) release 2.6.28-custom

I saw the same think, but just need quotes :

before : ( never worked )
ps x |grep -q '[f]irefox' && firefox -remote openURL(%s, new-window) || firefox %s

after ( with doubles quotes )
ps x |grep -q '[f]irefox' && firefox -remote "openURL(%s, new-window)" || firefox %s

I also replace new-window by new-tab ( optional ) :
ps x |grep -q '[f]irefox' && firefox -remote "openURL(%s, new-tab)" || firefox %s

But no need to do "grep -v" :
ps x |grep -q '[f]irefox' | grep -v firefox

because the [f] trick do already the job. ( sort of small regexp that don't match grep line )
try "ps x |grep '[f]irefox'" in your terminal (konsole ?) you will never see grep line.
Comment 4 René Krell 2009-01-14 08:26:41 UTC
Thanks. It's already preconfigured the way you decribed in the OpenSUSE packages 4.1.X, no action needed here anymore. Works for me.
Comment 5 Tommi Tervo 2009-02-14 15:17:46 UTC
*** Bug 178244 has been marked as a duplicate of this bug. ***
Comment 6 Tommi Tervo 2009-02-16 21:31:00 UTC
fixed by Riddel:
http://lists.kde.org/?l=kde-commits&m=123481000020676&w=2