View Single Post
  #3  
Old 1st July 2008, 14:42
nightfire nightfire is offline
Junior Member
 
Join Date: May 2008
Posts: 7
Thanks: 0
Thanked 1 Time in 1 Post
Default getting there :)

Burschik, Thank you for the help. If you can suggest some good books out there so I can learn this better that would be great. I'm finding info here and there around the net but don't under stand what allot of the variables are yet. So with this project here is where I stand. The Zenity menu now will run the command but it stays in a loop. It just keeps running the same one. So if I pick 3 programs to install it just loops the 1st one. I know this more advance and probably shouldn't be attempting to do this but I'm more of hands on then reader to understand things.

Code:
#!/bin/sh 

# this is my first menu script. 
# I'm tring to get Zenity to work with it So I can have a full GUI Menu 
#if [ $(whoami) != "root" ] ; then 
#      zenity --error \ 
#         --text="Please Run This as Root" 
#exit 1 
#fi 



clear; 
        echo "Hello, What would you like me to install for you? " 
        
        sleep 1 
        
read -a choice  <<EOF
$(zenity --height=400 --width=800 \
         --title="Install Menu" \
         --list \
         --checklist \
         --column="Pick This" \
    --column="#" \
    --column="Program" \
         --column="Action" \
          "False" "1" "Backgrounds" "(These are a colection from the all over the internet)" \
          "False" "2" "Backgrounds" "(These are a colection from http://wallpapers-n-etc.com)" \
          "False" "3" "icons" "(This will install some extra icon sets from gnome-look)" \
          "False" "4" "Video setup" "(This will install DVD Playback Codecs and Players)" \
          "False" "5" "themes" "(This will add some Extra Themes for gnome)" \
          "False" "6" "compiz fusion" "(This will install Compiz Fusion from Fedora Repo)" \
          "False" "7" "awn" "(This will install the AWN Dock)" | tr '|' ' ')
EOF

echo "${choice[@]}"


       
        while [[ $choice != 0 ]] 
        do 
           case $choice in 
             1)  clear; 
       rpm -Uvh 'http://192.168.2.4/downloads/nfbackgrounds-1-1.fc9.noarch.rpm' 
       P=nfbackgrounds 
       rpm -qa "$P" > tl 
       my_size=$( wc -l < t1 ) 
       echo "Checking install status" 
       if [[ $( rpm -qa $P ) =~ ${P} ]] 
       then 
        zenity --info \ 
                --text="Backgrounds were installed.  Right click on desktop to change Background" 
       else 
         zenity --error \ 
             --text="Backgrounds Were not installed" 
       fi 
       rm t1                
                 ;; 
        2)  clear; 
       rpm -Uvh 'http://192.168.2.3/downloads/nfbackground2-1-1.fc9.noarch.rpm' 
       P=nfbackgrounds2 
       rpm -qa "$P" > t1 
       my_size=$( wc -l < t1 ) 
       echo "Checking install status" 
       if [[ $( rpm -qa $P ) =~ ${P} ]] 
       then 
        zenity --info \ 
                --text="Backgrounds were installed.  Right click on desktop to change Background" 
       else 
         zenity --error \ 
             --text="Backgrounds Were not installed" 
       fi 
       rm t1                
       ;; 
             3)  clear; 
       yum -y install wget 
       wget 192.168.2.4/downloads/nficons.tar.gz 
       tar zxvf nficons.tar.gz -C /usr/share/icons 
       rm nficons.tar.gz 
                 ;; 
             4)  clear; 
                 su -c 'rpm -i http://rpm.livna.org/livna-release-8.rpm' 
       wget 192.168.2.4/downloads/dvdplayback.sh 
       sh dvdplayback.sh 
       rm dvdplayback.sh 
                 ;; 
             5)  clear; 
       yum -y install wget 
                 wget 192.168.2.4/downloads/nfthemesf8.tar.gz 
                 tar zxvf nfthemesf8.tar.gz -C /usr/share/themes 
       rm nfthemesf8.tar.gz 
       ;; 
             6)  clear; 
                 yum -y install ccsm emerald-themes compizconfig-backend-kconfig compizconfig-backend-gconf fusion-icon* emerald compiz-fusion compiz-fusion-gnome libcompizconfig compiz-gnome compiz-bcop compiz compizconfig-python compiz-fusion-extras compiz-fusion-extras-gnome compiz-kde 
       P=compiz-fusion-gnome 
       rpm -qa "$P" > t1 
       my_size=$( wc -l < t1 ) 
       echo "Checking install status" 
       if [[ $( rpm -qa $P ) =~ ${P} ]] 
       then 
        zenity --info \ 
                --text="compiz fusion was installed." 
       else 
         zenity --error \ 
             --text="compiz fusion was not installed" 
       rm t1 
       fi 
       ;; 
             7)  clear; 
                 yum -y install avant-window-navigator awn-extras 
                 P=avant-window-navigator 
       rpm -qa "$P" > t1 
       my_size=$( wc -l < t1 ) 
       echo "Checking install status" 
       if [[ $( rpm -qa $P ) =~ ${P} ]] 
       then 
        zenity --info \ 
                --text="avant-window-navigator was installed." 
       else 
         zenity --error \ 
             --text="avant-window-navigator was not installed" 
       rm tl 
       fi 
       ;; 
             *)  clear; 
                 echo "You have entered an invalid option!" 
                 ;; 
           esac 

      done
Thanks again in advance
__________________
Thanks,
Night Fire
Linux Tips, Tricks and Guides for Fedora 8
Reply With Quote