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.
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.
Joined: Jan 2011 Gender: Male Posts: 607 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.
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?
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.
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.
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.
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?
Joined: Jan 2011 Gender: Male Posts: 607 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.
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.
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:
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
Edit: Forgot to mention I added the unmount ISO option.
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.