various fixes and updates
[distro-setup] / distro-begin
1 #!/bin/bash -l
2 # Copyright (C) 2016 Ian Kelling
3 # This program is under GPL v. 3 or later, see <http://www.gnu.org/licenses/>
4
5
6 # for bootstrapping a new machine
7
8 # to make ssh run better, first run this:
9 sudo bash -c 'source /a/c/repos/bash/.bashrc && source /a/bin/ssh-emacs-setup'
10
11
12 # see t.org for OS installer notes
13
14 # usage: $0 [OPTIONS] HOSTNAME
15
16 # tips:
17 # run any sudo command first so your pass is cached
18 # set the scrollback to unlimited in case something goes wrong
19
20 if [[ $EUID == 0 ]]; then
21 echo "error: do not run as root"
22 exit
23 fi
24
25 interactive=true # set this to true if running by hand in emacs
26 [[ $- == *i* ]] || interactive=false
27
28
29
30 if ! $interactive; then
31 set -x
32 set -e -o pipefail
33 fi
34 set -E
35 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
36
37 # headless=false # unused atm
38 recompile=true
39 # for copying to a new data fs
40 bootstrapfs=false # old flag, needs new look before using.
41 while [[ $1 == -* ]]; do
42 case $1 in
43 # avoid some of the longer compilation steps,
44 # when we need to rerun because we had an error
45 -n) recompile=false; shift ;;
46 esac
47 done
48
49 if [[ $1 ]]; then
50 host=$1
51 else
52 host=$HOSTNAME
53 fi
54
55 for f in iank-dev htpc treetowl x2 frodo tp; do
56 eval "$f() { [[ $host == $f ]]; }"
57 done
58 has_p() { iank-dev || x2 || frodo; }
59 encrypted() { has_p || tp; }
60
61 shopt -s extglob
62 export GLOBIGNORE=*/.:*/..
63 umask 0002
64
65
66 ####### end command line parsing
67
68
69 if frodo; then
70 x=/usr/local/bin/iancryptsetup
71 sudo dd of=$x <<'EOF'
72 #!/bin/bash -x
73
74 # man systemd-cryptsetup-generator
75 #man systemd-cryptsetup
76 #man systemd-cryptsetup@.service
77
78 f=/tmp/iancryptsetup
79 ssh -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null \
80 -T -i /p/cryptkeyssh/id_rsa ian@treetowl > $f || exit 0
81
82 # example of initial setup of a disk
83 #disk=/dev/sdg2
84 #echo YES|cryptsetup --verbose luksFormat $disk $f
85 ## copy $f into paste buffer, then enter memorized pass, which we can use
86 ## This is for the case of ssh not being available
87 #cryptsetup --verbose --verify-passphrase luksAddKey $disk
88
89 # initial keyfile can be generated like any random pass
90 # head -c 200 /dev/urandom | tr -cd '[:alnum:]' | head -c 80 > keyfile
91
92
93 data=(
94 b1d7f102-c7cd-40a0-bff0-2d498692b5a7 crypta7
95 80649f08-1977-441b-ad8f-246931571702 crypt02
96 3ae71d1a-dbd5-4cbe-afa2-c7529c0c4d31 crypt31
97 bd4bbf8e-35c1-48e5-bb15-106c1b47792b crypt2b
98 c061a929-54fe-4a47-939d-c008ba418246 crypt46
99 ec709a4b-1ba7-463f-a1cd-841cb40868f0 cryptf0
100 b9f2a980-f57c-4c58-9313-055da09d579c crypt9c
101 747b9932-aa98-4552-86ab-657d0ccd4fb0 cryptb0
102 afb44dd6-28ba-443b-9ca4-34dc2a95a213 crypt13
103 )
104 for ((i=0; i<${#data[@]}; i+=2)); do
105 cryptsetup luksOpen --key-file $f UUID=${data[i]} ${data[i+1]}
106 done
107 for x in a q /mnt/btrfs_root; do
108 mount /$x
109 done
110 #/a/bin/firefox-link
111 exit 0
112 EOF
113 sudo chmod +x $x
114 # todo, it needs to wait for networking
115 sudo dd of=/etc/systemd/system/iancrypt.service <<'EOF'
116 [Unit]
117 Description=iancrypt
118
119 [Service]
120 Type=oneshot
121 ExecStart=/usr/local/bin/iancryptsetup
122
123 [Install]
124 WantedBy=multi-user.target
125 EOF
126 sudo systemctl enable iancrypt.service
127 sudo systemctl restart iancrypt.service
128 fi
129
130
131
132 if iank-dev; then
133 desktop=$(ssh root@iankelling.org grep desktop /etc/hosts | grep -o "^.* ")
134 if $bootstrapfs; then
135 # for bootstrapping at a new job:
136 cp="scp $desktop:"
137 # for moving to a new hd, change $cp to move between filesystems
138 mkdir -p /a/bin
139 chown -R ian:ian /a
140 $cp/a/c /a
141 $cp/a/c/bin/{bash-programs-by-ian,distro-begin,distro-functions,input-setup.sh} /a/bin
142 echo -e \\n\\n\\n | ssh-keygen -t rsa
143 fi
144 fi
145
146 # example which will be usefull when redoing desktop
147 # if x2; then
148 # f=/etc/fstab
149 # line='/dev/mapper/fedora-a /a btrfs noatime 0 1'
150 # if ! grep -Fxq "$line" $f; then
151 # echo "$line" | sudo tee -a $f >/dev/null
152 # fi
153 # if ! mount | grep -q '^/dev/mapper/fedora-a'; then
154 # dir=/a
155 # sudo mkdir -p $dir
156 # sudo chown ian:ian $dir
157 # sudo mount $dir
158 # fi
159 # fi
160
161 # set noatime.
162 sudo sed -ri '/noatime/!s/(ext[234]|btrfs)[[:space:]]+/\1 noatime,/' /etc/fstab
163 sudo sed -ri '/noatime/s/relatime,?|defaults,?//g' /etc/fstab
164
165
166 # this script has been designed to be idempotent
167 # todo, it would be nice to cut down on some of the output
168
169
170
171 # output is below so shellcheck can verify sources
172 for x in /a/bin/bash-programs-by-ian/repos/{errhandle,tee-unique,lnf}/*-function; do
173 echo "# shellcheck source=$x";
174 # shellcheck source=/a/bin/bash-programs-by-ian/repos/errhandle/bash-trace-function
175 # shellcheck source=/a/bin/bash-programs-by-ian/repos/errhandle/errallow-function
176 # shellcheck source=/a/bin/bash-programs-by-ian/repos/errhandle/errcatch-function
177 # shellcheck source=/a/bin/bash-programs-by-ian/repos/errhandle/errexit-function
178 # shellcheck source=/a/bin/bash-programs-by-ian/repos/tee-unique/teeu-function
179 # shellcheck source=/a/bin/bash-programs-by-ian/repos/lnf/lnf-function
180 source $x
181 done
182
183
184 set +e
185 $interactive || errcatch
186 source /a/bin/distro-functions/src/identify-distros
187 echo path:$PATH
188
189
190
191 if isfedora; then
192 # comment out line disallowing calling sudo in scripts
193 sudo sed -i 's/^Defaults *requiretty/#\0 # ian commented/' /etc/sudoers
194 # turn on magic sysrq commands for this boot cycle
195 echo 1 > sudo dd of=/proc/sys/kernel/sysrq
196 # selinux is not user friendly. Like, you enable samba, but you haven't run the magic selinux commands so it doesn't work
197 # and you have no idea why.
198 sudo sed -i 's/^\(SELINUX=\).*/\1disabled/' /etc/selinux/config
199 selinuxenabled && sudo setenforce 0
200 fi
201
202
203
204
205 # link files
206
207
208 lnf /a/c/* /a/bin ~
209
210 for x in /a/c/repos/bash/!(.git); do
211 lnf "$x" ~
212 sudo -i <<EOF
213 source /a/bin/bash-programs-by-ian/repos/lnf/lnf-function
214 lnf $x /root
215 EOF
216 done
217
218 echo path:$PATH
219
220 set +x
221 errallow
222 source ~/.bashrc
223 echo path:$PATH
224 $interactive || errcatch
225 $interactive || set -x
226
227
228 # passwordless sudo
229 tu /etc/sudoers <<'EOF'
230 ian ALL=(ALL) NOPASSWD: ALL
231 Defaults env_keep += SUDOD
232 EOF
233
234
235 # enable magic sysrq keys. debian docs say it is already enabled by default
236 isfedora && tu /etc/sysctl.conf 'kernel.sysrq = 1'
237
238
239
240 if isdebian; then
241 # add contrib non-free to sources for main
242 s sed -i 's/^\(deb.* main\).*/\1 contrib non-free/' /etc/apt/sources.list
243
244 # non-existent var, as Im not planning to use stable right now
245 if isdebian-stable; then
246 code=$(debian-codename)
247 s dd of=/etc/apt/sources.list.d/mozilla-iceweasel <<EOF
248 deb http://mozilla.debian.net/ $code-backports iceweasel-release
249 deb-src http://mozilla.debian.net/ $code-backports iceweasel-release
250 EOF
251
252 # we change the mirror from the default, so we cant use tu
253 s dd of=/etc/apt/sources.list.d/main-backports <<EOF
254 deb http://ftp.us.debian.org/debian/ $code-backports main contrib non-free
255 deb-src http://ftp.us.debian.org/debian/ $code-backports main contrib non-free
256 EOF
257
258 p update
259 # take care of mozilla signing errors in previous command
260 pi pkg-mozilla-archive-keyring
261 else
262 :
263 # this would change stable to testing, but I set that up already.
264 # It\'s just a no-op if its already testing.
265 # sudo sed -ri 's!^( *[^ #]+ +[^ ]+ +)[[:alpha:]]+(.*)!\1testing\2!' /etc/apt/sources.list
266 p update
267 fi
268 fi
269
270 if isarch; then
271 #https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages
272 sudo pacman -S --noconfirm --needed base-devel jq
273 # pacaur seems to be the best, although it + cower has a few minor bugs,
274 # its design goals seem good, so, going for it.
275
276 aurpi() {
277 for p in "$@"; do
278 tempdir=$(mktemp -d)
279 pushd $tempdir
280 aurex "$p"
281 makepkg -sri --skippgpcheck --noconfirm
282 popd
283 rm -rf $tempdir
284 done
285 }
286 aurpi cower pacaur
287
288 # this creates ~/.gnupg. addgnupghome is broken on arch.
289 gpg -k
290 # for aur, automatically dl & add gpg keys.
291 # Just the keyserver-options line goes in dirmngr.conf once
292 # this bug is fixed: https://bugs.gnupg.org/gnupg/issue2147
293 teeu ~/.gnupg/gpg.conf <<EOF
294 $(grep -o '^ *keyserver .*' ~/.gnupg/dirmngr.conf)
295 keyserver-options auto-key-retrieve
296 EOF
297 pi pacserve
298 x=$(mktemp); pacman.conf-insert_pacserve >$x
299 sudo dd of=/etc/pacman.conf if=$x; rm $x
300 sudo systemctl enable pacserve.service
301 sudo systemctl start pacserve.service
302
303 # strange error if just installing trash-cli: "pyalpm requires python",
304 # so I see that it requires python2, and installing that manually fixes it.
305 # I didn't see this on earlier installation, main thing which changed was
306 # pacserve, so not sure if it's related.
307 pi python2
308 fi
309
310 pup
311 pi trash-cli
312
313
314 ###### link files ###########
315 # convenient to just do all file linking in one place
316
317 lnf /a/* ~
318 s lnf /a/sdx{,d} /
319
320 # if it wasn't set already, we could set hostname here
321 #echo treetowl | s dd of=/etc/hostname
322 #s hostname -F /etc/hostname
323 #HOSTNAME=$(hostname)
324
325 #########################################
326 # NOTE: only /a needs to be mounted for creating links!
327 ###########################################
328
329 # todo: this is desktop specific. on work comp, mkdir /p/.editor-backups
330 # todo: reconcile ~/.ssh/config work/home
331 if has_p; then
332 lnf -T /p/offlineimap ~/Maildir
333 lnf -T /p/News ~/News
334 s lnf -T /q/p /p
335 # don't use /* because I don't want to require it to be mounted
336 s lnf /q/root/.editor-backups /q/root/.undo-tree-history \
337 /q/root/.ssh /a/opt \
338 /a/c/.emacs.d ~/.unison /root
339
340 fi
341
342 s lnf /a/c/.inputrc /a/c/.vim /a/c/.vimrc /a/c/.gvimrc /root
343
344 if [[ $HOSTNAME == htpc ]]; then
345 lnf -T /i/Videos ~/Downloads
346 fi
347
348 if has_p; then
349 # for dovecot
350 lnf -T /i/mboxes ~/mail
351 fi
352
353
354 # basic needed packages
355 case $(distro-name) in
356 debian)
357 pi $( isdebian-stable && e -t $code-backports ) iceweasel
358 # for hosts which require nonfree drivers
359 case $HOSTNAME in
360 tp|x2) : ;;
361 *) pi linux-image-amd64 firmware-linux-nonfree \
362 firmware-linux-free linux-headers-amd64
363 ;;
364 esac
365 ;;&
366 ubuntu|debian)
367 pi xmacro gtk-redshift xinput
368 ;;&
369 fedora)
370 p -y groupinstall development-tools c-development books admin-tools
371 pi redshift-gtk
372 # debian has this package patched to work, upstream is dead
373 # tried using alien, pi alien, alien -r *.deb, rpm -Uhv *.rpm, got this error, so fuck it
374 # 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
375 # http://packages.debian.org/source/sid/xmacro
376 pi patch libXtst-devel wget man-pages # what is the ubuntu equivalent to man-pages?
377 cd $(mktemp -d)
378 wget http://ftp.de.debian.org/debian/pool/main/x/xmacro/xmacro_0.3pre-20000911.orig.tar.gz
379 wget http://ftp.de.debian.org/debian/pool/main/x/xmacro/xmacro_0.3pre-20000911-6.diff.gz
380 ex *.gz
381 patch -p0 < xmacro_0.3pre-20000911-6.diff
382 cd xmacro-0.3pre-20000911.orig
383 make
384 sleep 1 # not sure why the following command couldn\'t find, so trying this
385 # no make install target
386 s cp -f xmacroplay xmacrorec xmacrorec2 /usr/local/bin
387 ;;&
388 arch)
389 # libxtst is missing dep https://aur.archlinux.org/packages/xmacro/#news
390 pi xorg-server redshift xorg-xinput pkgfile libxtst xmacro
391 # like apt-cache
392 s pkgfile --update
393 ;;&
394 esac
395
396 pi xbindkeys xkbset cryptsetup unison
397
398 pi lvm2
399 # enables trim for volume delete, other rare commands.
400 sudo sed -ri 's/( *issue_discards\b).*/\1 = 1/' /etc/lvm/lvm.conf
401
402 if encrypted; then
403 if isdeb; then
404 sudo cp /usr/share/doc/util-linux/examples/fstrim.{service,timer} /etc/systemd/system
405 fi
406 # does weekly trim
407 sudo systemctl enable fstrim.timer
408 fi
409
410 if has_p; then
411 # relatime is default, but it still significantly increases writes
412 # in comparison because it writes on the first read after each
413 # write.
414 #
415 dirs=(/i /mnt/{1,2,3,4,5,6,7,8,9})
416 if ! frodo; then
417 dirs+=(/q)
418 fi
419 s mkdir -p "${dirs[@]}"
420 s chown ian:ian "${dirs[@]}"
421 # ssh and probably some other things care about parent directory
422 # ownership, and ssh doesn\'t allow any group writable parent
423 # directories, so we are forced to use a directory structure similar
424 # to home directories
425 s chown root:ian /q
426 s chmod 755 /q
427
428 if treetowl; then
429 # get uuids from blkid and lvdisplay
430 # at times Ive done this through the installer. not anymore
431 tu /etc/fstab<<'EOF'
432 /dev/mapper/cswap1 none swap sw 0 0
433 /dev/mapper/q /q ext4 noatime 0 2
434 UUID=3f7b31cd-f299-40b4-a86b-7604282e2715 /i btrfs noatime 0 2
435 UUID=3f7b31cd-f299-40b4-a86b-7604282e2715 /mnt/btrfs_root btrfs noatime,subvolid=0 0 2
436 EOF
437 s mkdir -p /mnt/btrfs_root
438 s dd of=/etc/crypttab <<'EOF'
439 # i used to use UUID=<uuid> from cryptsetup luksUUID /dev/mapper/ianvg1-q
440 # however, it doesn't work for lvm volumes when opening on the command line,
441 # So, just using the thing which works both ways.
442 q /dev/mapper/vg_treetowl00-lv01 none luks,discard,noauto
443 # based on cryptsetup's README.Debian, and FAQ
444 cswap1 /dev/mapper/vg_treetowl00-lv00 /dev/urandom swap,cipher=aes-cbc-essiv:sha256,size=256,hash=sha256,discard,noearly
445 EOF
446 s chmod 600 /etc/crypttab
447
448 s systemctl daemon-reload
449 s systemctl restart systemd-cryptsetup@q.service
450 s mount /q
451
452 s systemctl restart systemd-cryptsetup@cswap1.service
453 # old ways:
454 # s update-rc.d cryptdisks enable
455
456 # misc notes about when messing around with jessie:
457 # # this was useful on debian jessie:
458 # systemd-tty-ask-password-agent --query
459 # according to the broadcast message
460 # jessie also still had /etc/init.d/cryptdisks,
461 # which seemed to work only with reload, and it seems deprecated
462 # and cryptdisks_start q, also prolly deprecated
463
464 fi
465
466
467
468 fi
469
470
471
472 # exptected directory for .editor-backups
473 if ! has_p; then
474 s lnf /a/p /
475 fi
476
477 /a/bin/conflink
478
479
480 # work desktop doesnt need gpg stuff, but it doesnt hurt
481 s dd of=/etc/profile.d/environment.sh <<'EOF'
482 # IAN: EDIT THIS FROM /a/bin/distro-begin
483
484 if [ -f $HOME/path_add-function ]; then
485 . $HOME/path_add-function
486 path_add /usr/sbin /usr/local/sbin /sbin
487 path_add /a/bin /a/opt/bin $HOME/.cabal/bin
488
489 if [ -r /etc/alternatives/java_sdk ]; then
490 export JAVA_HOME=/etc/alternatives/java_sdk
491 path_add /etc/alternatives/java_sdk
492 fi
493 fi
494
495 export EDITOR="emacsclient"
496 # this makes emacsclient file/-c start a server instance if none is running,
497 # instead of some alternate editor logic
498 export ALTERNATE_EDITOR=""
499
500 # ubuntu starts gpg agent automatically with /etc/X11/Xsession.d/90gpg-agent.
501 # fedora doesn't, which left me to figure this out, and google was no help.
502 # fedora documentation is often quite bad :(
503 # This is mostly copied from that file.
504 # Main difference is that we eval the result of starting gpg-agent,
505 # while that file executes it through xsession specific var.
506 # Also make sourcing the pidfile make more sense.
507 # End result should be the same afaik.
508 # for gpg-agent to work when calling gpg from the command line,
509 # we need an environment variable that is setup via the eval.
510 # which is why we do this upon login, so it can propogate
511 # It is also written to the file $HOME/.gnupg/gpg-agent-info-$(hostname)
512 # I'm not aware if that is ever used, but just fyi.
513 # I also added the bit about xmessaging the stderr,
514 # because I'd like to know if the command fails
515 if [ -f /etc/fedora-release ]; then
516 : ${GNUPGHOME=$HOME/.gnupg}
517
518 GPGAGENT=/usr/bin/gpg-agent
519 PID_FILE="$GNUPGHOME/gpg-agent-info-$(hostname)"
520
521 if ! $GPGAGENT 2>/dev/null; then
522 temp="$(mktemp)"
523 eval "$($GPGAGENT --homedir /p/do-not-delete --daemon --sh --write-env-file=$PID_FILE 2>$temp)"
524 temperr="$(<"$temp")"
525 [ -n "$temperr" ] && xmessage "gpg-agent stderr: $temperr"
526 elif [ -r "$PID_FILE" ]; then
527 . "$PID_FILE"
528 export GPG_AGENT_INFO
529 fi
530 fi
531
532 # ubuntu has 002, debian has 022.
533 # from what I've read, benefit of 002 makes shared groups read/write.
534 # Security concern is where some unixes put everyone in a same group,
535 # so if you copy files there with exact perms, that is probably not
536 # what you want. I don't use a system like that, and I don't really care
537 # either way, but I'd prefer
538 # being able to sync file perms with ubuntu systems at work,
539 # and it's easier to change the debian one.
540
541 umask 002
542 EOF
543
544
545
546 # emacs dependency.
547 # dunno why debian installed postfix with yum-builddep emacs
548 # but I will just explicitly install it here since
549 # I use it for sending mail in emacs.
550 if private-host; then
551 relayhost="[mail.messagingengine.com]:587"
552 else
553 # ses initially suggests port 25, but I had problems connecting to that.
554 relayhost="[email-smtp.us-west-2.amazonaws.com]:587"
555 fi
556 if isdeb; then
557 s debconf-set-selections<<EOF
558 postfix postfix/main_mailer_type select Satellite system
559 postfix postfix/mailname string $host
560 postfix postfix/relayhost string $relayhost
561 EOF
562
563 pi postfix
564 else
565 pi postfix
566 # Settings from reading the output when installing on debian,
567 # then seeing which were different in a default install on arch.
568 # I assume the same works for fedora.
569 postconfin <<EOF
570 mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
571 mailbox_size_limit = 0
572 relayhost = $relayhost
573 inet_interfaces = loopback-only
574 EOF
575
576 s systemctl enable postfix
577 s systemctl start postfix
578 fi
579
580
581 if isarch; then
582 # install so it's build dependencies don't get removed.
583 x=$(mktemp -d)
584 pushd $x
585 aurex emacs-git
586 makepkg -si --noconfirm
587 popd
588 rm -rf $x
589 else
590 # to disable emacs git build,
591 # s apt-get install emacs
592 if $recompile; then
593 /a/bin/buildscripts/emacs
594 else
595 /a/bin/buildscripts/emacs -r
596 fi
597 fi
598
599 # todo, figure this out for arch if we ever try out gnome.
600 if ! isarch; then
601 # install for multiple display managers in case we use one
602 if isdeb; then
603 dir=/etc/gdm3
604 elif isfedora; then
605 # fedora didn\'t have the 3.
606 dir=/etc/gdm
607 fi
608 s mkdir -p $dir/PostLogin
609 s command cp /a/bin/desktop-20-autostart.sh $dir/PostLogin/Default
610 s mkdir /etc/lightdm/lightdm.conf.d
611 s dd of=/etc/lightdm/lightdm.conf.d/12-ian.conf <<'EOF'
612 [SeatDefaults]
613 session-setup-script=/a/bin/desktop-20-autostart.sh
614 EOF
615 fi
616
617 if isubuntu; then
618 # disable crash report annoying crap
619 s dd of=/etc/default/apport <<<'enabled=0'
620 fi
621
622
623 pi ghc sakura
624 # todo, also note for work comp, scp opt/org-mode bin/build-scripts
625
626 # use the package manger version to install the cabal version
627 pi cabal-install
628 cabal update
629 PATH="$PATH:$HOME/.cabal/bin"
630
631 # trying out the distro's versions newer distros
632 if isdebian-stable || isubuntu; then
633 # todo: on ubuntu 12.04, needed to install zlib1g-dev
634 cabal install cabal-install
635 pu cabal-install
636 # just guessed at this after getting /bin/ld cannot find -lHSmtl or something
637 t ~/.ghc
638
639
640 cabal update
641 # todo, work machine required some packages libx11-dev libxrandr-dev libxft2-dev
642 cabal install xmonad
643 cabal install xmonad-contrib
644 # work machine:
645 # pi tasksel. select openssh server, basic server, large font selection
646
647 #http://comments.gmane.org/gmane.comp.lang.haskell.xmonad/13871
648 cat <<'EOF'
649 manual steps required:
650 xfce, "Session and Startup" > "Application Autostart"
651 Add
652 Name: xmonad
653 Description: xmonad --replace
654 Command: delayed-xmonad
655 EOF
656
657 else
658 pi xmonad
659 if isarch; then
660 # for displaying error messages.
661 # optional dependency in arch, standard elsewhere.
662 pi xorg-xmessage xmonad-contrib xorg-xsetroot xorg-xinit
663
664 # https://wiki.archlinux.org/index.php/Xinitrc
665 cp /etc/X11/xinit/xinitrc ~/.xinitrc
666 sed -ri '/^ *twm\b/,$d' ~/.xinitrc
667 echo "source /a/bin/xinitrc" >> ~/.xinitrc
668 else
669 pi suckless-tools
670 fi
671 fi
672 pi dmenu
673
674 if isdeb && (tp || x2); then
675 pi task-laptop
676 fi