Author Topic: Unzip sfArk Nautilus Script  (Read 16456 times)

0 Members and 1 Guest are viewing this topic.

Offline rockhopper

  • Hero Member
  • *****
  • Posts: 100
  • Karma: +2/-0
    • RockHopper
Unzip sfArk Nautilus Script
« on: September 13, 2013, 04:04:17 PM »
Created a Nautilus script which allows you to invoke sfArkXTm on a bunch .sfArk files simply by selecting and right-clicking: https://github.com/rock-hopper/Unzip-sfArk

Raboof has updated sfArkXTm so that the progress line gets updated rather than new lines being written while unpacking .sfArk files: https://github.com/raboof/sfArkXTm. The updated version also works with the Nautilus script.
« Last Edit: September 13, 2013, 04:13:11 PM by rockhopper »

Offline GMaq

  • Administrator
  • Hero Member
  • *****
  • Posts: 3125
  • Karma: +47/-0
  • A/V 'Nixer
    • www.bandshed.net
Re: Unzip sfArk Nautilus Script
« Reply #1 on: September 17, 2013, 12:39:43 PM »
Hi,

These are all really great additions and the Nautilus scripts take them over the top. I think it would be better for me to create a package and move the sfArkXTm executable to /usr/bin so when I do that I'll post here and you can then update the Nautilus script to point to /usr/bin. If you don't mind I'll wait until your development on these has stabilized and then create packages that install both the executable and Nautilus scripts all at the same time.

I appreciate that you are working on these, having these sorts of scripts integrated into the file manager is terrific!

Offline rockhopper

  • Hero Member
  • *****
  • Posts: 100
  • Karma: +2/-0
    • RockHopper
Re: Unzip sfArk Nautilus Script
« Reply #2 on: September 17, 2013, 04:48:56 PM »
Thanks GMaq :)  I'm not intending to add any more features to the scripts and am fairly certain all the bugs have been ironed out now. Of course, if you do find any bugs please let me know! I'll update the sfArk script as soon as you post back.

Now off to work on other projects... ;)

Offline GMaq

  • Administrator
  • Hero Member
  • *****
  • Posts: 3125
  • Karma: +47/-0
  • A/V 'Nixer
    • www.bandshed.net
Re: Unzip sfArk Nautilus Script
« Reply #3 on: September 18, 2013, 03:53:54 PM »
Hi rockhopper,

Ok here are the packages from latest GIT:

http://bandshed.net/avlinux6-debs/sfark/sfarklib_GIT20130918avlinux6-1_i386.deb
http://bandshed.net/avlinux6-debs/sfark/sfarkxtm_GIT20130918avlinux6-1_i386.deb


And here is your awesome Nautilus Script Modded to work with these packages. I'm going to package all the scripts but I'm just posting it here to show the minor changes..

Code: [Select]
#!/bin/bash
#
# 'Unzip sfArk' by RockHopper 2013
#
# This is a Nautilus script to invoke 'sfArkXTm'. It assumes that sfArkXTm is
# installed in ~/Extra Goodies/SfArkXTm and that xterm is available.
#
# This script is public domain and provided 'as-is', without any express or implied
# warranty. In no event will the author be held liable for any damages arising from
# the use of this software.


# These variables may be modified if sfArkXTm is installed somewhere other than ~/Extra Goodies/SfArkXTm
# or if you wish to use a different terminal emulator

SFARKXTM_DIR="/usr/bin/"
SFARKXTM_EXEC="sfArkXTm"
TERMINAL_COMMAND="xterm -hold -title UnzipSfArk -font 9x15 -e"

# N.B. For a list of available fonts in xterm type: appres XTerm | grep VT100.font
##################################################################################


commandToExec='function setTextColour { tput setf $1; }; let CYAN=3; let RED=4; let YELLOW=6; let WHITE=7; '
commandToExec+='function startUnderline { tput smul; }; function stopUnderline { tput rmul; }; '

commandToExec+='setTextColour $YELLOW; startUnderline; echo -e "\nUnzip sfArk\n"; stopUnderline; setTextColour $WHITE; '

commandToExec+="cd '$SFARKXTM_DIR'; "

for fileUri in $NAUTILUS_SCRIPT_SELECTED_URIS; do
    filePath="${fileUri#file://}"
    filePath="${filePath//%20/ }"

    if [[ $filePath != *.[sS][fF][aA][rR][kK] ]] && [[ $filePath != *.[sS][fF]2[aA][rR][kK] ]]; then
        commandToExec+='setTextColour $RED; '
        commandToExec+="echo '\"$filePath\" is not a SF2 Archive'"
        $TERMINAL_COMMAND "$commandToExec"
        exit 1
    fi

    outputFile="${filePath##*/}"
    outputFile="${outputFile%.*}.sf2"
    commandToExec+="./$SFARKXTM_EXEC '$filePath' '$outputFile'; echo; "
done

commandToExec+='if [ $? -eq 0 ]; then setTextColour $YELLOW; echo "All done!"; fi'

$TERMINAL_COMMAND "$commandToExec"

Offline rockhopper

  • Hero Member
  • *****
  • Posts: 100
  • Karma: +2/-0
    • RockHopper
Re: Unzip sfArk Nautilus Script
« Reply #4 on: September 18, 2013, 06:44:13 PM »
Great stuff, the Nautilus script on github is now set to /usr/bin too

Offline GMaq

  • Administrator
  • Hero Member
  • *****
  • Posts: 3125
  • Karma: +47/-0
  • A/V 'Nixer
    • www.bandshed.net
Re: Unzip sfArk Nautilus Script
« Reply #5 on: September 20, 2013, 04:28:53 PM »