A few useful little rox-scripts
A few useful little rox-scripts
Sometimes I need full path of a file ( to use it with rxvt for example ) so I did this very simple script .
#!/bin/bash
gxmessage "$1"
Right button - Open With - Customize >>> New Script ( Paste above text to script)
----------------------------------------------------------------
Sometimes I need to open a file with a non-default application, so I did this very simple script .
#!/bin/sh
value=$(gxmessage -title "OPEN WITH .... " -entry WHICH PROGRAM ? )
$value "$1"
Right button - Open With - Customize >>> New Script ( Paste above text to script)
#!/bin/bash
gxmessage "$1"
Right button - Open With - Customize >>> New Script ( Paste above text to script)
----------------------------------------------------------------
Sometimes I need to open a file with a non-default application, so I did this very simple script .
#!/bin/sh
value=$(gxmessage -title "OPEN WITH .... " -entry WHICH PROGRAM ? )
$value "$1"
Right button - Open With - Customize >>> New Script ( Paste above text to script)
- Attachments
-
- path.gif
- (4.22 KiB) Downloaded 1534 times
Last edited by giac_fab on Fri 25 Jan 2008, 17:20, edited 1 time in total.
:oops: I know, my english is very bad :oops:
Give a man a fish and he eats for a day, teach a man to fish and he eats for a lifetime.
Give a man a fish and he eats for a day, teach a man to fish and he eats for a lifetime.
Same as above .....
I liked so much "extract here" shell-extension of WinRar.
This script will extract a tar-compatible file directly to EXTRACTED-name_of_file in the same directory you are.
#!/bin/bash
filename=$(basename $1)
directory=$(echo $1 | sed /$filename/s///g)
cd $directory
newdir=EXTRACTED-$filename
mkdir $directory$newdir
tar -xf $1 -C $directory$newdir
rox $directory$newdir
I liked so much "extract here" shell-extension of WinRar.
This script will extract a tar-compatible file directly to EXTRACTED-name_of_file in the same directory you are.
#!/bin/bash
filename=$(basename $1)
directory=$(echo $1 | sed /$filename/s///g)
cd $directory
newdir=EXTRACTED-$filename
mkdir $directory$newdir
tar -xf $1 -C $directory$newdir
rox $directory$newdir
:oops: I know, my english is very bad :oops:
Give a man a fish and he eats for a day, teach a man to fish and he eats for a lifetime.
Give a man a fish and he eats for a day, teach a man to fish and he eats for a lifetime.
- Dingo
- Posts: 1437
- Joined: Tue 11 Dec 2007, 17:48
- Location: somewhere at the end of rainbow...
- Contact:
Good Job! but... if I must extract not a tar but a zip file? How change the command line in script?
Last edited by Dingo on Tue 11 Mar 2008, 15:11, edited 1 time in total.
replace .co.cc with .info to get access to stuff I posted in forum
dropbox 2GB free
OpenOffice for Puppy Linux
dropbox 2GB free
OpenOffice for Puppy Linux
Excellent
lots of this sort of glue could make puppy much more friendly
with filetype specific handlers it makes sense to put them in mime-type based directories so that they only get shown when appropriate eg
for the tgz extractor put the script into
~/.config/rox.sourceforge.net/OpenWith/.application_x-compressed-tar/
I wonder how hard it would be to configure/recompile rox so that these specific handlers were shown directly on the context menu rather than being hidden in the open-with menu.
I appreciate some people will now post issues with the massively long context menus that one can acquire in windows
edit
when naming these handler scripts
if you are giving the system to newbies it makes sense to name the scripts with their function not the application name ie
"image-viewer" requires less knowledge than "qiv"
lots of this sort of glue could make puppy much more friendly
with filetype specific handlers it makes sense to put them in mime-type based directories so that they only get shown when appropriate eg
for the tgz extractor put the script into
~/.config/rox.sourceforge.net/OpenWith/.application_x-compressed-tar/
I wonder how hard it would be to configure/recompile rox so that these specific handlers were shown directly on the context menu rather than being hidden in the open-with menu.
I appreciate some people will now post issues with the massively long context menus that one can acquire in windows
edit
when naming these handler scripts
if you are giving the system to newbies it makes sense to name the scripts with their function not the application name ie
"image-viewer" requires less knowledge than "qiv"
Thanks ....
Dingo ...
To unzip you need to sobstitute
tar -xf $1 -C $directory$newdir
with
unzip $1 -d $directory$newdir
.... I'll modify script so it will do it itself
Dingo ...
To unzip you need to sobstitute
tar -xf $1 -C $directory$newdir
with
unzip $1 -d $directory$newdir
.... I'll modify script so it will do it itself
:oops: I know, my english is very bad :oops:
Give a man a fish and he eats for a day, teach a man to fish and he eats for a lifetime.
Give a man a fish and he eats for a day, teach a man to fish and he eats for a lifetime.
- Dingo
- Posts: 1437
- Joined: Tue 11 Dec 2007, 17:48
- Location: somewhere at the end of rainbow...
- Contact:
thnaks, I have made a little summary page on dokupuppy:
- http://puppylover.netsons.org/dokupuppy ... ox_scripts
with all your scripts. I hope will be useful
- http://puppylover.netsons.org/dokupuppy ... ox_scripts
with all your scripts. I hope will be useful
Last edited by Dingo on Sun 22 Jun 2008, 16:44, edited 3 times in total.
replace .co.cc with .info to get access to stuff I posted in forum
dropbox 2GB free
OpenOffice for Puppy Linux
dropbox 2GB free
OpenOffice for Puppy Linux
Another ...
Simply create a zip file directly from a directory .... You will see a question about full or relative path .
if your directory is /root/my-documents/xxx
FULL = into zip you will seen cmplete path ( good for backup )
RELATIVE = into zip you will see only xxx ( and sub-directory )
#!/bin/bash
filename=$(basename $1)
directory=$(echo $1 | sed /$filename/s///g)
cd $directory
value=$(gxmessage Path ? -buttons Relative,Full -print)
if [ $value = Relative ]; then
zip -r $filename $filename
fi
if [ $value = Full ]; then
zip -r $filename $1
fi
Simply create a zip file directly from a directory .... You will see a question about full or relative path .
if your directory is /root/my-documents/xxx
FULL = into zip you will seen cmplete path ( good for backup )
RELATIVE = into zip you will see only xxx ( and sub-directory )
#!/bin/bash
filename=$(basename $1)
directory=$(echo $1 | sed /$filename/s///g)
cd $directory
value=$(gxmessage Path ? -buttons Relative,Full -print)
if [ $value = Relative ]; then
zip -r $filename $filename
fi
if [ $value = Full ]; then
zip -r $filename $1
fi
:oops: I know, my english is very bad :oops:
Give a man a fish and he eats for a day, teach a man to fish and he eats for a lifetime.
Give a man a fish and he eats for a day, teach a man to fish and he eats for a lifetime.
#!/bin/bash
rxvt -bg "yellow" -geometry 60x20 -title $1 -e $1 #increase geometry or change colour
sleep 5 # or more if you need ( rxvt will close after 5 sec)
with this you will execute script directly in rxvt
rxvt -bg "yellow" -geometry 60x20 -title $1 -e $1 #increase geometry or change colour
sleep 5 # or more if you need ( rxvt will close after 5 sec)
with this you will execute script directly in rxvt
Last edited by giac_fab on Fri 07 Mar 2008, 17:57, edited 1 time in total.
:oops: I know, my english is very bad :oops:
Give a man a fish and he eats for a day, teach a man to fish and he eats for a lifetime.
Give a man a fish and he eats for a day, teach a man to fish and he eats for a lifetime.
Re: A few useful little rox-scripts
Not entirely correct. To wit:giac_fab wrote:Give a man a fish and he eats for a day, teach a man to fish and he eats for a lifetime.
Give a man a fish and he eats for a day - teach a man to fish and he'll sit in a boat and drink beer all day.
[size=84][i]hangout:[/i] ##b0rked on irc.freenode.net
[i]diversion:[/i] [url]http://alienjeff.net[/url] - visit The Fringe
[i]quote:[/i] "The foundation of authority is based upon the consent of the people." - Thomas Hooker[/size]
[i]diversion:[/i] [url]http://alienjeff.net[/url] - visit The Fringe
[i]quote:[/i] "The foundation of authority is based upon the consent of the people." - Thomas Hooker[/size]
Obiviously an error ..... I taken it from another my script.HairyWill wrote:why
-title DVgrab
how about
-title $1
I suggest also a "sleep X" to see results.
alienjeff : LOL
:oops: I know, my english is very bad :oops:
Give a man a fish and he eats for a day, teach a man to fish and he eats for a lifetime.
Give a man a fish and he eats for a day, teach a man to fish and he eats for a lifetime.
Re: A few useful little rox-scripts
I succesfully made your script, and it's very useful. but when I select 'Customize' in roxfiler, it opens a directory whose name suggests a single type of extension(rpm, for example). so will it affect that type of extension, only?giac_fab wrote:Sometimes I need full path of a file ( to use it with rxvt for example ) so I did this very simple script .
#!/bin/bash
gxmessage "$1"
Right button - Open With - Customize >>> New Script ( Paste above text to script)
And another beginner's question : how do I paste the copied path (or whatever) in a rxvt window?
MHHH you need to read better my first post ....
The first one customise you find ,of course, will affect only the current selected extension.
You need to go to "OPEN WITH" voice ( about on the middle of menu ), into this you will see another "customise" (the one you need).
To paste to rxvt : SHIFT + INS
The first one customise you find ,of course, will affect only the current selected extension.
You need to go to "OPEN WITH" voice ( about on the middle of menu ), into this you will see another "customise" (the one you need).
To paste to rxvt : SHIFT + INS
:oops: I know, my english is very bad :oops:
Give a man a fish and he eats for a day, teach a man to fish and he eats for a lifetime.
Give a man a fish and he eats for a day, teach a man to fish and he eats for a lifetime.
How about, in the unzip script, auto detecting if it's full or relative? It should be as easy as:
(Having to use my Dad's windows laptop, so i can't test it myself.)
Also, can I suggest that you put double quotes around the variables, to prevent it getting confused if there are spaces in the filename?
Code: Select all
#!/bin/bash
filename=$(basename $1)
directory=$(echo $1 | sed /$filename/s///g)
cd $directory
value=$(gxmessage Path ? -buttons Relative,Full -print)
if echo $1 | egrep "^/.+" ; then #egrep returns success (true) if the first character is a forward slash
zip -r $filename $filename
else
zip -r $filename $1
fi
Also, can I suggest that you put double quotes around the variables, to prevent it getting confused if there are spaces in the filename?