Guest User

arch openbox

a guest
Jul 21st, 2010
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.02 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #this will make it so the screen doesn't go blank to prevent people from pressing enter to wake it up
  4. setterm -blank 0
  5.  
  6. #this will start the script and ask the user if he wants to run it
  7. clear
  8. echo "Welcome to my arch setup script. This script will semi-automatically"
  9. echo "set up a working openbox system. You will be asked several questions"
  10. echo "throughout the script so pay attention."
  11. echo ""
  12. echo "Warning: Once the process is started you cannot back out without risk of"
  13. echo "damaging your system."
  14. echo ""
  15. read -p "Continue? (Y/N): ";
  16. if [ $REPLY == "y" ]; then
  17. clear;
  18. elif [ $REPLY == "Y" ]; then
  19. clear;
  20. else
  21. exit;
  22. fi
  23.  
  24. #this will create a user account
  25. echo "What do you want your username to be?"
  26. echo ""
  27. read -p "> "
  28. USERNAME=$REPLY
  29. useradd -m -G users,audio,lp,optical,storage,video,wheel,power -s /bin/bash $USERNAME
  30. clear
  31. echo "What do you want your password to be?"
  32. passwd $USERNAME
  33. clear
  34.  
  35. echo "We wil now update the system..."
  36. sleep 3
  37.  
  38. #this will update pacman
  39. pacman -Syu --noconfirm
  40.  
  41. #this will update everything else
  42. pacman -Syu --noconfirm
  43.  
  44. #now we will set up sound
  45. clear
  46. echo "options snd-pcsp index=2" >> /etc/modprobe.d/modprobe.conf
  47. pacman -S alsa-utils alsa-oss --noconfirm
  48. clear
  49. echo "You will now adjust the volume to your liking with alsamixer."
  50. echo "You can control alsamixer with your arrow keys, and M for mute/unmute."
  51. echo "When you are finished adjusting the volume, press ESC."
  52. echo ""
  53. echo "Press enter when you are ready."
  54. echo ""
  55. read -p "> "
  56. if [ $REPLY == "" ]; then
  57. clear;
  58. else
  59. clear;
  60. fi
  61. su $USERNAME -c alsamixer
  62. alsactl store
  63. clear
  64.  
  65. #we will now setup Xorg and stuff
  66. echo "Please wait..."
  67. pacman -S xorg xf86-video-vesa xf86-input-keyboard xf86-input-mouse --noconfirm
  68. clear
  69. echo "We are now going to configure xorg."
  70. echo ""
  71. echo "Do not be alarmed if your screen flickers or something."
  72. echo ""
  73. echo "It will automatically start in 10 seconds."
  74. sleep 10
  75. clear
  76. Xorg -configure
  77. cp /root/xorg.conf.new /etc/X11/xorg.conf
  78. clear
  79.  
  80. #now to setup input hotplugging
  81. echo "Setting up input hotplugging..."
  82. sleep 3
  83. pacman -S hal dbus xf86-input-evdev fam --noconfirm
  84. /etc/rc.d/hal start
  85. /etc/rc.d/fam start
  86. clear
  87.  
  88. #installing openbox
  89. echo "Installing openbox..."
  90. sleep 3
  91. pacman -S openbox obconf obmenu --noconfirm
  92. echo "exec ck-launch-session dbus-launch --exit-with-session openbox-session" >> /home/$USERNAME/.xinitrc
  93. chown $USERNAME /home/$USERNAME/.xinitrc
  94. mkdir -p /home/$USERNAME/.config/openbox/
  95. cp /etc/xdg/openbox/rc.xml /home/$USERNAME/.config/openbox/
  96. cp /etc/xdg/openbox/autostart.sh /home/$USERNAME/.config/openbox/
  97. chown $USERNAME /home/$USERNAME/.config/
  98. chown $USERNAME /home/$USERNAME/.config/openbox/
  99. chown $USERNAME /home/$USERNAME/.config/openbox/autostart.sh
  100. chown $USERNAME /home/$USERNAME/.config/openbox/rc.xml
  101. clear
  102.  
  103. #installing login manager
  104. echo "Installing login manager..."
  105. sleep 3
  106. pacman -S slim archlinux-themes-slim --noconfirm
  107. sed -i 's/current_theme default/current_theme archlinux-darch-grey/g' /etc/slim.conf
  108.  
  109. #adding daemons
  110. sed -i '/DAEMONS/ d' /etc/rc.conf
  111. echo "DAEMONS=(syslog-ng network crond alsa hal fam slim)" >> /etc/rc.conf
  112. clear
  113.  
  114. #setting up various apps and other things to make things nicer and more friendly
  115. echo "Now installing stuff to make system nicer..."
  116. sleep 3
  117. pacman -S thunar thunar-thumbnailers thunar-archive-plugin thunar-volman tango-icon-theme sudo archlinux-wallpaper squeeze bzip2 gzip unrar zip unzip lzop ttf-ms-fonts ttf-dejavu ttf-bitstream-vera pidgin firefox deluge tint2 volwheel leafpad ristretto gimp nitrogen terminator vlc banshee gmrun lxrandr gksu --noconfirm
  118. echo "gtk-icon-theme-name=\"Tango\"" >> /home/$USERNAME/.gtkrc-2.0
  119. chown $USERNAME /home/$USERNAME/.gtkrc-2.0
  120. echo "$USERNAME ALL=(ALL) ALL" >> /etc/sudoers
  121. echo "thunar --daemon &" >> /home/$USERNAME/.config/openbox/autostart.sh
  122. echo "nitrogen --restore &" >> /home/$USERNAME/.config/openbox/autostart.sh
  123. echo "tint2 &" >> /home/$USERNAME/.config/openbox/autostart.sh
  124. echo "volwheel &" >> /home/$USERNAME/.config/openbox/autostart.sh
  125. mkdir /home/$USERNAME/.config/nitrogen/
  126. chown $USERNAME /home/$USERNAME/.config/nitrogen/
  127. echo "
  128. [:0.0]
  129. file=/usr/share/archlinux/wallpaper/archlinux-simplyblack.png
  130. mode=4
  131. bgcolor=# 0 0 0" >> /home/$USERNAME/.config/nitrogen/bg-saved.cfg
  132. chown $USERNAME /home/$USERNAME/.config/nitrogen/bg-saved.cfg
  133. echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>
  134. <openbox_menu>
  135. <menu id=\"root-menu\" label=\"OpenBox 3\">
  136. <item label=\"Run Program\">
  137. <action name=\"Execute\">
  138. <execute>
  139. gmrun
  140. </execute>
  141. </action>
  142. </item>
  143. <separator/>
  144. <menu id=\"2\" label=\"Accessories\">
  145. <item label=\"Text Editor\">
  146. <action name=\"Execute\">
  147. <execute>
  148. leafpad
  149. </execute>
  150. </action>
  151. </item>
  152. <item label=\"Terminal\">
  153. <action name=\"Execute\">
  154. <execute>
  155. terminator
  156. </execute>
  157. </action>
  158. </item>
  159. <item label=\"File Manager\">
  160. <action name=\"Execute\">
  161. <execute>
  162. thunar
  163. </execute>
  164. </action>
  165. </item>
  166. <item label=\"Archive Manager\">
  167. <action name=\"Execute\">
  168. <execute>
  169. squeeze
  170. </execute>
  171. </action>
  172. </item>
  173. </menu>
  174. <menu id=\"5\" label=\"Internet\">
  175. <item label=\"Firefox\">
  176. <action name=\"Execute\">
  177. <execute>
  178. firefox
  179. </execute>
  180. </action>
  181. </item>
  182. <item label=\"Pidgin Internet Messenger\">
  183. <action name=\"Execute\">
  184. <execute>
  185. pidgin
  186. </execute>
  187. </action>
  188. </item>
  189. <item label=\"Deluge\">
  190. <action name=\"Execute\">
  191. <execute>
  192. deluge
  193. </execute>
  194. </action>
  195. </item>
  196. </menu>
  197. <menu id=\"7\" label=\"Multimedia\">
  198. <item label=\"Banshee Media Player\">
  199. <action name=\"Execute\">
  200. <execute>
  201. banshee-1
  202. </execute>
  203. </action>
  204. </item>
  205. <item label=\"VLC media player\">
  206. <action name=\"Execute\">
  207. <execute>
  208. vlc
  209. </execute>
  210. </action>
  211. </item>
  212. </menu>
  213. <menu id=\"6\" label=\"Graphics\">
  214. <item label=\"Gimp Image Editor\">
  215. <action name=\"Execute\">
  216. <execute>
  217. gimp
  218. </execute>
  219. </action>
  220. </item>
  221. <item label=\"Ristretto Image Viewer\">
  222. <action name=\"Execute\">
  223. <execute>
  224. ristretto
  225. </execute>
  226. </action>
  227. </item>
  228. </menu>
  229. <menu id=\"37\" label=\"System\">
  230. <item label=\"Openbox Configuration Manager\">
  231. <action name=\"Execute\">
  232. <execute>
  233. obconf
  234. </execute>
  235. </action>
  236. </item>
  237. <item label=\"Openbox Menu Editor\">
  238. <action name=\"Execute\">
  239. <execute>
  240. obmenu
  241. </execute>
  242. </action>
  243. </item>
  244. <item label=\"Change Wallpaper\">
  245. <action name=\"Execute\">
  246. <execute>
  247. nitrogen
  248. </execute>
  249. </action>
  250. </item>
  251. <item label=\"Adjust Screen Resolution\">
  252. <action name=\"Execute\">
  253. <execute>
  254. lxrandr
  255. </execute>
  256. </action>
  257. </item>
  258. <item label=\"Terminal\">
  259. <action name=\"Execute\">
  260. <execute>
  261. terminator
  262. </execute>
  263. </action>
  264. </item>
  265. <separator/>
  266. <item label=\"Reconfigure Openbox\">
  267. <action name=\"Reconfigure\"/>
  268. </item>
  269. <item label=\"Reboot\">
  270. <action name=\"Execute\">
  271. <execute>
  272. gksu reboot
  273. </execute>
  274. </action>
  275. </item>
  276. <item label=\"Shutdown\">
  277. <action name=\"Execute\">
  278. <execute>
  279. gksu halt
  280. </execute>
  281. </action>
  282. </item>
  283. <item label=\"Exit\">
  284. <action name=\"Exit\"/>
  285. </item>
  286. </menu>
  287. </menu>
  288. </openbox_menu>" >> /home/$USERNAME/.config/openbox/menu.xml
  289. chown $USERNAME /home/$USERNAME/.config/openbox/menu.xml
  290. sed -i 's/<chainQuitKey>C-g<\/chainQuitKey>/<chainQuitKey>C-g<\/chainQuitKey><keybind key="A-F2"><action name="execute"><execute>gmrun<\/execute><\/action><\/keybind>/g' /home/$USERNAME/.config/openbox/rc.xml
  291.  
  292. #we're all done!
  293. clear
  294. echo "Your arch system is done."
  295. echo ""
  296. echo "Rebooting in 10 seconds."
  297. sleep 10
  298. reboot
Advertisement
Add Comment
Please, Sign In to add comment