I sometimes wonder how I ever got along without Thunar Custom Actions. I'm going to post a few of my favorites and hope you will too.
To date, you'll find almost of none of the one's I've posted here anywhere else online. Numerous of them are part of the default UberStudent installation.
Note: for any custom action that contains " and ' characters you need to make these with the custom actions user interface. You cannot make a uca.xml file with those characters, since they have to be encoded for xml.
#######################################################
BasicName:
Copy Folder Path Description: Copies the file or folder path to the clipboard so you can avoid "file:///" when pasting in to certain terminals
Command: echo -n %f | xclip -selection c
Appearance ConditionsFile Pattern: *
Appears if selection contains: Text Files
#######################################################
BasicName:
Make Backup FolderDescription: Make a copy of the folder, adding a date-stamp and .bak to it.
Command: cp -r %f %f.$(date --iso).bak
Appearance ConditionsFile Pattern: *
Appears if selection contains: Directories
BasicName:
Make Backup FileDescription: Make a copy of the files, adding a date-stamp and .bak to it.
Command: cp --backup=t %f %f.$(date --iso).bak
Appearance ConditionsFile Pattern: *
Appears if selection contains: Everything except Directories
NOTE: You'll want to make one for each of these with a different icon.
#######################################################
(I've tried a lot of ways to do this and this one works best BY FAR)
BasicName:
Send to Printer...Description: Print the selected file(s)
Command: libreoffice --invisible -p %F
Appearance ConditionsFile Pattern: *
Appears if selection contains: Image, Other, Text
#######################################################
(I've tried a lot of ways to do this and this one works by far the best)
BasicName:
Convert to PDFDescription: Make a PDF version of the selected file(s)
Command: libreoffice --invisible --convert-to pdf %F
Appearance ConditionsFile Pattern: [Grab the long string at
http://pastebin.com/n3Q0TQNN and put it here, it includes literally every file format supported by libreoffice]
Appears if selection contains: Other, Text
#######################################################Following are ones developers may find useful.#######################################################BasicName:
New Geany InstanceDescription: Open the file(s) in a new instance of geany
Command: geany %F -i
Appearance ConditionsFile Pattern: *
Appears if selection contains: Other, Text
#######################################################
BasicName:
Clipboard URL to wgetDescription: Pipes a URL you've copied to your clipboard to wget and downloads the file into the working directory, keeping the terminal open when done so you can read the result
Command: mate-terminal -e "bash -c \"wget $(xclip -o); exec bash\""
Appearance ConditionsFile Pattern: *
Appears if selection contains: Directories
Note: in UberStudent 4.3 and above, you can accomplish the above (and better, because the script has checks) by doing the following :
BasicName:
Clipboard URL to wgetDescription: Pipes a URL you've copied to your clipboard to wget and downloads the file into the working directory, keeping the terminal open when done so you can read the result
Command: mate-terminal -e cburl2wget 2>/dev/null
Appearance ConditionsFile Pattern: *
Appears if selection contains: Directories
#######################################################
BasicName:
Install with dpkgDescription: Install with dpkg, inserting your password into the string automatically, and keep the terminal open when done so you can read the result
Command: mate-terminal -e "bash -c \"echo yourpassword | sudo -S dpkg -i %F; exec bash\""
Appearance ConditionsFile Pattern: *.deb
Appears if selection contains: Other
Note: this also works with gnome-terminal. Obviously, too, replace yourpassword in the command line with your actual password. If you'd rather input your password each time, use this line: mate-terminal -e "bash -c \"sudo dpkg -i %F; exec bash\""
#######################################################
BasicName:
Sign with GPGDescription: Sign with GPG and keep the terminal open when done so you can read the result
Command: mate-terminal -e "bash -c \"debsign -k ####### %f; exec bash\""
Appearance ConditionsFile Pattern: *
Appears if selection contains: Text
Note: this also works with gnome-terminal. Substitute ####### with your actual signature.
#######################################################
BasicName:
Run in TerminalDescription: Run the executable file in the terminal and keep it open when done so you can read the result
Command: mate-terminal -e "bash -c \"%f; exec bash\""
Appearance ConditionsFile Pattern: *
Appears if selection contains: Other, Text
Note: this also works with gnome-terminal.
#######################################################
BasicName:
Open Folder as RootDescription: Open the folder as root, inserting your password into the string automatically
Command: bash -c "echo yourpassword | sudo -S thunar %F"
Appearance ConditionsFile Pattern: *
Appears if selection contains: Directories
Note: Obviously, replace yourpassword in the command line with your actual password.
#######################################################
BasicName:
Open File as RootDescription: Open the file as root, inserting your password into the string automatically
Command: bash -c "echo yourpassword | sudo -S geany %F"
Appearance ConditionsFile Pattern: *
Appears if selection contains: Text, Other
Note: Obviously, you can use any text editor you want besides geany. Obviously, replace yourpassword in the command line with your actual password.
#######################################################
BasicName:
Build Debian PackageDescription: Build a Debian package in the terminal in the current location and keep the terminal open when done so you can read the result
Command: mate-terminal -e "bash -c \"echo '>'; echo '> Preparing to build a Debian package...'; echo '>'; sleep 1; dpkg-buildpackage -sa; exec bash\""
Appearance ConditionsFile Pattern: *
Appears if selection contains: Directory
#######################################################
BasicName:
Make ExecutableDescription: Make the selected file executable, while reporting in a terminal the change made
Command: mate-terminal -e "bash -c \"echo '>'; chmod -v +x %F; echo '>'; exec bash\""
Appearance ConditionsFile Pattern: *
Appears if selection contains: Text, Other
Note: gnome-terminal works as well.
#######################################################
BasicName:
Create SymlinkDescription: Creates a symbolic link to the selected object
Command: ln -s %f %n.symlink
Appearance ConditionsFile Pattern: *
Appears if selection contains: Directories, Text, Audio, Image, Other
#######################################################
BasicName:
Run as UserDescription: Open in a terminal, run as a different user, and keep the terminal open so you can read the result
Command: mate-terminal -e "bash -c \"sudo su yourusername %F; exec bash\""
Appearance ConditionsFile Pattern: *
Appears if selection contains: Text, Other
#######################################################
sprunge.us is pastebin without the hassle. With this custom action, you just right click over the file, it uploads it to splunge in a terminal, and then the uploaded file's URL copies to your clipboad and also prints to the terminal screen. You must first install
xsel for this to work,
BasicName:
Upload to sprunge.usDescription: Upload code to sprunge.us
Command: mate-terminal -e "bash -c \"cat %f | curl -F 'sprunge=<-'
http://sprunge.us | xclip -selection c; echo; echo '%f was uploaded to:'; echo; xsel --clipboard --output; echo; exec bash\""
Appearance ConditionsFile Pattern: *
Appears if selection contains: Text, Other