Skip to content

Instantly share code, notes, and snippets.

@produnis
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save produnis/8985306 to your computer and use it in GitHub Desktop.
Save produnis/8985306 to your computer and use it in GitHub Desktop.
Nautilus-Scripte
#! /bin/bash
# required Packages:
# ---- zenity
# ---- mp3val
#################################################
# check for zenity
gui=$(which zenity)
if [ ! -x "$gui" ];
then
echo "Zenity is required: 'sudo apt-get install zenity"
exit 0
fi
# check for mp3val
gui=$(which mp3val)
if [ ! -x "$gui" ];
then
echo "mp3val is required: 'sudo apt-get install mp3val"
exit 0
fi
O=$IFS # save default File-Seperator
# write selected Files as Array
IFS=$'\n' arFILES=($(echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ))
IFS=$O # save back default File-Seperator
ZIEL=$(zenity --entry --text "Enter full path and output-filename" --entry-text="~/Downloads/OUTPUT.mp3")
(
echo "merging files..."
cat "${arFILES[@]}" > "$ZIEL"
echo "Repairing Xing header with mp3val..."
mp3val $ZIEL -f -nb
)|zenity --progress --pulsate --text="processing..." --percentage=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment