unixwz0r

UNIXwz0r - steam-setup (re-written with dialog)

Jan 23rd, 2015
441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.46 KB | None | 0 0
  1. #!/bin/bash -x
  2. #----------------------------------------------------------------------------------------
  3. # Script Created by Gary Perreault - Tux Hat Linux Project ([email protected])
  4. # Distro Sourceforge - https://sourceforge.net/projects/tuxhatlinux/
  5. # Distro Dailymotion - http://www.dailymotion.com/tuxhatlinux
  6. #----------------------------------------------------------------------------------------
  7. #This program is free software: you can redistribute it and/or modify
  8. #it under the terms of the GNU General Public License as published by
  9. #the Free Software Foundation, either version 3 of the License, or
  10. #(at your option) any later version.
  11. #
  12. #This program is distributed in the hope that it will be useful,
  13. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. #GNU General Public License for more details.
  16. #
  17. #You should have received a copy of the GNU General Public License
  18. #along with this program.  If not, see <http://www.gnu.org/licenses/>.
  19. #----------------------------------------------------------------------------------------
  20. # Run this script after your first boot with archlinux (as root)
  21. #----------------------------------------------------------------------------------------
  22. # Explaination of the Script:
  23. #
  24. # Setup-Tuxhat using Dialog
  25. #
  26. ##########################################################################################
  27.  
  28. # Top program dir is used for testing
  29.  
  30. # Global Stuff
  31. UPDATEPACMAN="pacman -Syy"
  32. STEAM="pacman -S steam ttf-liberation"
  33. MULTILIB="nano /etc/pacman.conf"
  34. STH="setup-tuxhat"
  35. TITLENAME="Tux Hat Linux Steam Client Setup"
  36. DIALOGRC=${DIALOGRC}
  37. DISTNAME='Tux Hat Linux '
  38. DISTVER='v3.4'
  39. DASH='-'
  40. SCRIPTNAME='Steam Setup Script'
  41. MNT=/mnt
  42. CONFIGFILE=/home/gary/Test/setup-tuxhat.conf
  43.  
  44. if [[ -f $CONFIGFILE ]]; then
  45.   source $CONFIGFILE
  46. else
  47.   echo "Error missing file: setup-tuxhat.conf - Required by program"
  48.   exit 1
  49. fi
  50.  
  51. ### Program for making the UI
  52.  
  53. DIALOG=${DIALOG=dialog}
  54. #DIALOG=${DIALOG=Xdialog}
  55.  
  56. # Temp files
  57.  
  58. tmpfile=`tmpfile 2> /dev/null` || tmpfile=/tmp/tmpfile$$
  59. trap "rm  -f $tmpfile" 0 1 2 5 15
  60.  
  61. ###############
  62. # Steam-Setup #
  63. ###############
  64. steamsetupmenuchoices()
  65.  
  66. {      
  67.         case $choice in
  68.        
  69.             "1")               
  70.             $MULTILIB
  71.             steamsetupmenu
  72.             ;;
  73.             "2")
  74.             $UPDATEPACMAN
  75.             steamsetupmenu
  76.             ;;
  77.             "3")
  78.             $STEAM
  79.             setuptuxhatmenu
  80.             ;;
  81.            
  82.         esac
  83. }
  84.  
  85. steamsetupmenu()  # Steam Client Main Menu Setup
  86.  
  87. {
  88.    
  89.     while :
  90.     do
  91.         DIALOGRC="$DIALOGRC" $DIALOG --backtitle "$DISTNAME$DISTVER $DASH $SCRIPTNAME " --no-shadow \
  92.         --ok-label 'Select' --cancel-label 'Exit' \
  93.         --title "$TITLENAME" --menu "Select Task 1-3 to Setup Steam Client" 10 52 26 \
  94.         "1." "Uncomment Multilib if it's not configured" \
  95.         "2." "Update Pacman to refresh" \
  96.         "3." "Install Steam 32Bit only, needs multilib" 2> $tmpfile
  97.            
  98.         mmretval=$?
  99.         choice=`cat $tmpfile`
  100.                
  101.     case $mmretval in      
  102.     0)
  103.       steamsetupmenuchoices
  104.     ;;
  105.  
  106.     1)
  107.     if DIALOGRC="$DIALOGRC" $DIALOG --yesno "Do you want to exit?\n" 5 24
  108.     then
  109.         exit 0
  110.     fi
  111.    
  112.     ;;
  113.     255)
  114.    # echo "ESC key pressed"
  115.    
  116.     ;;
  117.     esac
  118. done
  119. }
  120.  
  121. ########################################################################
  122. #
  123. #          End of Script -- Tux Hat Linux Development -- UNIXwz0r
  124. #
  125. ########################################################################
  126.  
  127. steamsetupmenu
Advertisement
Add Comment
Please, Sign In to add comment