Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 19 Aug 2018, 09:57
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Open a File in Seamonkey Composer
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [3 Posts]  
Author Message
s243a

Joined: 02 Sep 2014
Posts: 1107

PostPosted: Mon 25 Dec 2017, 18:53    Post subject:  Open a File in Seamonkey Composer  

Create the short script

/usr/local/bin/composer
Code:

#!/bin/sh
seamonkey -edit "`readlink -f $1`"


Now say I have a file called index.html. If I'm in that folder [1], I can type

Code:

composer index.html


to open the file. Next we would like to be able to right click an item and select open with composer.

If you copy the file

Code:

/usr/share/applications/seamonkey.desktop


and rename it
Code:

/usr/share/applications/composer.desktop

and replace the part after the "=" sign where it says exec with "composer" as follows:

Code:

[Desktop Entry]
Name=Seamonkey
GenericName=Seamonkey Web Browser
X-GNOME-FullName=Seamonkey Web Browser
Exec=composer
Icon=/opt/seamonkey/chrome/icons/default/default48.png
Terminal=false
Type=Application
Categories=X-Internet-browser


then one would think that we can just drag this file into the folder [2]
Code:

~/.config/rox.sourcefordge.net/SendTo

to make this script work when we right write click the file.

However, It doesn't quite work. I seem to get the path twice:


Code:

The file /root/spot/PT/s243a/recomendations-old-hardware/item216383838%0A/root/-%0A/root/Recommendations%0A/root/For%0A/root/Old%0A/root/Hardware.html cannot be found. Please check the location and try again.


I'll try to fix this and report back.

Notes
---------------------
1. You can get a terminal to a local folder by pressing the tilda sign "~" when in that folder in the rox file manager.
2. As an alternative to navigating to the folder "~/.config/rox.sourcefordge.net/SendTo" one can right click on the file, then select "sent to" and then select customize. This will open a folder where you can put scripts that will be called when you right click on the file. Normally one would put a symbolic link to the script in this folder rather then the entire script in order to avoid duplication.
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 1107

PostPosted: Mon 25 Dec 2017, 19:34    Post subject:  

The issue was that I had spaces in my file name. You can fix this by setting the Internal Field separator to the empty string:
Code:

IFS=''


here is the full script:

Code:

#!/bin/sh
Old_IFS="$IFS"
IFS=''
seamonkey -edit "`readlink -f $1`"
IFS="$Old_IFS"


Note that it probably isn't necessary to reset the internal field separator since it is only set to the empty string for the context of this script anyway,
Back to top
View user's profile Send private message 
tallboy


Joined: 21 Sep 2010
Posts: 1009
Location: Oslo, Norway

PostPosted: Mon 25 Dec 2017, 23:46    Post subject:  

Doesn't it feel good when you can answer your own questions and correct any mistakes? Laughing
_________________
True freedom is a live Puppy on a multisession CD/DVD.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [3 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0351s ][ Queries: 12 (0.0071s) ][ GZIP on ]