Softmod Depot
April 24, 2024, 09:35:47 PM *
Welcome, Guest. Please login or register.
Login with username, password and session length
News: 10.23.09 - The website is fully operational again. Thank you for the patience as we put everything back together. Check out the forums for more information if you are curious.
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: CISO Graphical Front End Tutorial (For Linux)  (Read 11520 times)
AarPirate
Guest
« on: January 25, 2008, 09:53:24 AM »

I wrote this up the other day. I thought I'd share it. It's a bash script that provides a graphical front end for the PSP ISO compression program 'ciso'. This script requires linux, 'zenity', and works best when paired with 'nautilus-actions'.

When set up properly one can right-click on an iso file and an option appears called 'Convert to CSO' and when you click it a save-as dialog appears. You input the save file with a '.cso' extension in any location you please, then you use a slider bar to choose compression level (default is 9, the heaviest compression), and then a progress bar pops up until compression is finished. If a cso is right-clicked the process is similar except the option says 'Convert to ISO' and the file must be saved with an '.iso' extension, and there is no choice in compression level (because decompression is 0). If you do not have 'nautilus-actions' or similar program you shouldn't use this script because it won't save you time or effort.

You run the script by passing three parameters to it. First, pass 1 if the input files is an iso, or 2 if the input file is a cso. Second, you pass the complete filepath. Third, you pass the input file name.

For example:

Code:
 ./cisofrontend.sh 1 "/home/user/backups" "backedupgame.iso" 

Example nautilus-actions setups:

Code:
Label: Convert to CSO
Tooltip: Compress a PSP ISO to CSO.
Path: /home/user/Scripts/cisofrontend.sh
Parameters: 1 %d %m
Filenames: *.iso

Code:
Label: Convert to ISO
Tooltip: Decompress a PSP CSO to ISO.
Path: /home/user/Scripts/cisofrontend.sh
Parameters: 2 %d %m
Filenames: *.cso

And here's the script, save it someplace like in a Scripts folder inside your home directory under the name 'cisofrontend.sh' and make it executable:

Code:
#!/bin/sh

FILETYPE="$1"
INFILEPATH="$2"
INPUTNAME="$3"

if [ $FILETYPE = "1" ]
   then
      OUTFILEPATH="$(zenity --file-selection --save --confirm-overwrite --filename "$INFILEPATH/$INPUTNAME.cso" --title "Output Location and File Name")"
      COMPRESSION="$(zenity --scale --text "Level of Compression (9 is slowest/smallest)" --min-value=1 --max-value=9 --value=9 --step 1)"

      (ciso $COMPRESSION "$INFILEPATH"/"$INPUTNAME" "$OUTFILEPATH"
) | zenity --progress --pulsate --auto-close --auto-kill --text "Converting $INPUTNAME to $OUTFILEPATH at Level $COMPRESSION Compression..."
fi

if [ $FILETYPE = "2" ]
   then
      OUTFILEPATH="$(zenity --file-selection --save --confirm-overwrite --filename "$INFILEPATH/$INPUTNAME.iso" --title "Output Location and File Name")"
      COMPRESSION="0"

      (ciso $COMPRESSION "$INFILEPATH"/"$INPUTNAME" "$OUTFILEPATH"
) | zenity --progress --pulsate --auto-close --auto-kill --text "Converting $INPUTNAME to $OUTFILEPATH at Level $COMPRESSION Compression..."
fi

Feel free to use and alter this script as you please, but if you post it elsewhere, please give me credit. I know this script isn't perfect and is actually quite simple, but I did it to the best of my ability and it gets the job done.
Logged
Kyla666 (zzk2001)
Administrator
Super Modder
******
Posts: 2367

Kicking ass


View Profile
« Reply #1 on: January 25, 2008, 10:45:26 PM »

Nice Job  Wink
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC