2 # Copyright (C) 2016 Ian Kelling
3 # This program is under GPL v. 3 or later, see <http://www.gnu.org/licenses/>
5 # todo. dunno why, but original bootstrap of timezone is not sticking.
7 # s dpkg-reconfigure tzdata
11 # for bootstrapping a new machine
13 # to make ssh run better, first run this:
14 sudo bash
-c 'source /a/c/repos/bash/.bashrc && source /a/exe/ssh-emacs-setup'
17 # see t.org for OS installer notes
19 # usage: $0 [OPTIONS] HOSTNAME
22 # run any sudo command first so your pass is cached
23 # set the scrollback to unlimited in case something goes wrong
25 if [[ $EUID == 0 ]]; then
26 if getent passwd ian
; then
27 echo "$0: error: running as root. unprivileged user exists. use it."
30 echo "$0: warning: running as root. I will setup users then exit"
34 interactive
=false
# set this to true if running by hand in emacs
35 [[ $
- == *i
* ]] || interactive
=false
37 if ! $interactive; then
42 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
44 exec &> >(sudo
tee -a /var
/log
/distro-begin
)
45 echo "$0: $(date): starting now)"
47 # headless=false # unused atm
49 # for copying to a new data fs
50 bootstrapfs
=false
# old flag, needs new look before using.
51 while [[ $1 == -* ]]; do
53 # avoid some of the longer compilation steps,
54 # when we need to rerun because we had an error
55 -r) recompile
=true
; shift ;;
63 for f
in iank-dev htpc treetowl x2 frodo tp li lj
; do
64 eval "$f() { [[ $HOSTNAME == $f ]]; }"
66 has_p
() { iank-dev || x2 || frodo || tp
; }
67 has_x
() { ! { lj || li
; }; }
68 encrypted
() { has_p
; }
71 export GLOBIGNORE
=*/.
:*/..
75 ####### end command line parsing
79 # I tried making a service which was dependent on reboot.target,
80 # but it happened too late in the shutdown process.
81 sudo
dd of
=/etc
/systemd
/system
/keyscripton.service
<<'EOF'
83 Description=Turn on automatic decryption of drives on boot
84 # tried using graphical.target, but it made my display manager restart before rebooting.
85 # generally, I don't think targets order shutdown like they do startup.
86 # So, I did systemd-analyze plot > something.svg, and picked a reliably started
87 # service that happens late in the game.
89 DefaultDependencies=no
90 # not sure if needed, makes sure we shut down before reboot.target
91 Conflicts=reboot.target
97 ExecStop=/a/exe/keyscript-on
100 WantedBy=keyscriptoff.service
102 sudo systemctl daemon-reload
# needed if the file was already there
103 sudo systemctl stop keyscripton.service
104 # sudo systemctl start keyscripton.service
105 sudo systemctl
enable keyscripton.service
107 sudo
dd of
=/etc
/systemd
/system
/keyscriptoff.service
<<'EOF'
109 Description=Turn off automatic decryption of drives on boot
113 ExecStart=/a/exe/keyscript-off
116 WantedBy=multi-user.target
118 sudo systemctl daemon-reload
# needed if the file was already there
119 sudo systemctl
enable keyscriptoff.service
120 sudo systemctl start keyscriptoff.service
127 desktop
=$
(ssh root@iankelling.org
grep desktop
/etc
/hosts |
grep -o "^.* ")
128 if $bootstrapfs; then
129 # for bootstrapping at a new job:
131 # for moving to a new hd, change $cp to move between filesystems
133 chown
-R ian
:ian
/a
# probably needs to be removed
135 $cp/a
/c
/bin
/{bash-programs-by-ian
,distro-begin
,distro-functions
,input-setup.sh
} /a
/bin
136 echo -e \\n
\\n
\\n | ssh-keygen
-t rsa
140 # this script has been designed to be idempotent
141 # todo, it would be nice to cut down on some of the output
144 for x
in /a
/bin
/errhandle
/*-function; do
150 $interactive || errcatch
152 source /a
/bin
/distro-functions
/src
/identify-distros
153 $interactive ||
set -x
158 # comment out line disallowing calling sudo in scripts
159 sudo
sed -i --follow-symlinks 's/^Defaults *requiretty/#\0 # ian commented/' /etc
/sudoers
160 # turn on magic sysrq commands for this boot cycle
161 echo 1 > sudo
dd of
=/proc
/sys
/kernel
/sysrq
162 # selinux is not user friendly. Like, you enable samba, but you haven't run the magic selinux commands so it doesn't work
163 # and you have no idea why.
164 sudo
sed -i --follow-symlinks 's/^\(SELINUX=\).*/\1disabled/' /etc
/selinux
/config
165 selinuxenabled
&& sudo setenforce
0
169 # already ran for pxe installs, but used for vps & updates
170 distro
=$
(distro-name
)
173 sudo bash
-c ". /a/bin/fai/fai-wrapper && /a/bin/fai/fai/config/scripts/GRUB_PC/11-ian"
176 sudo bash
-c ". /a/bin/fai/fai-wrapper &&
177 /a/bin/fai/fai/config/distro-install-common/end"
182 if [[ $EUID == 0 ]]; then
183 echo "$0: running as root. exiting now that users are setup"
191 # $2 and opts are unused so far.
193 while [[ $1 == -* ]]; do
197 lnf
${opts[@]} "$1" /home
/ian
/$2
198 sudo
-u traci
-i <<EOF
200 lnf ${opts[@]} "$1" /home/traci/$2
204 for x
in /a
/c
/repos
/bash
/!(.git
); do
218 $interactive || errcatch
219 $interactive ||
set -x
223 tu
/etc
/sudoers
<<'EOF'
224 ian ALL=(ALL) NOPASSWD: ALL
225 Defaults env_keep += SUDOD
229 # enable magic sysrq keys. debian docs say it is already enabled by default
230 isfedora
&& tu
/etc
/sysctl.conf
'kernel.sysrq = 1'
235 codename
=$
(debian-codename
)
236 # non-existent var, as Im not planning to use stable right now
237 if isdebian-stable
; then
239 s
dd of
=/etc
/apt
/sources.list.d
/mozilla-iceweasel.list
<<EOF
240 deb http://mozilla.debian.net/ $codename-backports firefox-release
241 deb-src http://mozilla.debian.net/ $codename-backports firefox-release
245 # we change the mirror from the default, so we cant use tu
246 s
dd of
=/etc
/apt
/sources.list.d
/main-backports.list
<<EOF
247 deb http://http.debian.net/debian $codename-backports main contrib non-free
248 deb-src http://http.debian.net/debian $codename-backports main contrib non-free
252 # take care of mozilla signing errors in previous command
253 pi pkg-mozilla-archive-keyring
257 # this would change stable to testing, but I set that up already.
258 # It\'s just a no-op if its already testing.
259 # sudo sed -ri 's!^( *[^ #]+ +[^ ]+ +)[[:alpha:]]+(.*)!\1testing\2!' /etc/apt/sources.list
265 #https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages
266 sudo pacman
-S --noconfirm --needed base-devel jq
267 # pacaur seems to be the best, although it + cower has a few minor bugs,
268 # its design goals seem good, so, going for it.
275 makepkg
-sri --skippgpcheck --noconfirm
283 x
=$
(mktemp
); /a
/opt
/pacman.conf-insert_pacserve
>$x
284 sudo
dd of
=/etc
/pacman.conf
if=$x; rm $x
285 sudo systemctl
enable pacserve.service
286 sudo systemctl start pacserve.service
288 # strange error if just installing trash-cli: "pyalpm requires python",
289 # so I see that it requires python2, and installing that manually fixes it.
290 # I didn't see this on earlier installation, main thing which changed was
291 # pacserve, so not sure if it's related.
299 ###### link files ###########
300 # convenient to just do all file linking in one place
302 # if it wasn't set already, we could set hostname here
303 #echo treetowl | s dd of=/etc/hostname
304 #s hostname -F /etc/hostname
305 #HOSTNAME=$(hostname)
307 #########################################
308 # NOTE: only /a needs to be mounted for creating links!
309 ###########################################
311 # todo: reconcile ~/.ssh/config work/home
317 lnf
-T /p
/offlineimap ~
/Maildir
318 lnf
-T /p
/News ~
/News
319 # don't use /* because I don't want to require it to be mounted
322 s lnf
/q
/root
/.editor-backups
/q
/root
/.undo-tree-history \
323 /a
/opt
/a
/c
/.emacs.d
$HOME/mw_vars
/k
/backup
/root
325 d
=/q
/p
/c
/machine_specific
/$HOSTNAME/.unison
326 if ! s
test -L /root
/.unison
&& [[ $
(s
find /root
/.unison
-prune -empty) ]]; then
328 s chown
-R $USER:$USER /root
/.unison
329 s
cp -rT /root
/.unison
$d
331 s lnf
-T $d /root
/.unison
336 s lnf
/a
/c
/.inputrc
/a
/c
/.vim
/a
/c
/.vimrc
/a
/c
/.gvimrc
/root
338 # machine is going away
339 # if [[ $HOSTNAME == htpc ]]; then
340 # lnf -T /i/Videos ~/Downloads
345 lnf
-T /i
/k
/mboxes ~
/mail
349 # basic needed packages
350 case $
(distro-name
) in
353 if isdebian-stable
; then
354 pi firefox
/$codename-backports
356 pi firefox
/unstable
# has no unstable dependencies
359 # for hosts which require nonfree drivers
362 *) pi linux-image-amd64 firmware-linux-nonfree \
363 firmware-linux-free linux-headers-amd64
369 pi xmacro gtk-redshift xinput
373 p
-y groupinstall development-tools c-development books admin-tools
377 # debian has this package patched to work, upstream is dead
378 # tried using alien, pi alien, alien -r *.deb, rpm -Uhv *.rpm, got this error, so fuck it
379 # file /usr/bin from install of xmacro-0.3pre_20000911-7.x86_64 conflicts with file from package filesystem-3.2-19.fc20.x86_64
380 # http://packages.debian.org/source/sid/xmacro
381 pi
patch libXtst-devel
383 wget http
://ftp.de.debian.org
/debian
/pool
/main
/x
/xmacro
/xmacro_0.3pre-20000911.orig.
tar.gz
384 wget http
://ftp.de.debian.org
/debian
/pool
/main
/x
/xmacro
/xmacro_0.3pre-20000911-6.
diff.gz
386 patch -p0 < xmacro_0.3pre-20000911-6.
diff
387 cd xmacro-0.3pre-20000911.orig
389 sleep 1 # not sure why the following command couldn\'t find, so trying this
390 # no make install target
391 s
cp -f xmacroplay xmacrorec xmacrorec2
/usr
/local
/bin
399 # libxtst is missing dep https://aur.archlinux.org/packages/xmacro/#news
400 pi xorg-server redshift xorg-xinput libxtst xmacro
403 # https://aur.archlinux.org/packages/xkbset/#comment-545419
406 -----BEGIN CERTIFICATE-----
407 MIIJADCCB+igAwIBAgIRAIVAhZ0TMbQ5jTm0koI8X6YwDQYJKoZIhvcNAQELBQAw
408 djELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAk1JMRIwEAYDVQQHEwlBbm4gQXJib3Ix
409 EjAQBgNVBAoTCUludGVybmV0MjERMA8GA1UECxMISW5Db21tb24xHzAdBgNVBAMT
410 FkluQ29tbW9uIFJTQSBTZXJ2ZXIgQ0EwHhcNMTUxMjA4MDAwMDAwWhcNMTgxMjA3
411 MjM1OTU5WjCBsTELMAkGA1UEBhMCVVMxDjAMBgNVBBETBTY1MjExMREwDwYDVQQI
412 EwhNaXNzb3VyaTERMA8GA1UEBxMIQ29sdW1iaWExHzAdBgNVBAkTFjExMDAgQ2Fy
413 cmllIEZyYW5ja2UgRHIxHzAdBgNVBAoTFlVuaXZlcnNpdHkgb2YgTWlzc291cmkx
414 CzAJBgNVBAsTAk1VMR0wGwYDVQQDExRmYWN1bHR5Lm1pc3NvdXJpLmVkdTCCASIw
415 DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN8Kap8hASpxQeqjHibGsCR1PBkh
416 nW9p5FkuhGpMW/3ko8Qfx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NvdXJpLmVkdYIid2hpdGVwYXBlci5ncmFkc2No
449 b29sLm1pc3NvdXJpLmVkdTANBgkqhkiG9w0BAQsFAAOCAQEAQutYVAqG7MpmG2Nu
450 Z/UypjYkN4JvwRbKBpTrce2IT/Sy29x6chBbyD+0WE6QORBtaUHuzE1KoXqpnF4M
451 QrkKw0oBAC6x9dISoomq0DkIndtoBYYLaxSoII6F4OGWgF7pQ/7MiCBYzsKQpn9t
452 aofMcTfvnCjq+MCIaeYnUKBVww0lOJlUxZGKxFJvRpf78HfbBauojjRO2zXLZD/u
453 KMspbTfDaj5etIgWGShY2eml3N/SjAENmZYkcgDBYFyi8CckcEBAVzpH1+D+7Anz
454 txHSYDNHAYLv83MwbegApa1FwPqlG/4SdEU8G6e6Xf5GLC/6GPGVTUpr7o348OOO
456 -----END CERTIFICATE-----
457 -----BEGIN CERTIFICATE-----
458 MIIF+TCCA+GgAwIBAgIQRyDQ+oVGGn4XoWQCkYRjdDANBgkqhkiG9w0BAQwFADCB
459 iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl
460 cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV
461 BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTQx
462 MDA2MDAwMDAwWhcNMjQxMDA1MjM1OTU5WjB2MQswCQYDVQQGEwJVUzELMAkGA1UE
463 CBMCTUkxEjAQBgNVBAcTCUFubiBBcmJvcjESMBAGA1UEChMJSW50ZXJuZXQyMREw
464 DwYDVQQLEwhJbkNvbW1vbjEfMB0GA1UEAxMWSW5Db21tb24gUlNBIFNlcnZlciBD
465 QTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJwb8bsvf2MYFVFRVA+e
466 xU5NEFj6MJsXKZDmMwysE1N8VJG06thum4ltuzM+j9INpun5uukNDBqeso7JcC7v
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bjzw72
483 hipu47Gkyfr2NEx3KoCGMLCj3Btx7ASn5Ji8FoU+hCazwOU1VX55mKPU1I2250Lo
484 RCASN18JyfsD5PVldJbtyrmz9gn/TKbRXTr80U2q5JhyvjhLf4lOJo/UzL5WCXED
485 Smyj4jWG3R7Z8TED9xNNCxGBMXnMete+3PvzdhssvbORDwBZByogQ9xL2LUZFI/i
486 eoQp0UM/L8zfP527vWjEzuDN5xwxMnhi+vCToh7J159o5ah29mP+aJnvujbXEnGa
487 nrNxHzu+AGOePV8hwrGGG7hOIcPDQwkuYwzN/xT29iLp/cqf9ZhEtkGcQcIImH3b
488 oJ8ifsCnSbu0GB9L06Yqh7lcyvKDTEADslIaeSEINxhO2Y1fmcYFX/Fqrrp1WnhH
489 OjplXuXE0OPa0utaKC25Aplgom88L2Z8mEWcyfoB7zKOfD759AN7JKZWCYwk
490 -----END CERTIFICATE-----
491 -----BEGIN CERTIFICATE-----
492 MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCB
493 iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl
494 cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV
495 BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAw
496 MjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMCVVMxEzARBgNV
497 BAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU
498 aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2Vy
499 dGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK
500 AoICAQCAEmUXNg7D2wiz0KxXD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Bl2+odnKPi4w2r78NBc5xjeambx9spnFixdjQg3IM8WcR
517 iQycE0xyNN+81XHfqnHd4blsjDwSXWXavVcStkNr/+XeTWYRUc+ZruwXtuhxkYze
518 Sf7dNXGiFSeUHM9h4ya7b6NnJSFd5t0dCy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZ
519 XHlKYC6SQK5MNyosycdiyA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/
520 qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9cJ2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRB
521 VXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGwsAvgnEzDHNb842m1R0aB
522 L6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gxQ+6IHdfG
523 jjxDah2nGN59PRbxYvnKkKj9
524 -----END CERTIFICATE-----
526 cat /etc
/ssl
/certs
/ca-certificates.crt
>> $cert
527 CURL_CA_BUNDLE
=$cert pi xkbset
531 ubuntu|debian|fedora
)
542 # enables trim for volume delete, other rare commands.
543 sudo
sed -ri 's/( *issue_discards\b).*/\1 = 1/' /etc
/lvm
/lvm.conf
547 sudo
cp /usr
/share
/doc
/util-linux
/examples
/fstrim.
{service
,timer
} /etc
/systemd
/system
550 sudo systemctl
enable fstrim.timer
553 dirs=(/mnt
/{1,2,3,4,5,6,7,8,9})
554 s mkdir
-p "${dirs[@]}"
555 s chown ian
:ian
"${dirs[@]}"
557 if [[ $HOSTNAME == treetowl
]]; then
558 tu
/etc
/fstab
<<'EOF'
559 UUID=3f7b31cd-f299-40b4-a86b-7604282e2715 /i btrfs noatime 0 2
562 tu
/etc
/fstab
<<'EOF'
563 /q/i /i none bind 0 0
567 tu
/etc
/fstab
<<'EOF'
568 /i/w /w none bind 0 0
569 /i/k /k none bind 0 0
572 if ! mountpoint
/kfrodo
; then
574 s chown ian
:traci
/kfrodo
576 if [[ $HOSTNAME == frodo
]]; then
577 tu
/etc
/fstab
<<'EOF'
578 /k /kfrodo none bind 0 0
581 tu
/etc
/fstab
<<'EOF'
582 frodo:/k /kfrodo nfs defaults 0 0
586 s mkdir
-p /q
/i
/{w
,k
}
587 for dir
in /{i
,w
,k
}; do
588 if mountpoint
$dir; then continue; fi
595 # ssh and probably some other things care about parent directory
596 # ownership, and ssh doesn\'t allow any group writable parent
597 # directories, so we are forced to use a directory structure similar
598 # to home directories
603 # it comes with stretch and arch, but not jessie.
604 # propogate /etc/udev/hwdb.d
605 if which systemd-hwdb
; then
606 s systemd-hwdb update
607 ser restart systemd-udev-trigger
610 # work desktop doesnt need gpg stuff, but it doesnt hurt
611 s
dd of
=/etc
/profile.d
/environment.sh
<<'EOF'
612 # IAN: EDIT THIS FROM /a/bin/distro-setup/distro-begin
614 if [ -f $HOME/path_add-function ]; then
615 . $HOME/path_add-function
616 path_add /usr/sbin /usr/local/sbin /sbin
617 path_add /a/exe /a/opt/bin $HOME/.cabal/bin
619 if [ -r /etc/alternatives/java_sdk ]; then
620 export JAVA_HOME=/etc/alternatives/java_sdk
621 path_add /etc/alternatives/java_sdk
625 export EDITOR="emacsclient"
626 # this makes emacsclient file/-c start a server instance if none is running,
627 # instead of some alternate editor logic
628 export ALTERNATE_EDITOR=""
630 # ubuntu starts gpg agent automatically with /etc/X11/Xsession.d/90gpg-agent.
631 # fedora doesn't, which left me to figure this out, and google was no help.
632 # fedora documentation is often quite bad :(
633 # This is mostly copied from that file.
634 # Main difference is that we eval the result of starting gpg-agent,
635 # while that file executes it through xsession specific var.
636 # Also make sourcing the pidfile make more sense.
637 # End result should be the same afaik.
638 # for gpg-agent to work when calling gpg from the command line,
639 # we need an environment variable that is setup via the eval.
640 # which is why we do this upon login, so it can propogate
641 # It is also written to the file $HOME/.gnupg/gpg-agent-info-$(hostname)
642 # I'm not aware if that is ever used, but just fyi.
643 # I also added the bit about xmessaging the stderr,
644 # because I'd like to know if the command fails
645 if [ -f /etc/fedora-release ]; then
646 : ${GNUPGHOME=$HOME/.gnupg}
648 GPGAGENT=/usr/bin/gpg-agent
649 PID_FILE="$GNUPGHOME/gpg-agent-info-$(hostname)"
651 if ! $GPGAGENT 2>/dev/null; then
653 eval "$($GPGAGENT --homedir /p/do-not-delete --daemon --sh --write-env-file=$PID_FILE 2>$temp)"
654 temperr="$(<"$temp")"
655 [ -n "$temperr" ] && xmessage "gpg-agent stderr: $temperr"
656 elif [ -r "$PID_FILE" ]; then
658 export GPG_AGENT_INFO
662 # ubuntu has 002, debian has 022.
663 # from what I've read, benefit of 002 makes shared groups read/write.
664 # Security concern is where some unixes put everyone in a same group,
665 # so if you copy files there with exact perms, that is probably not
666 # what you want. I don't use a system like that, and I don't really care
667 # either way, but I'd prefer
668 # being able to sync file perms with ubuntu systems at work,
669 # and it's easier to change the debian one.
679 # disable crash report annoying crap
680 s
dd of
=/etc
/default
/apport
<<<'enabled=0'
685 # install so it's build dependencies don't get removed.
687 # emacs git build is currently broken
692 makepkg -si --noconfirm
698 pi hunspell hunspell-en
700 # to disable emacs git build,
701 # s apt-get install emacs
703 /a/bin/buildscripts/emacs -u
705 /a/bin/buildscripts/emacs -r
709 # todo, figure this out for arch if we ever try out gnome.
711 # install for multiple display managers in case we use one
715 # fedora didn\'t have the 3.
718 s mkdir -p $dir/PostLogin
719 s command cp /a/bin/desktop-20-autostart.sh $dir/PostLogin/Default
720 s mkdir /etc/lightdm/lightdm.conf.d
721 s dd of=/etc/lightdm/lightdm.conf.d/12-ian.conf <<'EOF'
723 session-setup-script=/a/bin/desktop-20-autostart.sh
729 # todo, also note for work comp, scp opt/org-mode bin/build-scripts
731 # use the package manger version to install the cabal version
734 PATH="$PATH:$HOME/.cabal/bin"
736 # todo, on older ubuntu I used cabal xmonad + xfce,
737 # see /a/bin/old-unused/xmonad-cabal.sh
739 # trying out the distros versions newer distros
742 # for displaying error messages.
743 # optional dependency in arch, standard elsewhere.
744 pi xorg-xmessage xmonad-contrib xorg-xsetroot xorg-xinit
746 # https://wiki.archlinux.org/index.php/Xinitrc
747 for homedir in /home/*; do
748 cp /etc/X11/xinit/xinitrc $homedir/.xinitrc
749 sed -ri '/^ *twm\b/,$d' $homedir/.xinitrc
750 echo "source /a/bin/xinitrc" | tee -a $homedir/.xinitrc
757 if isdeb && (tp || x2); then
762 # the first pup command can kill off our /etc/
763 /a/bin/ssh-emacs-setup
764 echo "$0: $(date): ending now"