Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #this will make it so the screen doesn't go blank to prevent people from pressing enter to wake it up
- setterm -blank 0
- #this will start the script and ask the user if he wants to run it
- clear
- echo "Welcome to my arch setup script. This script will semi-automatically"
- echo "set up a working openbox system. You will be asked several questions"
- echo "throughout the script so pay attention."
- echo ""
- echo "Warning: Once the process is started you cannot back out without risk of"
- echo "damaging your system."
- echo ""
- read -p "Continue? (Y/N): ";
- if [ $REPLY == "y" ]; then
- clear;
- elif [ $REPLY == "Y" ]; then
- clear;
- else
- exit;
- fi
- #this will create a user account
- echo "What do you want your username to be?"
- echo ""
- read -p "> "
- USERNAME=$REPLY
- useradd -m -G users,audio,lp,optical,storage,video,wheel,power -s /bin/bash $USERNAME
- clear
- echo "What do you want your password to be?"
- passwd $USERNAME
- clear
- echo "We wil now update the system..."
- sleep 3
- #this will update pacman
- pacman -Syu --noconfirm
- #this will update everything else
- pacman -Syu --noconfirm
- #now we will set up sound
- clear
- echo "options snd-pcsp index=2" >> /etc/modprobe.d/modprobe.conf
- pacman -S alsa-utils alsa-oss --noconfirm
- clear
- echo "You will now adjust the volume to your liking with alsamixer."
- echo "You can control alsamixer with your arrow keys, and M for mute/unmute."
- echo "When you are finished adjusting the volume, press ESC."
- echo ""
- echo "Press enter when you are ready."
- echo ""
- read -p "> "
- if [ $REPLY == "" ]; then
- clear;
- else
- clear;
- fi
- su $USERNAME -c alsamixer
- alsactl store
- clear
- #we will now setup Xorg and stuff
- echo "Please wait..."
- pacman -S xorg xf86-video-vesa xf86-input-keyboard xf86-input-mouse --noconfirm
- clear
- echo "We are now going to configure xorg."
- echo ""
- echo "Do not be alarmed if your screen flickers or something."
- echo ""
- echo "It will automatically start in 10 seconds."
- sleep 10
- clear
- Xorg -configure
- cp /root/xorg.conf.new /etc/X11/xorg.conf
- clear
- #now to setup input hotplugging
- echo "Setting up input hotplugging..."
- sleep 3
- pacman -S hal dbus xf86-input-evdev fam --noconfirm
- /etc/rc.d/hal start
- /etc/rc.d/fam start
- clear
- #installing openbox
- echo "Installing openbox..."
- sleep 3
- pacman -S openbox obconf obmenu --noconfirm
- echo "exec ck-launch-session dbus-launch --exit-with-session openbox-session" >> /home/$USERNAME/.xinitrc
- chown $USERNAME /home/$USERNAME/.xinitrc
- mkdir -p /home/$USERNAME/.config/openbox/
- cp /etc/xdg/openbox/rc.xml /home/$USERNAME/.config/openbox/
- cp /etc/xdg/openbox/autostart.sh /home/$USERNAME/.config/openbox/
- chown $USERNAME /home/$USERNAME/.config/
- chown $USERNAME /home/$USERNAME/.config/openbox/
- chown $USERNAME /home/$USERNAME/.config/openbox/autostart.sh
- chown $USERNAME /home/$USERNAME/.config/openbox/rc.xml
- clear
- #installing login manager
- echo "Installing login manager..."
- sleep 3
- pacman -S slim archlinux-themes-slim --noconfirm
- sed -i 's/current_theme default/current_theme archlinux-darch-grey/g' /etc/slim.conf
- #adding daemons
- sed -i '/DAEMONS/ d' /etc/rc.conf
- echo "DAEMONS=(syslog-ng network crond alsa hal fam slim)" >> /etc/rc.conf
- clear
- #setting up various apps and other things to make things nicer and more friendly
- echo "Now installing stuff to make system nicer..."
- sleep 3
- 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
- echo "gtk-icon-theme-name=\"Tango\"" >> /home/$USERNAME/.gtkrc-2.0
- chown $USERNAME /home/$USERNAME/.gtkrc-2.0
- echo "$USERNAME ALL=(ALL) ALL" >> /etc/sudoers
- echo "thunar --daemon &" >> /home/$USERNAME/.config/openbox/autostart.sh
- echo "nitrogen --restore &" >> /home/$USERNAME/.config/openbox/autostart.sh
- echo "tint2 &" >> /home/$USERNAME/.config/openbox/autostart.sh
- echo "volwheel &" >> /home/$USERNAME/.config/openbox/autostart.sh
- mkdir /home/$USERNAME/.config/nitrogen/
- chown $USERNAME /home/$USERNAME/.config/nitrogen/
- echo "
- [:0.0]
- file=/usr/share/archlinux/wallpaper/archlinux-simplyblack.png
- mode=4
- bgcolor=# 0 0 0" >> /home/$USERNAME/.config/nitrogen/bg-saved.cfg
- chown $USERNAME /home/$USERNAME/.config/nitrogen/bg-saved.cfg
- echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>
- <openbox_menu>
- <menu id=\"root-menu\" label=\"OpenBox 3\">
- <item label=\"Run Program\">
- <action name=\"Execute\">
- <execute>
- gmrun
- </execute>
- </action>
- </item>
- <separator/>
- <menu id=\"2\" label=\"Accessories\">
- <item label=\"Text Editor\">
- <action name=\"Execute\">
- <execute>
- leafpad
- </execute>
- </action>
- </item>
- <item label=\"Terminal\">
- <action name=\"Execute\">
- <execute>
- terminator
- </execute>
- </action>
- </item>
- <item label=\"File Manager\">
- <action name=\"Execute\">
- <execute>
- thunar
- </execute>
- </action>
- </item>
- <item label=\"Archive Manager\">
- <action name=\"Execute\">
- <execute>
- squeeze
- </execute>
- </action>
- </item>
- </menu>
- <menu id=\"5\" label=\"Internet\">
- <item label=\"Firefox\">
- <action name=\"Execute\">
- <execute>
- firefox
- </execute>
- </action>
- </item>
- <item label=\"Pidgin Internet Messenger\">
- <action name=\"Execute\">
- <execute>
- pidgin
- </execute>
- </action>
- </item>
- <item label=\"Deluge\">
- <action name=\"Execute\">
- <execute>
- deluge
- </execute>
- </action>
- </item>
- </menu>
- <menu id=\"7\" label=\"Multimedia\">
- <item label=\"Banshee Media Player\">
- <action name=\"Execute\">
- <execute>
- banshee-1
- </execute>
- </action>
- </item>
- <item label=\"VLC media player\">
- <action name=\"Execute\">
- <execute>
- vlc
- </execute>
- </action>
- </item>
- </menu>
- <menu id=\"6\" label=\"Graphics\">
- <item label=\"Gimp Image Editor\">
- <action name=\"Execute\">
- <execute>
- gimp
- </execute>
- </action>
- </item>
- <item label=\"Ristretto Image Viewer\">
- <action name=\"Execute\">
- <execute>
- ristretto
- </execute>
- </action>
- </item>
- </menu>
- <menu id=\"37\" label=\"System\">
- <item label=\"Openbox Configuration Manager\">
- <action name=\"Execute\">
- <execute>
- obconf
- </execute>
- </action>
- </item>
- <item label=\"Openbox Menu Editor\">
- <action name=\"Execute\">
- <execute>
- obmenu
- </execute>
- </action>
- </item>
- <item label=\"Change Wallpaper\">
- <action name=\"Execute\">
- <execute>
- nitrogen
- </execute>
- </action>
- </item>
- <item label=\"Adjust Screen Resolution\">
- <action name=\"Execute\">
- <execute>
- lxrandr
- </execute>
- </action>
- </item>
- <item label=\"Terminal\">
- <action name=\"Execute\">
- <execute>
- terminator
- </execute>
- </action>
- </item>
- <separator/>
- <item label=\"Reconfigure Openbox\">
- <action name=\"Reconfigure\"/>
- </item>
- <item label=\"Reboot\">
- <action name=\"Execute\">
- <execute>
- gksu reboot
- </execute>
- </action>
- </item>
- <item label=\"Shutdown\">
- <action name=\"Execute\">
- <execute>
- gksu halt
- </execute>
- </action>
- </item>
- <item label=\"Exit\">
- <action name=\"Exit\"/>
- </item>
- </menu>
- </menu>
- </openbox_menu>" >> /home/$USERNAME/.config/openbox/menu.xml
- chown $USERNAME /home/$USERNAME/.config/openbox/menu.xml
- 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
- #we're all done!
- clear
- echo "Your arch system is done."
- echo ""
- echo "Rebooting in 10 seconds."
- sleep 10
- reboot
Advertisement
Add Comment
Please, Sign In to add comment