lots of stuff lumped together
[distro-setup] / distro-begin
index 9f232c558d6f91ae1480f0449a75c362fd2e0a4d..2577879339c47c007f0608f6c466a0726e485c91 100755 (executable)
@@ -165,7 +165,7 @@ fi
 # already ran for pxe installs, but used for vps & updates
 distro=$(distro-name)
 case $distro in
-    ubuntu|debian)
+    ubuntu|debian|trisquel)
         sudo bash -c ". /a/bin/fai/fai-wrapper && /a/bin/fai/fai/config/scripts/GRUB_PC/11-ian"
         ;;
     *)
@@ -209,6 +209,9 @@ $interactive || set -x
 tu /etc/sudoers <<'EOF'
 ian  ALL=(ALL)  NOPASSWD: ALL
 Defaults  env_keep += SUDOD
+# makes ubuntu be like debian
+# https://unix.stackexchange.com/a/91572
+Defaults always_set_home
 EOF
 
 
@@ -216,9 +219,9 @@ EOF
 isfedora && tu /etc/sysctl.conf 'kernel.sysrq = 1'
 
 
-if isdebian; then
-    codename=$(debian-codename)
+if isdeb; then
     if isdebian-stable && has_x; then
+        codename=$(debian-codename)
         s dd of=/etc/apt/sources.list.d/mozilla-iceweasel.list <<EOF
 deb http://mozilla.debian.net/ $codename-backports firefox-release
 deb-src http://mozilla.debian.net/ $codename-backports firefox-release
@@ -336,12 +339,12 @@ EOF
             pi $p
         fi
         ;;&
-    ubuntu|debian)
+    trisquel|ubuntu|debian)
         if has_x; then
-            if isdebian-stable; then
-                pi xmacro
-            else
+            if isdebian-testing; then
                 pi xmacro/unstable # has no unstable deps
+            else
+                pi xmacro
             fi
             pi gtk-redshift xinput
         fi
@@ -505,17 +508,17 @@ EOF
         fi
 
         ;;&
-    ubuntu|debian|fedora)
+    ubuntu|trisquel|debian|fedora)
         if has_x; then
-            if isdebian-stable; then
-                pi xkbset
-            else
+            if isdebian-testing; then
                 # xkbset was in testing for quite a while, dunno
                 # why it\'s not anymore. Sometime I should check and
                 # see if it\'s back in testing, but the unstable package
                 # doesn\'t upgrade anything form testing, and it\'s tiny
                 # so I\'m not bothering to automate it.
                 pi xkbset/unstable
+            else
+                pi xkbset
             fi
         fi
         ;;&
@@ -603,7 +606,6 @@ EOF
     s dd of=/etc/systemd/system/imount.service <<'EOF'
 [Unit]
 Description=Mount /i and related mountpoints
-RequiredBy=syncthing@ian.service
 Before=syncthing@ian.service
 
 [Service]
@@ -611,6 +613,7 @@ Type=oneshot
 ExecStart=/root/imount
 
 [Install]
+RequiredBy=syncthing@ian.service
 # note /kr needs networking, this target is the simplest way to
 # time it when the network should be up, but not do something
 # dumb like delay startup until the network is up. It happens
@@ -674,7 +677,7 @@ else
 fi
 
 if isubuntu; then
-    # disable crash report annoying crap
+    # disable crash report annoying dialogs.
     s dd of=/etc/default/apport <<<'enabled=0'
 fi
 
@@ -777,8 +780,18 @@ EOF
     fi
     pi dmenu
 
-    if isdeb && (tp || x2); then
-        pi task-laptop
+    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
 fi