Advertisement
clockworkpc

Ubuntu Customisation Script

Jan 12th, 2012
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.56 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. #This is the Clockwork PC post-installation Ubuntu customisation script
  4.  
  5. import os
  6.  
  7. #Install Xcowsay
  8.  
  9. #os.system("sudo apt-get install xcowsay")
  10.  
  11. #Create personalised folders
  12.  
  13. homeFolder = os.getenv("HOME")
  14. binFolder = homeFolder + "/bin2"
  15. videoProjectsFolder = homeFolder + "/Videos/Projects"
  16.  
  17. #Generate bin files
  18.  
  19. cpcBash = binFolder + "/cpcbash2.sh"
  20. cpcBashName = "/cpcbash2.sh"
  21.  
  22. os.mkdir(binFolder)
  23. open(cpcBash,"w").close()
  24.  
  25. f = open(cpcBash,"a")
  26. f.write("""#!/bin/bash
  27. #~/bin/cpcbash.sh
  28.  
  29. # Released under a GPLv3 Licence by Clockwork PC 2012
  30. # www.clockworkpc.com.au
  31.  
  32. # You are entitled to the following four freedoms:
  33. # Freedom 0: To run this program for any purpose
  34. # Freedom 1: To study how this program works and change it to make it do what you wish
  35. # Freedom 2: To redistribute copies so you can help your neighbour
  36. # Freedom 3: To distribute copies of your modified version to others
  37.  
  38. #BASH script to generate BASH scripts
  39.  
  40. echo "What do you want to call your BASH script?"
  41. read RESPONSE
  42.  
  43. echo "#!/bin/bash" | tee ~/bin/$RESPONSE.sh
  44. echo "#Filename:$RESPONSE.sh" | tee -a ~/bin/$RESPONSE.sh
  45. echo "#Released under a GPLv3 Licence by Clockwork PC" | tee -a ~/bin/$RESPONSE.sh
  46.  
  47. sudo chmod +x ~/bin/$RESPONSE.sh
  48.  
  49. sudo ln -s ~/bin/$RESPONSE.sh /usr/local/bin/$RESPONSE.sh
  50. sudo chmod +x /usr/local/bin/$RESPONSE.sh
  51.  
  52. gedit ~/bin/$RESPONSE.sh
  53. """)
  54.  
  55. f.close()
  56.  
  57. os.system("chmod -v +x " + cpcBash)
  58. os.system("sudo ln -sv " + cpcBash + " /usr/local/bin" + cpcBashName)
  59. os.system("xcowsay 'Your Python script is ready!'")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement