Forum
« Thunar - custom actions »

Welcome Guest. Please Login or Register.
May 22, 2013, 1:50pm



Return to or visit the SalineOS webpage

Forum :: General :: Software and Applications :: Thunar - custom actions
« Page 2 of 5 » Jump to page   Go    [Search This Thread] [Share Topic] [Print]
 AuthorTopic: Thunar - custom actions (Read 3,964 times)
tawie
New Member
*
member is offline





Joined: May 2011
Gender: Male
Posts: 1
 Re: Thunar - custom actions
« Reply #15 on May 20, 2011, 4:32am »

very useful, thanks.
Link to Post - Back to Top  IP: Logged
mihail
Full Member
***
member is offline





Joined: Dec 2011
Gender: Male
Posts: 120
Location: Romania
 Re: Thunar - custom actions
« Reply #16 on Dec 29, 2011, 11:31am »

hey this is very neat...

Anthony, at least the script with zenity check sum should be provided as default in thunar next Saline realease...
Link to Post - Back to Top  IP: Logged

Anthony Nordquist
Administrator
*****
member is offline




[homepage]

Joined: Dec 2010
Gender: Male
Posts: 1,336
 Re: Thunar - custom actions
« Reply #17 on Dec 29, 2011, 10:09pm »

It is likely more than just the checksum script will be included by default. In fact you can get your hands on my current setup right now. Just run the following command as your regular user, but keep in mind this will overwrite your old file.

cd $HOME && wget http://www.salineos.com/Scripts/uca.xml && mv -f ./uca.xml ./.config/Thunar

You will also need to install the package unoconv to use some of them.

This file includes:
Open a terminal
Open a terminal as root
Edit a text file as root
Open a Thunar instance as root
Disk usage utility
Checksum script, with a somewhat placebo progress bar
Export to PDF, this will open a LibreOffice instance if one isn't running (I can't change this)
Convert to ODT, works on .doc and .docx files, will also open a LibreOffice instance
Finally, we have a Search for files or folders using Catfish.

All scripts have an Icon associated with them, makes it much cleaner looking :)

If anyone else knows a custom script they think should be added, please let me know. If you only have any ideas of something you would like Thunar to do, please post it and I will see if I can't script it.
Link to Post - Back to Top  IP: Logged
Richard
Elder Member
*****
member is offline

[avatar]



Joined: Jan 2011
Gender: Male
Posts: 586
Location: Venezuela
 Re: Thunar - custom actions
« Reply #18 on Dec 29, 2011, 10:28pm »

Works great. I installed it in siduction without remembering that I was in the playground. :)
I reordered the list a bit, but I imagine everybody has their own idea.
The gnu root icon doesn't show in Xfce4.8. Inserts fine but never shows.

And it's just as great in SalineOS-1.5. And the the root icon works.
I added a pdf and thunar hammer icon. I like the old Synaptic icon as well. :)
« Last Edit: Dec 29, 2011, 10:41pm by Richard »Link to Post - Back to Top  IP: Logged

SalineOS-1.7, Xfce4.6.2, w/ 3.2.0-0.bpo.4-686-pae;
SalineOS-2.0, Xfce4.8, w/ 3.2.0-4-686-pae
Fedora-18, Xfce4.10, w/ 3.8.x
mihail
Full Member
***
member is offline





Joined: Dec 2011
Gender: Male
Posts: 120
Location: Romania
 Re: Thunar - custom actions
« Reply #19 on Dec 30, 2011, 3:46am »

@Anthony:

It is not only cool but it makes it easy for all of us to get the job done! Its brilliant.

Yes, I do have some sugestions. I do work with multimedia and it will be awsome if you could:

- rotate image and save the position, from Thunar. Nautilus has something like this, but you have to open a window select rotation style, and make many clicks and I saw it looses from quality. In winjunk7 you can rotate them with ease, 90 degrees, both ways. Can you do that? Maybe with image magick. It will help those who download images from camera and preview them in thumbnail mode before printing.

- resize movie from vob, mpg, avi, etc, to 3gp (best quality) or maybe not 3gp but something small, like flv, but with good quality.

- also there was a script to convert from dao to iso or from I dont know what fromat to dao... I used it twice but it was a long time ago, does anyone remeber it?

Thanks!
« Last Edit: Dec 30, 2011, 3:49am by mihail »Link to Post - Back to Top  IP: Logged

Anthony Nordquist
Administrator
*****
member is offline




[homepage]

Joined: Dec 2010
Gender: Male
Posts: 1,336
 Re: Thunar - custom actions
« Reply #20 on Dec 30, 2011, 3:47am »

After making my post it hit me that I should add a couple things to help deal with .iso and .img files. I also took the liberty to reorder the list since it really didn't make much sense the way it was. To install the latest, paste this command into your terminal, keep in mind it will overwrite the old custom scripts file.

cd $HOME && wget http://www.salineos.com/Scripts/uca.xml && mv -f ./uca.xml ./.config/Thunar && wget http://www.salineos.com/Scripts/image-to-usb && gksu 'mv -f ./image-to-usb /usr/bin' && gksu 'chmod +x /usr/bin/image-to-usb' && gksu aptitude install unoconv

I added a custom action to mount an ISO file to /mnt/Filename and then open Thunar there. Then I rewrote the Remastersys USB copy tool into a Thunar custom action. After pasting that giant line into your terminal you can copy the contents of an ISO to a USB drive just by right clicking on the ISO file and selecting "Burn" Image To USB Drive.
« Last Edit: Dec 30, 2011, 3:54am by Anthony Nordquist »Link to Post - Back to Top  IP: Logged
mihail
Full Member
***
member is offline





Joined: Dec 2011
Gender: Male
Posts: 120
Location: Romania
 Re: Thunar - custom actions
« Reply #21 on Dec 30, 2011, 3:57am »

even better!

how about the above, think you can do it? :)
Link to Post - Back to Top  IP: Logged

Anthony Nordquist
Administrator
*****
member is offline




[homepage]

Joined: Dec 2010
Gender: Male
Posts: 1,336
 Re: Thunar - custom actions
« Reply #22 on Dec 30, 2011, 4:45am »


Dec 30, 2011, 3:46am, mihail wrote:
@Anthony:

It is not only cool but it makes it easy for all of us to get the job done! Its brilliant.

Yes, I do have some sugestions. I do work with multimedia and it will be awsome if you could:

- rotate image and save the position, from Thunar. Nautilus has something like this, but you have to open a window select rotation style, and make many clicks and I saw it looses from quality. In winjunk7 you can rotate them with ease, 90 degrees, both ways. Can you do that? Maybe with image magick. It will help those who download images from camera and preview them in thumbnail mode before printing.

- resize movie from vob, mpg, avi, etc, to 3gp (best quality) or maybe not 3gp but something small, like flv, but with good quality.

- also there was a script to convert from dao to iso or from I dont know what fromat to dao... I used it twice but it was a long time ago, does anyone remeber it?

Thanks!


As far as rotating images this is possible to do with jpg files, pasted from the Xfce wiki:

Losslessly Rotating JPEGs
Name: Rotate Clockwise
Command: for file in %F; do tempfile=$(mktemp); (jpegtran -copy all -rotate 90 $file > $tempfile); mv -f $tempfile $file; rm -f $tempfile; done
File pattern: *.jpg;*.JPG;*.jpeg;*.JPEG
Appears if selection contains: JPEG Image Files
Note: jpegtran is available as part of the libjpeg or libjpeg-progs packages of most distributions. Unlike using “convert”, the complicated loop structure is necessary with “jpegtran”: “jpegtran -rotate 90 -outfile %F %F” will produce a 0kb file.

The package you need to install to use this is libjpeg-progs .

You can do a lot of things with videos pretty easily, but keep in mind you will NEVER get higher quality than the file you started with. These are some useful custom actions that I could come up with pretty quickly. You will need the ffmpeg package to use these custom actions.

Name: Convert to AVI
Description: Converts a video file to AVI
Command: xfce4-terminal -x ffmpeg -i %f -b 798k -ab 128k %f.avi
Pattern: All Video Files


Convert a video for playback on mobile devices:
Name: Convert For Mobile Device
Description: Converts a video for playback on a mobile device
Command: ffmpeg -i %f input -acodec aac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s 320x180 -title X output.mp4
Pattern: All Video Files

Extract the audio of a video file and save it as an mp3.

Name: Extract Audio To MP3
Description: Makes an MP3 of the videos audio
Command: ffmpeg -i %f -vn -ar 44100 -ac 2 -ab 192 -f mp3 output.mp3
Pattern: All Video Files

Convert AVI to mpg
Name: Convert To MPG
Description: Converts an AVI to MPG
Command: ffmpeg -i %f output.mpg
Pattern: Other, *.avi

Convert AVI to flv, high quality as requested... This is set to 720 HD, but you can change it to any resolution you want.

Name: Convert AVI to FLV
Description: Converts an AVI to FLV
Command:ffmpeg -i %f -ab 128 -ar 44100 -b 200 -r 24 -s 1280x720 -f flv output.flv
Pattern: Other, *.avi

You could also create your own doing anything ffmpeg can do. I suggest reading the man page, man ffmpeg. These actions will never be included by default since the ffmpeg package cannot be included on the SalineOS images.

Please note I have not tested any of these actions, so if you have problems let me know and I will look into them.

I will look into the dao file format some other time, I need to sleep now.
Link to Post - Back to Top  IP: Logged
petrek
Senior Member
****
member is offline

[avatar]



Joined: Aug 2011
Gender: Male
Posts: 386
Location: Poland
 Re: Thunar - custom actions
« Reply #23 on Dec 30, 2011, 6:48am »

It would be nice to have history. Is it possible?
Link to Post - Back to Top  IP: Logged

Skallagrigg
mihail
Full Member
***
member is offline





Joined: Dec 2011
Gender: Male
Posts: 120
Location: Romania
 Re: Thunar - custom actions
« Reply #24 on Dec 30, 2011, 7:42am »

@Anthony , very usefull info. So, those commands are for Thunar right? It would be cool if you could add them to the previous cfg file so it will be all in one place.

Also, what do you make out of this script, can you hack it and adapt it to thunar?

http://linux.softpedia.com/progScreensho....shot-23546.html

http://kde-apps.org/content/show.php?content=53457

Thanks!

PS! As for cd/dvd image to iso, the formats I was talking about are dmg and nrg. You have something here http://www.howtodothings.com/computers-i....n-ubuntu-linu x and here http://w-shadow.com/blog/2008/07/19/convert-anything-to-iso/ .
« Last Edit: Dec 30, 2011, 7:44am by mihail »Link to Post - Back to Top  IP: Logged

Richard
Elder Member
*****
member is offline

[avatar]



Joined: Jan 2011
Gender: Male
Posts: 586
Location: Venezuela
 Re: Thunar - custom actions
« Reply #25 on Dec 30, 2011, 8:32am »

@Anthony,
Could you make the dependencies variable? I already have libreoffice-3.4.4 and openjdk-6 which replaces the sun-java-6 perfectly. LibreOffice also has unoconv and ure (I think. Can't check 'cause the giant line is still running. :) [ure only it seems]
It's just a thought for the future.

These are really useful additions.
« Last Edit: Dec 30, 2011, 10:46am by Richard »Link to Post - Back to Top  IP: Logged

SalineOS-1.7, Xfce4.6.2, w/ 3.2.0-0.bpo.4-686-pae;
SalineOS-2.0, Xfce4.8, w/ 3.2.0-4-686-pae
Fedora-18, Xfce4.10, w/ 3.8.x
Richard
Elder Member
*****
member is offline

[avatar]



Joined: Jan 2011
Gender: Male
Posts: 586
Location: Venezuela
 Re: Thunar - custom actions
« Reply #26 on Dec 30, 2011, 10:48am »

@Anthony,
The mount iso is really neat.
Never can remember how to mount the thing
--that's why I use Krusader. :)

Anyway the question is:
How to unmount it from Thunar? without opening a terminal?
« Last Edit: Dec 30, 2011, 10:52am by Richard »Link to Post - Back to Top  IP: Logged

SalineOS-1.7, Xfce4.6.2, w/ 3.2.0-0.bpo.4-686-pae;
SalineOS-2.0, Xfce4.8, w/ 3.2.0-4-686-pae
Fedora-18, Xfce4.10, w/ 3.8.x
Anthony Nordquist
Administrator
*****
member is offline




[homepage]

Joined: Dec 2010
Gender: Male
Posts: 1,336
 Re: Thunar - custom actions
« Reply #27 on Dec 30, 2011, 6:02pm »

Unoconv in Squeeze recommends OpenOffice packages, these can be ignored though since you have the LibreOffice equivalent. Aptitude will complain about things, but the first solution you are offered in SalineOS is the correct one. And, this is how I tested the custom actions.

As for unmounting the ISO, a custom action could be made to accomplish this very easily. The command would be gksu 'umount /mnt/%n' and then appearance condition check the other box and *.iso. Problem with this is it will appear on every ISO whether or not its mounted, but now that I think about it that really doesn't matter cause if it isn't mounted it is just a placebo button and shouldn't cause many problems. You could also make a script to unmount all the mounted ISO files if you have a lot of them and add a custom action/launcher for the script. You can copy and paste this to the text file (Will require root to run):

#!/bin/bash
for i in $(ls /mnt); do
umount "/mnt/$i"
done
exit

I will test out a umount custom action and add one and upload it to the webserver, if no problems are found.
« Last Edit: Dec 30, 2011, 9:27pm by Anthony Nordquist »Link to Post - Back to Top  IP: Logged
Richard
Elder Member
*****
member is offline

[avatar]



Joined: Jan 2011
Gender: Male
Posts: 586
Location: Venezuela
 Re: Thunar - custom actions
« Reply #28 on Dec 30, 2011, 6:22pm »

Thanks. I'll give the others a try out.
Link to Post - Back to Top  IP: Logged

SalineOS-1.7, Xfce4.6.2, w/ 3.2.0-0.bpo.4-686-pae;
SalineOS-2.0, Xfce4.8, w/ 3.2.0-4-686-pae
Fedora-18, Xfce4.10, w/ 3.8.x
Anthony Nordquist
Administrator
*****
member is offline




[homepage]

Joined: Dec 2010
Gender: Male
Posts: 1,336
 Re: Thunar - custom actions
« Reply #29 on Dec 30, 2011, 10:28pm »

Alright, I have uploaded an updated custom actions file. I have added an action to convert .mdf files to .iso, .dmg to .img and then .img to .iso. So you can start with stupid file extensions and end up with a good one ::)

Creating a History in Thunar really isn't feasible, since it would require keeping a whole database of information.. I added a bookmarks option though, this allows you to create a bookmark(symlink) in /home/user-name/Bookmarks with only two clicks. The next obvious step was a delete bookmark option, which has been added, this option works whether you click on the original folder or the bookmark itself.

To get the latest just paste this obscenely large chunk into your terminal:

cd $HOME && wget http://www.salineos.com/Scripts/uca.xml && mv -f ./uca.xml ./.config/Thunar && wget http://www.salineos.com/Scripts/image-to-usb && gksu 'mv -f ./image-to-usb /usr/bin' && gksu 'chmod +x /usr/bin/image-to-usb' && gksu aptitude install unoconv mdf2iso dmg2img ccd2iso && mkdir -p $HOME/Bookmarks

As for creating a big long ffmpeg script, this is a possibility but is really really low on my priorities list. Because of the questionable legality of shipping a package such as ffmpeg, I will never use it on the official images.

Any other ideas 8-)

Edit: Forgot to mention I added the unmount ISO option.
« Last Edit: Dec 30, 2011, 10:29pm by Anthony Nordquist »Link to Post - Back to Top  IP: Logged
« Page 2 of 5 » Jump to page   Go    [Search This Thread] [Share Topic] [Print]



Anthony Nordquist, on behalf of the SalineOS project, is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. As such, if you click the above banner and then make any purchase including digital downloads, a small percentage will be paid to the SalineOS project.
Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!
Terms of Service | Privacy Policy | Notice | FTC Disclosure | Report Abuse | Mobile