Saturday, January 12, 2013

Add new commands in Thunar context menu

  • Edit/Configure custom actions.
  • Open a folder as root
Opening a root Thunar
Name: Open a root Thunar here
Command: gksu thunar %f
File pattern: *
Appears if selection contains: Directories
  • To add a command that would run a player, examples: 
/opt/deadbeef/bin/deadbeef %F
qmmp %F
/usr/bin/smplayer %f
/usr/bin/vlc %f

  • To lauch a Terminal:
exo-open --working-directory %f --launch TerminalEmulator

  • To open a root Thunar 
gksu thunar %N

  • To convert to png: 
convert %f %f.png

  • To convert pdf to text at this directory level: 
for file in *.pdf; do pdftotext "$file" "$file.txt"; done

  • convert pdf to txt in all directories : 
find . -name '*.pdf' -print0 | xargs -0 -n1 pdftotext

  • delete without recycle:
 rm -r %F

  • secure delete: 
(apt-get install secure-delete)

srm %F
  • shred, wipe:
shred -u %F

  • search with catfish: 
catfish --fileman=thunar –path=%f

  • to join selected text files 
cat %N > JoinedFile

  • To run in a Wine program: 
path/to/script %F

the script should look like:

(example for Foobar2000):

#!/bin/bash

cd ~/.wine/drive_c/"Program Files"/foobar2000/
if [ "$1" != "" ]; then
filename=`echo z:$1 | sed 's/\\//\\\\/g'`
wine foobar2000.exe "$filename" &
else
wine foobar2000.exe &
fi

No comments:

Post a Comment