unixwz0r

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

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