Skip to content

Instantly share code, notes, and snippets.

@kmpm
Created December 20, 2011 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmpm/1501928 to your computer and use it in GitHub Desktop.
Save kmpm/1501928 to your computer and use it in GitHub Desktop.
#!/bin/bash
#### wget -qO- http://goo.gl/kmNvU | sh
sudo aptitude install -y git
git clone git://gist.github.com/1501928.git gist-1501928
cd gist-1501928
git pull origin master
chmod +x *.sh
echo "Run a installation script"
./openbox-panel-setup.sh
#!/bin/bash
. panel-common.sh
sudo apt-get install aptitude git
sudo aptitude install acpid dbus-x11
sudo aptitude install xorg openssh-server
sudo chmod +s /sbin/reboot
installChrome
installTTY
installPenmount
if [ ! -f $HOME/.xsession ]; then
echo google-chrome http://localhost:3000 >>$HOME/.xsession
fi
#!/bin/bash
. panel-common.sh
sudo aptitude update
sudo aptitude safe-upgrade -y
addApt openbox openbox-xdgmenu plymouth-theme-ubuntu-logo
addApt gnome-settings-daemon gsettings-desktop-schemas jockey-gtk
addApt onboard
installApt
sudo chmod +s /sbin/reboot
installChrome
installTTY
installPenmount
if [ ! -f $HOME/start.html ]; then
cat > $HOME/start.html << ENDL
<html>
<head>
<meta HTTP-EQUIV="REFRESH" content="3; url=http://localhost:3000">
</head>
<body>
<h1>V&auml;nta...</h1>
<p>Forts&auml;tter automatiskt om n&aring;gra sekunder</p>
</body>
</html>
ENDL
fi
if [ ! -f $HOME/.config/openbox/autostart.sh ]; then
mkdir -p $HOME/.config/openbox
cat > $HOME/.config/openbox/autostart.sh << ENDL
CONFIG_DIR=google-chrome
xset s blank
xset s 0 0
xset -dpms
gnome-settings-daemon &
onboard &
cat ~/.config/$CONFIG_DIR/Local\ State | perl -pe "s/\"bottom.*/\"bottom\": $(xrandr | grep \* | cut -d' ' -f4 | cut -d'x' -f2),/" > ~/.config/$CONFIG_DIR/Local\ State
cat ~/.config/$CONFIG_DIR/Local\ State | perl -pe "s/\"right.*/\"right\": $(xrandr | grep \* | cut -d' ' -f4 | cut -d'x' -f1),/" > ~/.config/$CONFIG_DIR/Local\ State
while true; do
google-chrome %u --start-maximized $HOME/start.html
sleep 5s
done
ENDL
fi
echo Done setting up with Openbox
#!/bin/bash
PKG_STRING="acpid dbus-x11 xorg openssh-server"
function addApt {
while [ $# -ne 0 ]; do
PKG_STRING="$PKG_STRING $1"
shift
done
}
function installApt {
sudo aptitude install -y $PKG_STRING
}
function installPenmount {
if [ ! -f /usr/lib/xorg/modules/input/penmount_drv.so ]; then
url="http://dl.dropbox.com/u/22581999/panel/pmlinux.tar.bz2"
wget $url
tar jxf pmlinux.tar.bz2
cd pmlinux
./install.sh
cd ..
fi
}
function installChrome {
if [ ! -f /usr/bin/google-chrome ]; then
wget http://dl.google.com/linux/direct/google-chrome-unstable_current_i386.deb
sudo dpkg -i --force-all google-chrome-unstable_current_i386.deb
sudo apt-get install -f -y
fi
}
function installTTY {
sudo aptitude install mingetty
if grep -Fq "tty1" $HOME/.bashrc
then
echo "bashrc is fixed"
else
cat >> $HOME/.bashrc << ENDL
#start x when tty1 autologin
if [ \$(tty) == "/dev/tty1" ]; then
startx
#comment the following line to to stop reboot after X exits
reboot
fi
ENDL
fi
#sudo nano /etc/init/tty1.conf
#replace the existing 'exec /sbin/getty -8 38400 tty1' line with this
#exec /sbin/mingetty --autologin replacewithyourusername tty1
sudo sh -c "sed -ie 's/\/sbin\/getty -8 38400 tty1/\/sbin\/mingetty --autologin brurm tty1/g' /etc/init/tty1.conf"
}
#!/bin/bash
sudo apt-get install aptitude git
sudo aptitude install xorg openbox openbox-xgdmenu mingetty openssh-server
sudo aptitude install plymouth-theme-ubuntu-logo
sudo aptitude install onboard acpid dbus-x11 network-manager lxpanel
sudo aptitude install gnome-settings-daemon gsettings-desktop-schemas jockey-gtk
sudo chmod +s /sbin/reboot
if [ ! -f /usr/bin/google-chrome ]; then
wget http://dl.google.com/linux/direct/google-chrome-unstable_current_i386.deb
sudo dpkg -i --force-all google-chrome-unstable_current_i386.deb
sudo apt-get install -f -y
fi
if [ ! -f $HOME/.config/openbox/autostart.sh ]; then
mkdir -p $HOME/.config/openbox
cat > $HOME/.config/openbox/autostart.sh << ENDL
gnome-settings-daemon &
onboard &
google-chrome --kiosk http://localhost:3000 &
ENDL
fi
if grep -Fq "tty1" $HOME/.bashrc
then
echo "bashrc is fixed"
else
cat >> $HOME/.bashrc << ENDL
#starts X when mingetty logs tty1 in
if [ \$(tty) == "/dev/tty1" ]; then
startx
# /sbin/halt
fi
ENDL
fi
#sudo nano /etc/init/tty1.conf
#replace the existing 'exec /sbin/getty -8 38400 tty1' line with this
#exec /sbin/mingetty --autologin replacewithyourusername tty1
sudo sh -c "sed -ie 's/\/sbin\/getty -8 38400 tty1/\/sbin\/mingetty --autologin brurm tty1/g' /etc/init/tty1.conf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment