Thunar custom actions

Sproggy
Posts: 1
Joined: 16. Mar 2012, 12:42

Re: Thunar custom actions

Post by Sproggy » 16. Mar 2012, 13:14

Heres some of my favourite right click context options ... you have image conversion .... resizing ... adding border ... creating archives ... copying and moving ...

please ensure xterm and imagemagik are installed

Code: Select all

<actions>
	<action>
		<icon>terminal</icon>
			<name>Open Terminal</name>
				<command>exo-open --working-directory %f --launch TerminalEmulator</command>
					<description>Open Terminal window here</description>
						<patterns>*</patterns>
						<directories/>
	</action>
		<action>
		<icon>gksu-root-terminal</icon>
			<name>Open Root Terminal</name>
				<command>gksu terminal</command>
					<description>Open Root Terminal window here</description>
						<patterns>*</patterns>
						<directories/>
	</action>
	<action>
		<icon>RootUser</icon>
			<name>Run As Root</name>
				<command>gksu thunar %d</command>
					<description>Run As Root</description>
						<patterns>*</patterns>
						<directories/><audio-files/><image-files/><other-files/><text-files/><video-files/>
	</action>
	<action>
		<icon>background</icon>
			<name>Convert JPG To PNG</name>
				<command>convert %F `basename %F .jpg`.png</command>
					<description>Convert the selected JPG graphic files to PNG</description>
						<patterns>*.jpg;*.jpeg;*.JPG;*.JPEG</patterns>
						<image-files/>
	</action>
	<action>
		<icon>ddd</icon>
			<name>Convert TIF to PNG</name>
				<command>convert %F `basename %F .tif`.png</command>
					<description>Convert the selected TIF graphic files to JPG</description>
						<patterns>*.tif;*.tiff;*.TIF;*.TIFF</patterns>
						<image-files/>
	</action>
	<action>
		<icon>ddd</icon>
			<name>Convert TIF to JPG</name>
				<command>convert %F `basename %F .tif`.jpg</command>
					<description>Convert the selected TIF graphic files to JPG</description>
						<patterns>*.tif;*.tiff;*.TIF;*.TIFF</patterns>
						<image-files/>
	</action>
	<action>
		<icon>ddd</icon>
			<name>Convert PNG To JPG</name>
				<command>convert %F `basename %F .png`.jpg</command>
					<description>Convert the selected PNG graphic files to JPG</description>
						<patterns>*.png;*.PNG</patterns>
						<image-files/>
	</action>
	<action>
		<icon>ddd</icon>
			<name>Convert PNG To TIF</name>
				<command>convert %F `basename %F .png`.tif</command>
					<description>Convert the selected PNG graphic files to TIF</description>
						<patterns>*.png;*.PNG</patterns>
						<image-files/>
	</action>
	<action>
		<icon>amarok</icon>
			<name>Resize to 16 Pixels Wide</name>
				<command>mogrify -resize 16 %F</command>
					<description>Resize image files to 16 pixels in width</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>amarok</icon>
			<name>Resize to 22 Pixels Wide</name>
				<command>mogrify -resize 22 %F</command>
					<description>Resize image files to 22 pixels in width</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>amarok</icon>
			<name>Resize to 24 Pixels Wide</name>
				<command>mogrify -resize 24 %F</command>
					<description>Resize image files to 24 pixels in width</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>amarok</icon>
			<name>Resize to 32 Pixels Wide</name>
				<command>mogrify -resize 32 %F</command>
					<description>Resize image files to 32 pixels in width</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>amarok</icon>
			<name>Resize to 48 Pixels Wide</name>
				<command>mogrify -resize 48 %F</command>
					<description>Resize image files to 48 pixels in width</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>amarok</icon>
			<name>Resize to 64 Pixels Wide</name>
				<command>mogrify -resize 64 %F</command>
					<description>Resize image files to 64 pixels in width</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>amarok</icon>
			<name>Resize to 128 Pixels Wide</name>
				<command>mogrify -resize 128 %F</command>
					<description>Resize image files to 128 pixels in width</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>amarok</icon>
			<name>Resize to 450 Pixels Wide</name>
				<command>mogrify -resize 450 %F</command>
					<description>Resize image files to 450 pixels in width</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>gtk-convert</icon>
			<name>Resize to 600 Pixels</name>
				<command>mogrify -resize 600 %F</command>
					<description>Resize image files to width of 600 pixels</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>bum</icon>
			<name>Add 1 Pixel Black Border</name>
				<command>mogrify -bordercolor Black -border 1 %F</command>
					<description>Add 1 pixel steelblue4 border to images</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>fx-icon</icon>
			<name>Add 2 Pixel Black Border</name>
				<command>mogrify -bordercolor Black -border 2 %F</command>
					<description>Add 2 pixel steelblue4 border to images</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>gnome-mime-application-x-7z-compressed</icon>
			<name>Create .7z archive</name>
				<command>7z a -t7z %n.7z %N</command>
					<description>Create *.7z file from selected files</description>
						<patterns>*</patterns>
						<directories/><audio-files/><image-files/><other-files/><text-files/><video-files/>
	</action>
	<action>
		<icon>gnome-mime-application-x-rar</icon>
			<name>Create .rar archive</name>
				<command>rar a %n.rar %n</command>
					<description>Compress directory contents as *.tar.gz file</description>
						<patterns>*</patterns>
						<directories/><audio-files/><image-files/><other-files/><text-files/><video-files/>
	</action>
	<action>
		<icon>gnome-mime-application-x-bzip</icon>
			<name>Create .tar.bz2 archive</name>
				<command>tar jcf %n.tar.bz2 %n</command>
					<description>Compress directory contents as *.tar.bz2 file</description>
						<patterns>*</patterns>
						<directories/><audio-files/><image-files/><other-files/><text-files/><video-files/>
	</action>
	<action>
		<icon>gnome-mime-application-x-gzip</icon>
			<name>Create .tar.gz archive</name>
				<command>tar czvf %n.tar.gz %n</command>
					<description>Compress directory contents as *.tar.gz file</description>
						<patterns>*</patterns>
						<directories/><audio-files/><image-files/><other-files/><text-files/><video-files/>
	</action>
	<action>
		<icon>gnome-mime-application-zip</icon>
			<name>Create .zip archive</name>
				<command>zip %n.zip %N</command>
					<description>Create *.zip file from selected files</description>
						<patterns>*</patterns>
						<directories/><audio-files/><image-files/><other-files/><text-files/><video-files/>
	</action>
	<action>
		<icon>gnome-mime-application-x-7z-compressed</icon>
			<name>Extract .7z archive</name>
				<command>7z x %n</command>
					<description>Extract .7z file here</description>
						<patterns>*.7z</patterns>
						<other-files/>
	</action>
	<action>
		<icon>rpm</icon>
			<patterns>*</patterns>
				<name>Create tar.xz archive without git+svn info</name>
				<name xml:lang="da">Byg tar.xz arkiv uden git+svn information</name>
					<command>xterm -T 'Please_wait..' -bg steelblue4 -fg grey88 -hold -fn *-fixed-*-*-*-20-* +hold -e tar Jcf %n.tar.xz --exclude .svn  --exclude .git --exclude .gitignore %n</command>
						<description>Create tar.xz archive without git+svn info</description>
						<directories/>
	</action>
	<action>
		<icon>rpm</icon>
			<patterns>*.bz2</patterns>
				<name>Create xz archive from bz2</name>
				<name xml:lang="da">Byg xz arkiv fra bz2</name>
					<command>xterm -T 'Please_wait..' -bg steelblue4 -fg grey88 -hold -fn *-fixed-*-*-*-20-* +hold -e bunzip2 '%f' && xz -9 %d/`basename '%f' .bz2`</command>
						<description>Create xz archive from bz2</description>
						<other-files/>
	</action>
	<action>
		<icon>rpm</icon>
			<patterns>*.gz</patterns>
				<name>Create xz archive from gz</name><actions>
	<action>
		<icon>terminal</icon>
			<name>Open Terminal</name>
				<command>exo-open --working-directory %f --launch TerminalEmulator</command>
					<description>Open Terminal window here</description>
						<patterns>*</patterns>
						<directories/>
	</action>
		<action>
		<icon>gksu-root-terminal</icon>
			<name>Open Root Terminal</name>
				<command>gksu terminal</command>
					<description>Open Root Terminal window here</description>
						<patterns>*</patterns>
						<directories/>
	</action>
	<action>
		<icon>RootUser</icon>
			<name>Run As Root</name>
				<command>gksu thunar %d</command>
					<description>Run As Root</description>
						<patterns>*</patterns>
						<directories/><audio-files/><image-files/><other-files/><text-files/><video-files/>
	</action>
	<action>
		<icon>background</icon>
			<name>Convert JPG To PNG</name>
				<command>convert %F `basename %F .jpg`.png</command>
					<description>Convert the selected JPG graphic files to PNG</description>
						<patterns>*.jpg;*.jpeg;*.JPG;*.JPEG</patterns>
						<image-files/>
	</action>
	<action>
		<icon>ddd</icon>
			<name>Convert TIF to PNG</name>
				<command>convert %F `basename %F .tif`.png</command>
					<description>Convert the selected TIF graphic files to JPG</description>
						<patterns>*.tif;*.tiff;*.TIF;*.TIFF</patterns>
						<image-files/>
	</action>
	<action>
		<icon>ddd</icon>
			<name>Convert TIF to JPG</name>
				<command>convert %F `basename %F .tif`.jpg</command>
					<description>Convert the selected TIF graphic files to JPG</description>
						<patterns>*.tif;*.tiff;*.TIF;*.TIFF</patterns>
						<image-files/>
	</action>
	<action>
		<icon>ddd</icon>
			<name>Convert PNG To JPG</name>
				<command>convert %F `basename %F .png`.jpg</command>
					<description>Convert the selected PNG graphic files to JPG</description>
						<patterns>*.png;*.PNG</patterns>
						<image-files/>
	</action>
	<action>
		<icon>ddd</icon>
			<name>Convert PNG To TIF</name>
				<command>convert %F `basename %F .png`.tif</command>
					<description>Convert the selected PNG graphic files to TIF</description>
						<patterns>*.png;*.PNG</patterns>
						<image-files/>
	</action>
	<action>
		<icon>amarok</icon>
			<name>Resize to 16 Pixels Wide</name>
				<command>mogrify -resize 16 %F</command>
					<description>Resize image files to 16 pixels in width</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>amarok</icon>
			<name>Resize to 22 Pixels Wide</name>
				<command>mogrify -resize 22 %F</command>
					<description>Resize image files to 22 pixels in width</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>amarok</icon>
			<name>Resize to 24 Pixels Wide</name>
				<command>mogrify -resize 24 %F</command>
					<description>Resize image files to 24 pixels in width</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>amarok</icon>
			<name>Resize to 32 Pixels Wide</name>
				<command>mogrify -resize 32 %F</command>
					<description>Resize image files to 32 pixels in width</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>amarok</icon>
			<name>Resize to 48 Pixels Wide</name>
				<command>mogrify -resize 48 %F</command>
					<description>Resize image files to 48 pixels in width</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>amarok</icon>
			<name>Resize to 64 Pixels Wide</name>
				<command>mogrify -resize 64 %F</command>
					<description>Resize image files to 64 pixels in width</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>amarok</icon>
			<name>Resize to 128 Pixels Wide</name>
				<command>mogrify -resize 128 %F</command>
					<description>Resize image files to 128 pixels in width</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>amarok</icon>
			<name>Resize to 450 Pixels Wide</name>
				<command>mogrify -resize 450 %F</command>
					<description>Resize image files to 450 pixels in width</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>gtk-convert</icon>
			<name>Resize to 600 Pixels</name>
				<command>mogrify -resize 600 %F</command>
					<description>Resize image files to width of 600 pixels</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>bum</icon>
			<name>Add 1 Pixel Black Border</name>
				<command>mogrify -bordercolor Black -border 1 %F</command>
					<description>Add 1 pixel steelblue4 border to images</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>fx-icon</icon>
			<name>Add 2 Pixel Black Border</name>
				<command>mogrify -bordercolor Black -border 2 %F</command>
					<description>Add 2 pixel steelblue4 border to images</description>
						<patterns>*</patterns>
						<image-files/>
	</action>
	<action>
		<icon>gnome-mime-application-x-7z-compressed</icon>
			<name>Create .7z archive</name>
				<command>7z a -t7z %n.7z %N</command>
					<description>Create *.7z file from selected files</description>
						<patterns>*</patterns>
						<directories/><audio-files/><image-files/><other-files/><text-files/><video-files/>
	</action>
	<action>
		<icon>gnome-mime-application-x-rar</icon>
			<name>Create .rar archive</name>
				<command>rar a %n.rar %n</command>
					<description>Compress directory contents as *.tar.gz file</description>
						<patterns>*</patterns>
						<directories/><audio-files/><image-files/><other-files/><text-files/><video-files/>
	</action>
	<action>
		<icon>gnome-mime-application-x-bzip</icon>
			<name>Create .tar.bz2 archive</name>
				<command>tar jcf %n.tar.bz2 %n</command>
					<description>Compress directory contents as *.tar.bz2 file</description>
						<patterns>*</patterns>
						<directories/><audio-files/><image-files/><other-files/><text-files/><video-files/>
	</action>
	<action>
		<icon>gnome-mime-application-x-gzip</icon>
			<name>Create .tar.gz archive</name>
				<command>tar czvf %n.tar.gz %n</command>
					<description>Compress directory contents as *.tar.gz file</description>
						<patterns>*</patterns>
						<directories/><audio-files/><image-files/><other-files/><text-files/><video-files/>
	</action>
	<action>
		<icon>gnome-mime-application-zip</icon>
			<name>Create .zip archive</name>
				<command>zip %n.zip %N</command>
					<description>Create *.zip file from selected files</description>
						<patterns>*</patterns>
						<directories/><audio-files/><image-files/><other-files/><text-files/><video-files/>
	</action>
	<action>
		<icon>gnome-mime-application-x-7z-compressed</icon>
			<name>Extract .7z archive</name>
				<command>7z x %n</command>
					<description>Extract .7z file here</description>
						<patterns>*.7z</patterns>
						<other-files/>
	</action>
	<action>
		<icon>rpm</icon>
			<patterns>*</patterns>
				<name>Create tar.xz archive without git+svn info</name>
				<name xml:lang="da">Byg tar.xz arkiv uden git+svn information</name>
					<command>xterm -T 'Please_wait..' -bg steelblue4 -fg grey88 -hold -fn *-fixed-*-*-*-20-* +hold -e tar Jcf %n.tar.xz --exclude .svn  --exclude .git --exclude .gitignore %n</command>
						<description>Create tar.xz archive without git+svn info</description>
						<directories/>
	</action>
	<action>
		<icon>rpm</icon>
			<patterns>*.bz2</patterns>
				<name>Create xz archive from bz2</name>
				<name xml:lang="da">Byg xz arkiv fra bz2</name>
					<command>xterm -T 'Please_wait..' -bg steelblue4 -fg grey88 -hold -fn *-fixed-*-*-*-20-* +hold -e bunzip2 '%f' && xz -9 %d/`basename '%f' .bz2`</command>
						<description>Create xz archive from bz2</description>
						<other-files/>
				<name xml:lang="da">Byg xz arkiv fra gz</name>
					<command>xterm -T 'Please_wait..' -bg steelblue4 -fg grey88 -hold -fn *-fixed-*-*-*-20-* +hold -e gunzip '%f' && xz -9 %d/`basename '%f' .gz`</command>
						<description>Create xz archive from gz</description>
						<other-files/>
	</action>
	<action>
		<icon>rpm</icon>
			<patterns>*.zip</patterns>
				<name>Create xz archive from zip</name>
				<name xml:lang="da">Byg xz arkiv fra zip</name>
					<command>xterm -T 'Please_wait..' -bg steelblue4 -fg grey88 -hold -fn *-fixed-*-*-*-20-* +hold -e mkdir tmpunz && unzip '%f' -d tmpunz && pushd tmpunz && tar Jcf ../`basename '%f' .zip`.tar.xz * && popd && rm -rf tmpunz</command>
						<description>Create xz archive from zip</description>
						<other-files/>
	</action>
	<action>
		<icon>rpm</icon>
			<patterns>*.tgz</patterns>
				<name>Create xz archive from tgz</name>
				<name xml:lang="da">Byg xz arkiv fra tgz</name>
					<command>xterm -T 'Please_wait..' -bg steelblue4 -fg grey88 -hold -fn *-fixed-*-*-*-20-* +hold -e gunzip '%f' && xz -9 %d/`basename '%f' .tgz`.tar</command>
						<description>Create xz archive from tgz</description>
						<other-files/>
	</action>
	<action>
		<icon>gnome-mime-application-x-rar</icon>
			<name>Extract .rar archive here</name>
				<command>unrar x %n</command>
					<description>Extract .rar file here</description>
						<patterns>*.rar</patterns>
						<other-files/>
	</action>
	<action>
		<icon>gnome-mime-application-x-bzip</icon>
			<name>Extract .tar.bz2 archive here</name>
				<command>tar -jxvf %n</command>
					<description>Extract .tar.bz2 file here</description>
						<patterns>*.tar.bz2</patterns>
						<other-files/>
	</action>
	<action>
		<icon>gnome-mime-application-x-gzip</icon>
			<name>Extract .tar.gz archive here</name>
				<command>tar -xzvf %n</command>
					<description>Extract .tar.gz file here</description>
						<patterns>*.tar.gz</patterns>
						<other-files/>
	</action>
	<action>
		<icon>gnome-mime-application-zip</icon>
			<name>Extract .zip archive here</name>
				<command>unzip %n</command>
					<description>Extract .zip file here</description>
						<patterns>*.zip</patterns>
						<other-files/>
	</action>
	<action>
		<icon>folder-move</icon>
			<name>Move To ...</name>
				<command>mv %F $(zenity --file-selection --directory)</command>
					<description>Move To ...</description>
						<patterns>*</patterns>
						<directories/><audio-files/><image-files/><other-files/><text-files/><video-files/>
	</action>
</actions>

Post Reply