Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
application setting in acroread (latex file) [SOLVED]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Efo
Guru
Guru


Joined: 23 Jun 2005
Posts: 498

PostPosted: Fri May 01, 2009 5:20 pm    Post subject: application setting in acroread (latex file) [SOLVED] Reply with quote

Hi guys,

I am working with latex and I created a link with \href to a script (file.sh), then I generated the pdf file and opened it in acroread.
The problem is that, when I use the link in acroread, firefox is invoked and then it launches the script file. Is there a way I can tell acroread to execute directly files with the extension .sh?

Thanks,

Efo


Last edited by Efo on Sat May 02, 2009 8:39 am; edited 1 time in total
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Sat May 02, 2009 12:01 am    Post subject: Reply with quote

You will need to write a script, say open_from_acroread, to parse the argument acroread sends to firefox. The argument is in the form of openURL(<some URL>.newtab). Then you will need to provide the name of the script in Edit->Preference->Internet instead of the default name firefox.
_________________
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
Back to top
View user's profile Send private message
Efo
Guru
Guru


Joined: 23 Jun 2005
Posts: 498

PostPosted: Sat May 02, 2009 6:10 am    Post subject: Reply with quote

Hi ppurka,

Thank you for the reply.
I am not sure if I understood you correctly, here is what I did:
1) I have "\href{./play.sh}" in latex
2) I set in "Edit->Preference->Internet" "/bin/sh" as my browser

When I click on the link I get "browser could not be launched. Please check..."
What am I missing?
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Sat May 02, 2009 7:09 am    Post subject: Reply with quote

You did not understand the openURL part of my earlier reply. acroread will execute /bin/sh as
Code:
/bin/sh openURL(./play.sh)
or something similar.. I don't remember exactly. Main thing to remember is that you will need another shell script to parse the argument that acroread passes to the command and extract ./play.sh out of that argument and then execute ./play.sh.

You can make a simple shell script such as
Code:
#!/bin/sh
xmessage "$@"
and provide it to acroread to find out what is the argument that acroread passes to this shell script (and by default to firefox).
_________________
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
Back to top
View user's profile Send private message
Efo
Guru
Guru


Joined: 23 Jun 2005
Posts: 498

PostPosted: Sat May 02, 2009 8:39 am    Post subject: Reply with quote

Thanks ppurka,

With your help and a little bashing I got it working.
For the record:
1) As you suggested I created video.sh:
#!/bin/bash
xmessage "$@"
2) The message was:
-remote openURL(file:/home/user/something/play.sh,new-tab)
3) I removed "-remote openURL(file:" and ",new-tab)" with
fnl=`echo $@ | cut -d : -f2 | cut -d, -f1 `
4) executed play.sh
exec $fnl

Final video.sh files:
#!/bin/bash
#xmessage "$@"
fnl=`echo $@ | cut -d : -f2 | cut -d , -f1 `
#xmessage "$fnl"
exec $fnl

In acroread (Edit->Preference->Internet) I changed firefox with video.sh.

Thanks again,

Efo
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum