Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge branch imprecise #26

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 57 additions & 101 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

### Simple minded install script for
### FreeGeek Chicago by David Eads
Expand All @@ -10,7 +10,6 @@
. /etc/lsb-release

### Get the integer part of $DISTRIB_RELEASE. Bash/test can't handle floating-point numbers.
#DISTRIB_MAJOR_RELEASE=$(echo "scale=0; $DISTRIB_RELEASE/1" | bc) # but bc can, using redirections!


echo "################################"
Expand Down Expand Up @@ -38,7 +37,8 @@ ask() {
fi

# Ask the question
read -p "$1 [$prompt] " REPLY
echo -n "$1 [$prompt] "
read REPLY

# Default?
if [ -z "$REPLY" ]; then
Expand Down Expand Up @@ -69,29 +69,6 @@ else
sed -i 's/deb-src /#deb-src# /' /etc/apt/sources.list
fi

### METHOD 1? Add distrib-updates universe multiverse
#
# Figure out if this part of the script has been run already
#grep "${DISTRIB_CODENAME}-updates universe" /etc/apt/sources.list
#if (($? == 1)); then
# echo "* Adding ${DISTRIB_CODENAME} updates line for universe and multiverse"
# cp /etc/apt/sources.list /etc/apt/sources.list.backup
# echo "deb http://us.archive.ubuntu.com/ubuntu/ ${DISTRIB_CODENAME}-updates universe multiverse" >> /etc/apt/sources.list
#else
# echo "# Already added universe and multiverse ${DISTRIB_CODENAME}-updates line to sources,"
#fi

### METHOD 2? Add distrib-updates universe multiverse
#
# Figure out if this part of the script has been run already
#if grep -q "${DISTRIB_CODENAME}-updates universe" /etc/apt/sources.list; then
# echo "# Already added universe and multiverse ${DISTRIB_CODENAME}-updates line to sources,"
#else
# echo "* Adding ${DISTRIB_CODENAME} updates line for universe and multiverse"
# cp /etc/apt/sources.list /etc/apt/sources.list.backup
# echo "deb http://us.archive.ubuntu.com/ubuntu/ ${DISTRIB_CODENAME}-updates universe multiverse" >> /etc/apt/sources.list
#fi

### Disable and Remove Any Medibuntu Repos
#

Expand Down Expand Up @@ -136,79 +113,63 @@ fi
# We use dist-upgrade to ensure up-to-date kernels are installed
apt-get -y update && apt-get -y dist-upgrade

# Make sure we're using
if [ $(lsb_release -rs) != '14.04']; then
echo "Sorry, only Ubuntu 14.04 is supported."
exit 1
fi

# Each package should have it's own apt-get line.
# If a package is not found or broken, the whole apt-get line is terminated.


###################################
### Packages for Trusty (14.04) ###
###################################

# Add Pepper Flash Player support for Chromium
# Note that this temporarily downloads Chrome, and the plugin uses plugin APIs not provided in Firefox
if [ $(lsb_release -rs) = '14.04' ]; then
echo "* Customizing Trusty packages"
apt-get -y install pepperflashplugin-nonfree &&
update-pepperflashplugin-nonfree --install
apt-get -y install fonts-mgopen

# Kubuntu 14.04 Specific Packages
if [ $(dpkg-query -W -f='${Status}' kubuntu-desktop 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
echo "* Customizing Trusty-Kubuntu packages."
apt-get -y install software-center
apt-get -y install kdewallpapers
apt-get -y install kubuntu-restricted-extras
apt-get -y autoremove muon muon-updater muon-discover
fi

# Xubuntu 14.04 Specific Packages
if [ $(dpkg-query -W -f='${Status}' xubuntu-desktop 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
echo "* Customizing Trusty-Xubuntu packages."
apt-get -y install xubuntu-restricted-extras
apt-get -y remove gnumeric* abiword*
echo "* Customizing Trusty-Xubuntu settings."
apt-get -y install xmlstarlet
# Make a system-wide fix so that Audio CDs autoload correctly.
xmlstarlet ed -L -u '/channel/property[@name="autoplay-audio-cds"]/property[@name="command"]/@value' -v '/usr/bin/vlc cdda://' /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/thunar-volman.xml
### And now do it for the current user.
xfconf-query -c thunar-volman -p /autoplay-audio-cds/command -s "/usr/bin/vlc cdda://"

# Make a system-wide fix so that Audio CDs autoload correctly.
xmlstarlet ed -L -u '/channel/property[@name="autoplay-video-cds"]/property[@name="command"]/@value' -v '/usr/bin/vlc dvd://' /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/thunar-volman.xml
### And now do it for the current user.
xfconf-query -c thunar-volman -p /autoplay-video-cds/command -s "/usr/bin/vlc dvd://"

# Make a system-wide fix so that Mac eject key (X86Eject) is mapped to eject (eject -r) function.
xmlstarlet ed -L -s '/channel/property[@name="commands"]/property[@name="default"]' -t elem -n propertyTMP -v "" \
-i //propertyTMP -t attr -n "name" -v "X86Eject" \
-i //propertyTMP -t attr -n "type" -v "string" \
-i //propertyTMP -t attr -n "value" -v "eject" \
-r //propertyTMP -v property \
/etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
### And now do it for the current user.
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/default/XF86Eject -n -t string -s "eject"
fi
echo "* Customizing Trusty packages"
apt-get -y install pepperflashplugin-nonfree &&
update-pepperflashplugin-nonfree --install
apt-get -y install fonts-mgopen

# Kubuntu 14.04 Specific Packages
if [ $(dpkg-query -W -f='${Status}' kubuntu-desktop 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
echo "* Customizing Trusty-Kubuntu packages."
apt-get -y install software-center
apt-get -y install kdewallpapers
apt-get -y install kubuntu-restricted-extras
apt-get -y autoremove muon muon-updater muon-discover
fi

###
### Packages for Precise (12.04) ###
####################################

if [ $(lsb_release -rs) = '12.04' ]; then
echo "* Customizing Precise packages."
apt-get -y install ttf-mgopen

# Xubuntu 12.04 Specific Packages
if [ $(dpkg-query -W -f='${Status}' xubuntu-desktop 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
echo "* Customizing Precise-Xubuntu packages."
apt-get -y install xubuntu-restricted-extras
apt-get -y remove gnumeric* abiword*
fi
# Xubuntu 14.04 Specific Packages
if [ $(dpkg-query -W -f='${Status}' xubuntu-desktop 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
echo "* Customizing Trusty-Xubuntu packages."
apt-get -y install xubuntu-restricted-extras
apt-get -y remove gnumeric* abiword*
echo "* Customizing Trusty-Xubuntu settings."
apt-get -y install xmlstarlet
# Make a system-wide fix so that Audio CDs autoload correctly.
xmlstarlet ed -L -u '/channel/property[@name="autoplay-audio-cds"]/property[@name="command"]/@value' -v '/usr/bin/vlc cdda://' /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/thunar-volman.xml
### And now do it for the current user.
xfconf-query -c thunar-volman -p /autoplay-audio-cds/command -s "/usr/bin/vlc cdda://"

# Make a system-wide fix so that Audio CDs autoload correctly.
xmlstarlet ed -L -u '/channel/property[@name="autoplay-video-cds"]/property[@name="command"]/@value' -v '/usr/bin/vlc dvd://' /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/thunar-volman.xml
### And now do it for the current user.
xfconf-query -c thunar-volman -p /autoplay-video-cds/command -s "/usr/bin/vlc dvd://"

# Make a system-wide fix so that Mac eject key (X86Eject) is mapped to eject (eject -r) function.
xmlstarlet ed -L -s '/channel/property[@name="commands"]/property[@name="default"]' -t elem -n propertyTMP -v "" \
-i //propertyTMP -t attr -n "name" -v "X86Eject" \
-i //propertyTMP -t attr -n "type" -v "string" \
-i //propertyTMP -t attr -n "value" -v "eject" \
-r //propertyTMP -v property \
/etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
### And now do it for the current user.
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/default/XF86Eject -n -t string -s "eject"
fi


###############
### Packages for All Releases
###############
# Make sure an office suite is installed
apt-get -y install libreoffice

Expand Down Expand Up @@ -242,6 +203,9 @@ apt-get -y install language-pack-gnome-es
# Install nonfree firmware for Broadcom wireless cards and TV capture cards
apt-get -y install linux-firmware-nonfree firmware-b43-installer b43-fwcutter

# Install libc6:i386 to fix dependency problems for nyancat:i386
apt-get -y install libc6:i386

###################################
# Check for Apple as Manufacturer #
###################################
Expand All @@ -266,24 +230,16 @@ if [ "$MANUFACTURER" = "Apple Inc." ]; then
fi

#################################
# Install and Run sl or nyancat #
# Install and Run nyancat #
#################################
# Ensure installation completed without errors

apt-get -y install sl
wget -qO /usr/local/bin/nyancat "https://raw.githubusercontent.com/freegeekchicago/fgc-installscript/master/nyancat"
chmod 755 /usr/local/bin/nyancat
if [ -e "/usr/local/bin/nyancat" ] && [ -x "/usr/local/bin/nyancat" ]; then
# Install the latest nyancat from the utopic (14.10) mirror
URL='http://archive.ubuntu.com/ubuntu/pool/universe/n/nyancat/nyancat_1.4.4-1_i386.deb'; FILE=`mktemp`; wget "$URL" -qO $FILE && sudo dpkg -i $FILE; rm $FILE
if [ -e "/usr/bin/nyancat" ]; then
echo "Installation complete -- relax, and watch this NYAN CAT"; sleep 2
/usr/local/bin/nyancat -nsf 37
else
# Using bc instead of test lets us use floating point numbers
if (( $(bc <<< "$DISTRIB_RELEASE > 10.04") == 1 )); then
echo "Installation complete -- relax, and watch this STEAM LOCOMOTIVE"; sleep 2
/usr/games/sl
else
sl
fi
# -n: no counter, -s: no titlebar text, -f: run for 34 frames (~3 seconds)
nyancat -nsf 34
fi

##################
Expand Down
3 changes: 1 addition & 2 deletions install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ wget -qO /usr/local/bin/install.sh https://raw.github.com/freegeekchicago/fgc-in

# Run install.sh for updates
echo "## Running install.sh, BYE!"
# Use bash to fix incompatibilities
bash /usr/local/bin/install.sh
sh /usr/local/bin/install.sh

#EOF
Binary file removed nyancat
Binary file not shown.