Skip to content

Commit e6b3926

Browse files
committed
Added Readme and nemo scripts
1 parent ce85c1a commit e6b3926

File tree

9 files changed

+131
-0
lines changed

9 files changed

+131
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# NiceScripts
2+
3+
Some nice scripts...
4+
5+
# Folders
6+
7+
* nautilus : scripts for the nautilus contextual menu
8+
* nemo : scripts for the nemo contextual menu
9+
* bin : scripts for generic bash use
10+
11+

nemo/copy.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
# Copy the nautilus scripts to nautilus folder
3+
TARGET="${HOME}/.local/share/nemo/scripts"
4+
SRC=`realpath ./scripts`
5+
cp -a ./scripts/* $TARGET/

nemo/link.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
# Replace nemo script folder with a link to this repository
3+
TARGET="${HOME}/.local/share/nemo/scripts"
4+
SRC=`realpath ./scripts`
5+
if test -d "$TARGET"
6+
then
7+
mv $TARGET $TARGET.bak
8+
echo "Your previous $TARGET folder has been rename to $TARGET.bak"
9+
fi
10+
ln -s $SRC $TARGET

nemo/scripts/Latex2Markdown

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
3+
# Script using pandoc to convert Latex file to Markdown file
4+
# Author Romain Rossi <[email protected]>
5+
# Licence : GPL
6+
7+
logf="$HOME/scripts.log"
8+
9+
for infile in "$NEMO_SCRIPT_SELECTED_FILE_PATHS"
10+
do
11+
d=$(dirname "$infile")
12+
i=$(basename -z "$infile")
13+
o=$(basename -z --suffix=.txt "$i").md
14+
ifile="$d/$i"
15+
ofile="$d/$o"
16+
pandoc -f latex "$ifile" -o "$ofile" 2> "$logf"
17+
notify-send "Fichier $ifile converti" "Sortie : $ofile"
18+
done
19+

nemo/scripts/Markdown2odt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
3+
# Script using pandoc to convert Markdown files to OpenDocument Text
4+
# Author Romain Rossi <[email protected]>
5+
# Licence : GPL
6+
7+
logf="$HOME/scripts.log"
8+
9+
for infile in "$NEMO_SCRIPT_SELECTED_FILE_PATHS"
10+
do
11+
d=$(dirname "$infile")
12+
i=$(basename -z "$infile")
13+
o=$(basename -z --suffix=.md "$i").odt
14+
ifile="$d/$i"
15+
ofile="$d/$o"
16+
pandoc -f markdown --toc -t odt "$ifile" -o "$ofile" 2> "$logf"
17+
notify-send "Fichier $ifile converti" "Sortie : $ofile"
18+
done

nemo/scripts/Markdown2pdf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
# Script using pandoc to convert Markdown files to PDF
3+
# Author Romain Rossi <[email protected]>
4+
# Licence : GPL
5+
6+
logf="$HOME/scripts.log"
7+
8+
for infile in "$NEMO_SCRIPT_SELECTED_FILE_PATHS"
9+
do
10+
d=$(dirname "$infile")
11+
i=$(basename -z "$infile")
12+
o=$(basename -z --suffix=.md "$i").pdf
13+
ifile="$d/$i"
14+
ofile="$d/$o"
15+
pandoc -M papersize=a4 -M documentclass=report -M geometry=margin=2cm -f markdown "$ifile" -o "$ofile" 2> "$logf"
16+
notify-send "Fichier $ifile converti" "Sortie : $ofile"
17+
done
18+

nemo/scripts/Textile2odt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
# Script using pandoc to convert Textile files to OpenDocument text
3+
# Author Romain Rossi <[email protected]>
4+
# Licence : GPL
5+
6+
logf="$HOME/scripts.log"
7+
8+
for infile in "$NEMO_SCRIPT_SELECTED_FILE_PATHS"
9+
do
10+
d=$(dirname "$infile")
11+
i=$(basename -z "$infile")
12+
o=$(basename -z --suffix=.txt "$i").odt
13+
ifile="$d/$i"
14+
ofile="$d/$o"
15+
pandoc -f textile --toc -t odt "$ifile" -o "$ofile" 2> "$logf"
16+
notify-send "Fichier $ifile converti" "Sortie : $ofile"
17+
done

nemo/scripts/Textile2pdf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
# Script using pandoc to convert Textile files to PDF
3+
# Author Romain Rossi <[email protected]>
4+
# Licence : GPL
5+
6+
logf="$HOME/scripts.log"
7+
8+
for infile in "$NEMO_SCRIPT_SELECTED_FILE_PATHS"
9+
do
10+
d=$(dirname "$infile")
11+
i=$(basename -z "$infile")
12+
o=$(basename -z --suffix=.txt "$i").pdf
13+
ifile="$d/$i"
14+
ofile="$d/$o"
15+
pandoc -M papersize=a4 -M documentclass=report -M geometry=margin=2cm --toc -f textile "$ifile" -o "$ofile" 2> "$logf"
16+
notify-send "Fichier $ifile converti" "Sortie : $ofile"
17+
done
18+

nemo/scripts/ps2pdf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
# Wrapper nautilus script for ps2pdf
3+
# Author Romain Rossi <[email protected]>
4+
# Licence : GPL
5+
6+
logf="$HOME/scripts.log"
7+
8+
for infile in "$NEMO_SCRIPT_SELECTED_FILE_PATHS"
9+
do
10+
d=$(dirname "$infile")
11+
i=$(basename -z "$infile")
12+
ifile="$d/$i"
13+
ps2pdf "$i" 2> "$logf"
14+
notify-send "Fichier $i converti"
15+
done

0 commit comments

Comments
 (0)