#!/usr/bin/env bash # # Basic desktop provision example # # Copyright (C) 2017 Silvio Rhatto - rhatto at riseup.net # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published # by the Free Software Foundation, either version 3 of the License, # or any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Parameters DIRNAME="`dirname $0`" BASENAME="`basename $0`" HOSTNAME="$1" DOMAIN="$2" MIRROR="$3" APT_INSTALL="sudo LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y" # Set hostname echo "$HOSTNAME.$DOMAIN" | sudo tee /etc/hostname > /dev/null sudo hostname $HOSTNAME.$DOMAIN # Set hosts entry if ! grep -q "^127.0.0.1 $HOSTNAME.$DOMAIN $HOSTNAME$" /etc/hosts; then echo "127.0.0.1 $HOSTNAME.$DOMAIN $HOSTNAME" | sudo tee -a /etc/hosts > /dev/null fi # Configure keyboard cat <<-EOF | sudo tee /etc/default/keyboard > /dev/null # KEYBOARD CONFIGURATION FILE # Consult the keyboard(5) manual page. XKBMODEL="abnt2" XKBLAYOUT="br" XKBVARIANT="thinkpad" XKBOPTIONS="compose:ralt,terminate:ctrl_alt_bksp" BACKSPACE="guess" EOF # Dependencies sudo sed -i -e "s|main$|main contrib non-free|g" /etc/apt/sources.list sudo apt-get update $APT_INSTALL git # Tools if [ ! -e "$apps" ]; then git clone --recursive https://git.fluxo.info/rhatto/apps else ( cd apps && git pull && git submodule update --init ) fi apps/inception init apps/inception load # Environment $APT_INSTALL lightdm ratpoison awesome firefox-esr chromium torbrowser-launcher # Configuration sudo cp $DIRNAME/files/desktop-basic/etc/lightdm/lightdm.conf /etc/lightdm/lightdm.conf mkdir -p .custom cat <<-EOF | tee .custom/xsession > /dev/null # # Custom X11 session config # WINDOW_MANAGER="ratpoison" PROGRAMS="$PROGRAMS terminal" # # Set screen size # # On stretch onwards Virtual-0 was renamed to Virtual-0 # Modeline determined by running "cvt 1280 780" xrandr --newmode "1280x780_60.00" 81.50 1280 1352 1480 1680 780 783 793 810 -hsync +vsync xrandr --addmode Virtual-0 1280x780_60.00 # Modeline determined by running "cvt 1368 748" xrandr --newmode "1368x748_60.00" 83.00 1368 1440 1576 1784 748 751 761 777 -hsync +vsync xrandr --addmode Virtual-0 1368x748_60.00 # Set default modeline #xrandr --output Virtual-0 --mode 1368x748_60.00 xrandr --output Virtual-0 --mode 1280x780_60.00 EOF # Mozilla configuration if [ ! -d ".mozilla" ]; then tar xvf $DIRNAME/files/desktop-basic/mozilla/mozilla.tar.bz2 fi