List Info

Thread: opening linked files




opening linked files
country flaguser name
Italy
2007-07-27 04:28:30
<posted & mailed>

I would like konqueror to start a program when selecticng a
link file,
rather that opening  file the link is pointing to.
That would allow to start a script that chances to the
directory, before
opening. 

Any ideas?

thank you 

--
Pol 

___________________________________________________
This message is from the kde-linux mailing list.
Account management:  http
s://mail.kde.org/mailman/listinfo/kde-linux.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.h
tml.

Re: opening linked files
country flaguser name
Spain
2007-07-27 11:17:05
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

En/na pol ha escrit:
> <posted & mailed>
> 
> I would like konqueror to start a program when
selecticng a link file,
> rather that opening  file the link is pointing to.
> That would allow to start a script that chances to the
directory, before
> opening. 
> 
> Any ideas?
> 
> thank you 
> 
> --
> Pol 
> 
> ___________________________________________________
> This message is from the kde-linux mailing list.
> Account management:  http
s://mail.kde.org/mailman/listinfo/kde-linux.
> Archives: http://lists.kde.org/.
> More info: http://www.kde.org/faq.h
tml.
> 
Hi!
Is that the same trouble I have with some users account and
not in
others. That programs like Evolution or Google Earth doesn't
open
browsers when a link is clicked but another program like
Bluefish?

Regards!

Ximo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


iD8DBQFGqhqB0eA1h/QDdkYRAtS/AJ91DN7nHds7Hx0odIJ5DbSfTeMTpgCg
gaUM
gsIKB2T8l87GiR+zBAl5BDI=
=VBzn
-----END PGP SIGNATURE-----
___________________________________________________
This message is from the kde-linux mailing list.
Account management:  http
s://mail.kde.org/mailman/listinfo/kde-linux.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.h
tml.

Re: opening linked files
user name
2007-07-27 11:33:22
On Friday 27 July 2007 17:17:05 Joaquim Bernà i Torres
wrote:
> gpgkeys: key D1E03587F4037646 not found on keyserver
>
> En/na pol ha escrit:
> > <posted & mailed>
> >
> > I would like konqueror to start a program when
selecticng a link file,
> > rather that opening  file the link is pointing
to.
> > That would allow to start a script that chances to
the directory, before
> > opening.
> >
> > Any ideas?
> >
>
> Hi!
> Is that the same trouble I have with some users account
and not in
> others. That programs like Evolution or Google Earth
doesn't open
> browsers when a link is clicked but another program
like Bluefish?
>
I'm not sure that these two questions are the same, but
here's the answers, as 
far as I can give them 

If you want the link to always have a particular action, for
instance open 
Konqueror, then look at kcontrol > KDE Components >
File Associations.  Put 
the appropriate extension into the search box at the top,
and you will get 
the opportunity to set the required action.  In some cases,
for instance 
multimedia files, you may need to set both the General tab
and the Embedded 
tab.

If the file is something that is needed in different
situations, for instance 
you may want to open it in Firefox or in Kate, then use the
right-click menu 
to open with the extra choice.  There is a check-box for
that to be 
remembered in the context menu for future use.

HTH

Anne
-- 
Registered Linux User No.293302 (http://counter.li.org/)

___________________________________________________
This message is from the kde-linux mailing list.
Account management:  http
s://mail.kde.org/mailman/listinfo/kde-linux.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.h
tml.
Re: opening linked files
country flaguser name
Italy
2007-07-28 01:26:32
Anne Wilson wrote:
> If you want the link to always have a particular
action, for instance open
> Konqueror, then look at kcontrol > KDE Components
> File Associations. 
> Put the appropriate extension into the search box at
the top, and you will
> get
> the opportunity to set the required action.  In some
cases, for instance
> multimedia files, you may need to set both the General
tab and the
> Embedded tab.

What i need is changing to the directory the file is
pointing to, then
opening that file with the proper file association.
Currently, file
association is ok, but links are opened in the directory
where they are.
I would like to write a script that chances to the dir the
actual file is,
then open it.   
I could associate a script to that file type, that opens the
file the usual
way, if that is a real file or changes to the right
directory before
opening, How to pass the path to the directory to the
script?

thank you

--
Pol 

___________________________________________________
This message is from the kde-linux mailing list.
Account management:  http
s://mail.kde.org/mailman/listinfo/kde-linux.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.h
tml.

Re: opening linked files
user name
2007-07-28 03:43:15
On Saturday 28 July 2007 07:26:32 pol wrote:
> Anne Wilson wrote:
> > If you want the link to always have a particular
action, for instance
> > open Konqueror, then look at kcontrol > KDE
Components > File
> > Associations. Put the appropriate extension into
the search box at the
> > top, and you will get
> > the opportunity to set the required action.  In
some cases, for instance
> > multimedia files, you may need to set both the
General tab and the
> > Embedded tab.
>
> What i need is changing to the directory the file is
pointing to, then
> opening that file with the proper file association.
Currently, file
> association is ok, but links are opened in the
directory where they are.
> I would like to write a script that chances to the dir
the actual file is,
> then open it.
> I could associate a script to that file type, that
opens the file the usual
> way, if that is a real file or changes to the right
directory before
> opening, How to pass the path to the directory to the
script?
>
I am not a programmer, so this may be utter nonsense, but
here are my 
thoughts.  The path for any file is in its properties, so it
should be 
possible to get the path and assign it to a variable, which
can then be used 
in your script to perform the required act, if examination
of the mime-type 
passes the test.  Does that sound right?

It sounds a simplistic answer to me, so probably it's not as
simple as that.

Anne



-- 
Registered Linux User No.293302 (http://counter.li.org/)

___________________________________________________
This message is from the kde-linux mailing list.
Account management:  http
s://mail.kde.org/mailman/listinfo/kde-linux.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.h
tml.
Re: opening linked files
country flaguser name
Australia
2007-07-28 04:00:48
> What i need is changing to the directory the file is
pointing to, then
> opening that file with the proper file association.
Currently, file
> association is ok, but links are opened in the
directory where they are.
> I would like to write a script that chances to the dir
the actual file is,
> then open it.
> I could associate a script to that file type, that
opens the file the usual
> way, if that is a real file or changes to the right
directory before
> opening, How to pass the path to the directory to the
script?

The "file" command could be what you want:

file $FILE | awk '/symbolic link/ {print $5}'

will return the path to the real file if $FILE is a symbolic
link otherwise it 
returns nothing. So, for a particular PROGRAM, you could
do:

REALFILE=$(file $FILE | awk '/symbolic link/ {print $5}' |
sed s/'// | sed 
s/`// ) 

[[ $REALFILE ]] && $PROGRAM "$REALFILE" ||
$PROGRAM $FILE

#(The extra sed bits in first line remove annoying backticks
and quotes from 
the output; theres probably a neater way, but you get the
idea).

This checks if a file is a link and opens the target if it
is, otherwise it 
just opens the file, using whatever program you have
assigned to PROGRAM.

If you actually need to be in the real file's directory, you
could make the 
second line:

[[ $REALFILE ]] && cd $(dirname
"$REALFILE") && $PROGRAM
"$REALFILE" || 
$PROGRAM $FILE


Regards,

John
___________________________________________________
This message is from the kde-linux mailing list.
Account management:  http
s://mail.kde.org/mailman/listinfo/kde-linux.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.h
tml.

Re: opening linked files
country flaguser name
Spain
2007-07-28 08:18:31
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

En/na Anne Wilson ha escrit:
> On Friday 27 July 2007 17:17:05 Joaquim Bernà i Torres
wrote:
>> gpgkeys: key D1E03587F4037646 not found on
keyserver
>>
>> En/na pol ha escrit:
>>> <posted & mailed>
>>>
>>> I would like konqueror to start a program when
selecticng a link file,
>>> rather that opening  file the link is pointing
to.
>>> That would allow to start a script that chances
to the directory, before
>>> opening.
>>>
>>> Any ideas?
>>>
>> Hi!
>> Is that the same trouble I have with some users
account and not in
>> others. That programs like Evolution or Google
Earth doesn't open
>> browsers when a link is clicked but another program
like Bluefish?
>>
> I'm not sure that these two questions are the same, but
here's the answers, as 
> far as I can give them 
> 
> If you want the link to always have a particular
action, for instance open 
> Konqueror, then look at kcontrol > KDE Components
> File Associations.  Put 
> the appropriate extension into the search box at the
top, and you will get 
> the opportunity to set the required action.  In some
cases, for instance 
> multimedia files, you may need to set both the General
tab and the Embedded 
> tab.
> 
> If the file is something that is needed in different
situations, for instance 
> you may want to open it in Firefox or in Kate, then use
the right-click menu 
> to open with the extra choice.  There is a check-box
for that to be 
> remembered in the context menu for future use.
> 
> HTH
> 
> Anne
> 
> 
>
------------------------------------------------------------
------------
> 
> ___________________________________________________
> This message is from the kde-linux mailing list.
> Account management:  http
s://mail.kde.org/mailman/listinfo/kde-linux.
> Archives: http://lists.kde.org/.
> More info: http://www.kde.org/faq.h
tml.

Solved as you suggested!

I didn't check the kcontrol > KDE Components > File
Associations > text
> html settings. LOL

Best regards to all and luck to pol!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


iD8DBQFGq0In0eA1h/QDdkYRAq2RAJ9IQXJS73zsti6c8QQlaK63+QqKeACd
FRsg
z1FMvJdJoXr2rtEGyG4CqEQ=
=umAQ
-----END PGP SIGNATURE-----
___________________________________________________
This message is from the kde-linux mailing list.
Account management:  http
s://mail.kde.org/mailman/listinfo/kde-linux.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.h
tml.

[1-7]

about | contact  Other archives ( Real Estate discussion Medical topics )