lnf -T /i/k/mboxes ~/mail
fi
-### begin setup for keyboard and redshift ###
-case $(distro-name) in
- trisquel|ubuntu|debian)
- if has_x; then
+
+
+
+##### install xinput
+if has_x; then
+ case $(distro-name) in
+ trisquel|ubuntu|debian)
pi xinput
+ ;;
+ fedora)
+ pi xinput_calibrator
+ ;;
+ arch)
+ pi xorg-xinput
+ ;;
+ esac
+
+ #### install redshift
+ case $(distro-name) in
+ trisquel|ubuntu|debian)
# recommends gets us geoclue (for darkening automatically at night i assume),
# which recommends modemmanager, which is annoying to fix for the model01 keyboard.
pi --no-install-recommends gtk-redshift
- fi
- ;;&
- fedora)
- p -y groupinstall development-tools c-development books admin-tools
- pi wget man-pages
- if has_x; then
+ ;;&
+ fedora)
pi redshift-gtk
- fi
- ;;&
+ ;;&
+ arch)
+ pi redshift
+ ;;&
+ esac
+fi
+
+
+#### arch specific early packages
+case $(distro-name) in
arch)
- # like apt-cache
+ # pkgfile is like apt-cache
pi pkgfile
s pkgfile --update
- if has_x; then
- pi xorg-server redshift xorg-xinput
- fi
- ;;&
+ ;;
esac
-### end setup for keyboard and redshift ###
-# enables trim for volume delete, other rare commands.
-sudo $sed -ri 's/( *issue_discards\b).*/\1 = 1/' /etc/lvm/lvm.conf
+#### fedora specific packages
+case $(distro-name) in
+ fedora)
+ # todo, this could probably come later
+ p -y groupinstall development-tools c-development books admin-tools
+ pi man-pages
+ ;;
+ # other distros unknown
+esac
+#### enable trim
+# enable trim for volume delete, other rare commands
+sudo $sed -ri 's/( *issue_discards\b).*/\1 = 1/' /etc/lvm/lvm.conf
if encrypted; then
if isdeb; then
sudo cp /usr/share/doc/util-linux/examples/fstrim.{service,timer} /etc/systemd/system
sudo systemctl enable fstrim.timer
fi
+##### make extra dirs
dirs=(/mnt/{1,2,3,4,5,6,7,8,9} /nocow/t)
s mkdir -p "${dirs[@]}"
s chown $USER:$USER "${dirs[@]}"
-
+###### setup /i
tu /etc/fstab <<'EOF'
/i/w /w none bind,noauto 0 0
/i/k /k none bind,noauto 0 0
EOF
-
-
if ! mountpoint /kr; then
s mkdir -p /kr
s chown $USER:traci /kr
fi
-
if home_network; then
if [[ $HOSTNAME == frodo ]]; then
tu /etc/fstab <<'EOF'
EOF
fi
fi
-
s mkdir -p /q /i/{w,k}
for dir in /{i,w,k}; do
if mountpoint $dir; then continue; fi # already mounted
s mkdir -p $dir
s chown $USER:$USER $dir
done
-
# not needed for all hosts, but rather just keep it uniform
s mkdir -p /mnt/iroot
-
# debian auto mounting of multi-disk encrypted btrfs is busted. It is
# in jessie, and in stretch as of 11/26/2016 I have 4 disks in cryptab,
# based on 3 of those, it creates .device units for /dev/mapper/dev...
sudo systemctl start imount.service
fi
+##### setup /nocow.
+# a nocow dir that is common to multiple distros installed onthe same system
dir=/nocow
if has_btrfs; then
if ! mountpoint $dir; then
sudo mkdir -p $dir
fi
-# ssh and probably some other things care about parent directory
-# ownership, and ssh doesn\'t allow any group writable parent
-# directories, so we are forced to use a directory structure similar
-# to home directories
-s chown root:$USER /q
-s chmod 755 /q
-
+###### fix mouse on jessie
# it comes with stretch and arch, but not jessie.
# propogate /etc/udev/hwdb.d
if which systemd-hwdb; then
fi
+##### setup email
if isdeb; then
- # I\'ve had problems with postfix on debian:
- # on stretch, a startup ordering issue caused all mail to fail.
- # postfix changed defaults to only use ipv6 dns, causing all my mail to fail.
- # exim4 is default on debian, so I assume it would
- # be packaged better to avoid these types of things.
- # I haven\'t gotten around to getting a non-debian exim
- # setup.
mail-setup exim4
else
+ # todo: probably broken
mail-setup postfix
fi
+#### ubuntu nicety
if isubuntu; then
# disable crash report annoying dialogs.
s dd of=/etc/default/apport <<<'enabled=0'
fi
+###### setup time zone
# fai sets this an old way that doesn't work for stretch.
# no harm in setting it universally here.
# using debconf-set-selection, the area gets reset to ETC
EOF
+##### install emacs
if has_x; then
if isarch; then
- # install so it's build dependencies don't get removed.
-
- # emacs git build is currently broken
- if false; then
- x=$(mktemp -d)
- pushd $x
- aurex emacs-git
- makepkg -si --noconfirm
- popd
- rm -rf $x
- else
- pi emacs
- fi
+ # emacs git build was broken last time i checked,
+ x=$(mktemp -d)
+ pushd $x
+ aurex emacs-git
+ makepkg -si --noconfirm
+ popd
+ rm -rf $x
pi hunspell hunspell-en
else
if $recompile; then
/a/bin/buildscripts/emacs --no-r || /a/bin/buildscripts/emacs
fi
fi
+fi
- # todo, figure this out for arch if we ever try out gnome.
- if ! isarch; then
- # install for multiple display managers in case we use one
- if isdeb; then
- dir=/etc/gdm3
- elif isfedora; then
- # fedora didn\'t have the 3.
- dir=/etc/gdm
- fi
- s mkdir -p $dir/PostLogin
- s command cp /a/bin/distro-setup/desktop-20-autostart.sh $dir/PostLogin/Default
- s mkdir /etc/lightdm/lightdm.conf.d
- s dd of=/etc/lightdm/lightdm.conf.d/12-iank.conf <<'EOF'
-[SeatDefaults]
-session-setup-script=/a/bin/distro-setup/desktop-20-autostart.sh
-EOF
- fi
+##### install laptop hardware packages
+if tp || x2; then
+ case $distro in
+ debian)
+ pi task-laptop
+ ;;
+ ubuntu|trisquel)
+ # the exact packages that task-laptop would install, since ubuntu
+ # doesn\'t have this virtual in practice package.
+ pi avahi-autoipd bluetooth powertop iw wireless-tools wpasupplicant
+ ;;
+ # todo: other distros unknown
+ esac
+fi
+##### install xmonad
+if has_x; then
pi ${p2[@]}
- # todo, also note for work comp, scp opt/org-mode bin/build-scripts
-
- # use the package manger version to install the cabal version
- cabal update
- PATH="$PATH:$HOME/.cabal/bin"
-
- # todo, on older ubuntu I used cabal xmonad + xfce,
- # see /a/bin/old-unused/xmonad-cabal.sh
-
+ # note: on older ubuntu I used cabal xmonad + xfce, using cabal versin
+ # see /w/archive/programming/xmonad-cabal.sh
if isarch; then
- # for displaying error messages.
+ # xorg-xmessage for displaying error messages.
# optional dependency in arch, standard elsewhere.
- pi xorg-xmessage xmonad-contrib xorg-xsetroot xorg-xinit
+ pi xorg-server xorg-xmessage xmonad-contrib xorg-xsetroot xorg-xinit
+ else
+ pi suckless-tools
+ fi
+fi
+
+##### setup X autostart
+if has_x; then
+ if isarch; then
# https://wiki.archlinux.org/index.php/Xinitrc
for homedir in /home/*; do
cp /etc/X11/xinit/xinitrc $homedir/.xinitrc
exec xmonad
EOF
done
- else
- pi suckless-tools
- fi
- pi dmenu
-
- if tp || x2; then
- case $distro in
- debian)
- pi task-laptop
- ;;
- ubuntu|trisquel)
- # the exact packages that task-laptop would install, since ubuntu
- # doesn\'t have this virtual in practice package.
- pi avahi-autoipd bluetooth powertop iw wireless-tools wpasupplicant
- ;;
- # todo: other distros unknown
- esac
+ else
+ # todo, figure this out for arch if we ever try out gnome.
+ # install for multiple display managers in case we use one
+ if isdeb; then
+ dir=/etc/gdm3
+ elif isfedora; then
+ # fedora didn\'t have the 3.
+ dir=/etc/gdm
+ fi
+ s mkdir -p $dir/PostLogin
+ s command cp /a/bin/distro-setup/desktop-20-autostart.sh $dir/PostLogin/Default
+ s mkdir /etc/lightdm/lightdm.conf.d
+ s dd of=/etc/lightdm/lightdm.conf.d/12-iank.conf <<'EOF'
+[SeatDefaults]
+session-setup-script=/a/bin/distro-setup/desktop-20-autostart.sh
+EOF
fi
fi
+
+#### refix interactive ssh terminal
# the first pup command can kill off our /etc/ mod, so rerun this
/a/exe/ssh-emacs-setup
+
+
echo "$0: $(date): ending now"
exit 0