Diverse skript

Kildekoden ligger lagret på Github. Hvis du gjør endring, vennligst lag en forgrening (fork) der :-)

Open this directory in Git Cola:

1 2 3 4 5 6 7 8 9 10
#!/bin/bash
#Put this file in ~/.gnome2/nautilus-scripts directory
#Open the selected directory of Nautilus in git cola
 
workdir=$(echo $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS)
 
git-cola -r $workdir
#Comment the previous line and uncomment the next line,
#If want to keep git cola in English even if your system use an other language
#LANG=C && git-cola -r $workdir && LANG=fr_FR.UTF-8

Open currenct directory in Git Cola:

1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/bin/bash
#Put this file in ~/.gnome2/nautilus-scripts directory
#Open the current directory of Nautilus in git cola
 
if [ "x$NAUTILUS_SCRIPT_CURRENT_URI" = "x" ]; then
workdir=$(pwd) #FIXME
else
workdir=$(echo $NAUTILUS_SCRIPT_CURRENT_URI| sed 's/file:\/\///g')
fi
 
git-cola -r $workdir
#Comment the previous line and uncomment the next line,
#If want to keep git cola in English even if your system use an other language
#LANG=C && git-cola -r $workdir && LANG=fr_FR.UTF-8

Rename file to the name of parent folder:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#!/bin/bash
 
# Rename file to the name of parent folder
 
# Install nautilus-actions:
# http://ubuntuforums.org/showthread.php?t=91377
 
# Only support 3 character file extention
extention=${1:(-4):4}
#echo $extention
 
# Getting name of the parent folder
parentdirectoryname=`dirname "$1" | tr / \\\\n | tail -1`
#echo $parentdirectoryname
 
directory=`dirname "$1"`
 
newname="${directory}/${parentdirectoryname}${extention}"
 
# Moving file
mv "$1" "$newname"

Dette innlegget ble publisert i Ubuntu / Linux og merket med , , , , , . Bokmerk permalenken.