Преглед на файлове

note in readme that bios/dos boot loading is not supported by the scripts

install git files immediately after initial pacman packages are installed

add inetutils package for hostname command

automatically add battery to tint2 if running on laptop

add symlinks to simplify scripting (pending support testing clone behavior)

introduce systemd alternatives to uncontrollable xdg autostart behavior; relative symlinks need testing

fix some potential space-errors in bash code that computes home paths for root and existing users
Casey DeLorme преди 3 години
родител
ревизия
d591d8b06c

+ 18 - 28
arch.sh

@@ -53,7 +53,18 @@ curl -O https://download.sublimetext.com/sublimehq-pub.gpg && pacman-key --add s
 [ $(grep -c "sublime-text" /etc/pacman.conf) -eq 0 ] && echo -e "\n[sublime-text]\nServer = https://download.sublimetext.com/arch/stable/x86_64" | tee -a /etc/pacman.conf
 
 # update and install all packages
-pacman -Syu --noconfirm sudo bash-completion man-db tmux vim linux-firmware linux-headers dkms smartmontools cryptsetup usbutils btrfs-progs gvfs gvfs-mtp gvfs-afc android-udev dmidecode parted pkgfile pkgconf bison gcc gcc-libs cmake ccache ncurses xmlstarlet jq at bc cronie iptables rsync dhcpcd net-tools openssh sshfs ntp wget curl wireless_tools bluez bluez-utils lzop unzip p7zip xz unrar unace lrzip arj git mercurial subversion bzr postgresql mesa lib32-mesa dbus polkit xorg-server xorg-server-devel xorg-xinit xorg-xinput xorg-xdpyinfo xorg-xprop xdotool xsel pulseaudio libpulse lib32-libpulse openal lib32-openal giflib lib32-giflib mpg123 lib32-mpg123 v4l-utils lib32-v4l-utils opencl-icd-loader lib32-opencl-icd-loader libva lib32-libva gtk3 lib32-gtk3 gst-plugins-base-libs lib32-gst-plugins-base-libs vulkan-tools vulkan-icd-loader lib32-vulkan-icd-loader arandr feh hsetroot openbox archlinux-xdg-menu picom xarchiver innoextract pavucontrol pasystray python2-xdg xdg-utils xdg-user-dirs tint2 conky pcmanfm gmrun rxvt-unicode urxvt-perls gnome-themes-extra gnome-icon-theme arc-gtk-theme gtk-engines gtk-engine-murrine lxappearance graphicsmagick imagemagick lame libwebp libid3tag libvorbis vorbis-tools faac x264 x265 libexif ffmpeg ffmpegthumbnailer tumbler joyutils evtest lm_sensors lshw gparted psensor gparted hardinfo fontconfig ttf-bitstream-vera ttf-droid ttf-dejavu ttf-liberation ttf-hanazono mpv openshot gimp krita transmission-cli discord evince viewnior virtualbox-host-modules-arch virtualbox vagrant obs-studio dia mednafen mame ppsspp lutris steam wine-staging python-pip python-setuptools winetricks sublime-text
+pacman -Syu --noconfirm sudo bash-completion man-db tmux vim linux-firmware linux-headers dkms smartmontools cryptsetup usbutils btrfs-progs gvfs gvfs-mtp gvfs-afc android-udev dmidecode parted pkgfile pkgconf bison gcc gcc-libs cmake ccache ncurses xmlstarlet jq at bc cronie iptables rsync dhcpcd inetutils net-tools openssh sshfs ntp wget curl wireless_tools bluez bluez-utils lzop unzip p7zip xz unrar unace lrzip arj git mercurial subversion bzr postgresql mesa lib32-mesa dbus polkit xorg-server xorg-server-devel xorg-xinit xorg-xinput xorg-xdpyinfo xorg-xprop xdotool xsel pulseaudio libpulse lib32-libpulse openal lib32-openal giflib lib32-giflib mpg123 lib32-mpg123 v4l-utils lib32-v4l-utils opencl-icd-loader lib32-opencl-icd-loader libva lib32-libva gtk3 lib32-gtk3 gst-plugins-base-libs lib32-gst-plugins-base-libs vulkan-tools vulkan-icd-loader lib32-vulkan-icd-loader arandr feh hsetroot openbox archlinux-xdg-menu picom xarchiver innoextract pavucontrol pasystray xdg-utils xdg-user-dirs tint2 conky pcmanfm gmrun rxvt-unicode urxvt-perls gnome-themes-extra gnome-icon-theme arc-gtk-theme gtk-engines gtk-engine-murrine lxappearance graphicsmagick imagemagick lame libwebp libid3tag libvorbis vorbis-tools faac x264 x265 libexif ffmpeg ffmpegthumbnailer tumbler joyutils evtest lm_sensors lshw gparted psensor gparted hardinfo fontconfig ttf-bitstream-vera ttf-droid ttf-dejavu ttf-liberation ttf-hanazono mpv openshot gimp krita transmission-cli discord evince viewnior virtualbox-host-modules-arch virtualbox vagrant obs-studio dia mednafen mame ppsspp lutris steam wine-staging python-pip python-setuptools winetricks sublime-text stress
+
+# install base configuration files from repository
+[ -d /srv/arch-desktop/install ] || git clone https://git.caseydelorme.com/cdelorme/arch-desktop /srv/arch-desktop
+rsync -Pav /srv/arch-desktop/install/ /
+mkdir -p /etc/skel/.config/pulse
+mkdir -p /etc/skel/{desktop,downloads,public,public/templates,documents,music,pictures,videos,git}
+sed "/module-suspend-on-idle/d" /etc/pulse/default.pa > /etc/skel/.config/pulse/default.pa
+# @note: we may want to avoid disabling this on laptops
+sed -i "/module-switch-on-port-available/d" /etc/skel/.config/pulse/default.pa
+rsync -Pav /etc/skel/ "$(getent passwd root | cut -d: -f6)/"
+sed -i "/ssh-add/d" "$(getent passwd root | cut -d: -f6)/.bashrc"
 
 # if the active network device is wireless install connman
 [ -d "/sys/class/net/${active_network_device}/wireless" ] && pacman -Syu connman wpa_supplicant openvpn ethtool iwd pptpclient && systemctl enable connman
@@ -97,6 +108,7 @@ echo "${aur_username} ALL= NOPASSWD: /usr/bin/pacman" > /etc/sudoers.d/${aur_use
 export chassistype=$(dmidecode --string chassis-type)
 if [[ "$chassistype" = "Laptop" || "$chassistype" = "Portable" || "$chassistype" = "Notebook" || "$chassistype" = "Sub Notebook" ]]; then
 	pacman -Syu --noconfirm xf86-input-synaptics acpid hdparm sdparm acpilight connman wpa_supplicant openvpn ethtool iwd pptpclient tlp
+	sed "s/panel_items = LTSC/panel_items = LTSBC/g" /etc/.config/tint2/tint2rc > /etc/.config/tint2/tint2rc
 	systemctl enable connman
 	systemctl enable acpid
 fi
@@ -130,14 +142,6 @@ if ! which gifduration &> /dev/null; then
 	chmod a+rx /usr/local/bin/gifduration
 fi
 
-# install prime95
-if ! which mprime &> /dev/null; then
-	curl -Lfs "http://www.mersenne.org/ftp_root/gimps/p95v294b8.linux64.tar.gz" > /tmp/prime.tar.gz
-	mkdir -p /usr/local/src/prime/
-	tar -xf /tmp/prime.tar.gz -C /usr/local/src/prime
-	ln -sf /usr/local/src/prime/mprime /usr/local/bin/
-fi
-
 # install packer
 if ! which packer &> /dev/null; then
 	curl -Lfs "https://releases.hashicorp.com/packer/1.3.5/packer_1.3.5_linux_amd64.zip" > /tmp/packer.zip
@@ -157,16 +161,6 @@ fi
 groupadd -fr sudo
 [ ! -f /etc/sudoers.d/sudo ] && echo '%sudo ALL=(ALL) ALL' > /etc/sudoers.d/sudo
 
-# install base configuration files from repository
-[ -d /srv/arch-desktop/install ] || git clone https://git.caseydelorme.com/cdelorme/arch-desktop /srv/arch-desktop
-rsync -Pav /srv/arch-desktop/install/ /
-ln -sf .Xdefaults /etc/skel/.Xresources
-mkdir -p /etc/skel/.config/pulse
-sed "/module-suspend-on-idle/d" /etc/pulse/default.pa > /etc/skel/.config/pulse/default.pa
-# @note: we may want to avoid disabling this on laptops
-sed "/module-switch-on-port-available/d" /etc/pulse/default.pa > /etc/skel/.config/pulse/default.pa
-rsync -Pav /etc/skel/ $(getent passwd root | cut -d: -f6)/
-
 # update font cache
 fc-cache -fr
 
@@ -200,7 +194,7 @@ if [[ -n "$username" && -n "$password" ]]; then
 		useradd -m -s /bin/bash $username
 		echo "${username}:${password}" | chpasswd -c SHA256
 	else
-		[ $EUID -ne 0 ] && rsync -Pav /etc/skel/ $(getent passwd $username | cut -d: -f6)/
+		[ $EUID -ne 0 ] && rsync -Pav /etc/skel/ "$(getent passwd $username | cut -d: -f6)/"
 	fi
 
 	# add user to standard groups
@@ -210,17 +204,13 @@ if [[ -n "$username" && -n "$password" ]]; then
 	systemctl start postgresql
 	su postgres -c "cd && createuser -ds $username" 2> /dev/null && su $username -c "cd && createdb"
 
-	# configure and generate xdg-user-dirs
-	su $username -c "cd && mkdir -p ~/{desktop,downloads,public,documents,music,pictures,videos,git} && xdg-user-dirs-update"
+	# load xdg-user-dirs
+	su $username -c "cd && xdg-user-dirs-update"
 	update-desktop-database
 
 	# generate default (passwordless) ed25519 ssh key if none exists
 	su $username -c "cd; if [ ! -f ~/.ssh/id_ed25519 ]; then ssh-keygen -q -t ed25519 -N '' -f ~/.ssh/id_ed25519 && cd && chmod 600 ~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519.pub; fi"
 
-	# @note: during arch installation systemd will ignore chroot start for user
-	# so we have to take the manual route of generating the target symlink.
-	su $username -c 'cd; mkdir $HOME/.config/systemd/user/default.target.wants; ln -fs $HOME/.config/systemd/user/ssh-agent.service $HOME/.config/systemd/user/default.target.wants/ssh-agent.service'
-
 	# install gvm loading from ~/.bash_profile, and the latest go version
 	su $username -c "if [ ! -d ~/.gvm ]; then GVM_NO_UPDATE_PROFILE=1 bash < <(curl -Ls https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer 2> /dev/null); fi"
 	su $username -c 'grep "gvm" ~/.bash_profile &> /dev/null || echo -e "\n# load gvm\n! which gvm &> /dev/null && . ~/.gvm/scripts/gvm" >> ~/.bash_profile'
@@ -238,8 +228,8 @@ if [[ -n "$username" && -n "$password" ]]; then
 fi
 
 # symlink shceduled maintenance tasks
-ln -sf /usr/local/bin/system-updates /etc/cron.daily/
-ln -sf /usr/local/bin/disk-maintenance /etc/cron.weekly/
+ln -sf /usr/local/bin/system-updates /etc/cron.daily/system-updates
+ln -sf /usr/local/bin/disk-maintenance /etc/cron.weekly/disk-maintenance
 
 # symlink override vi to vim
 ln -sf /usr/bin/vim /usr/local/bin/vi

+ 3 - 0
install/etc/skel/.bash_profile

@@ -3,5 +3,8 @@
 # add local bin to path
 export PATH=/usr/local/bin:$PATH
 
+# add Xresources symlink if not exists
+[ ! -f "$HOME/.Xresources" ] && ln -s "$HOME/.Xdefaults" "$HOME/.Xresources"
+
 # if bashrc exists and the terminal has stdin load it
 test -t 0 && . "$HOME/.bashrc"

+ 1 - 2
install/etc/skel/.config/conky/conky.conf

@@ -1,5 +1,4 @@
 conky.config = {
-    background = true,
     update_interval = 2.0,
     cpu_avg_samples = 5,
     net_avg_samples = 5,
@@ -14,7 +13,7 @@ conky.config = {
     override_utf8_locale = true,
     default_color = '6CBE6C',
     own_window = true,
-    own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
+    own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager,above',
     own_window_transparent = false,
     own_window_argb_visual = true,
     own_window_argb_value = 80,

+ 1 - 10
install/etc/skel/.config/openbox/autostart

@@ -2,15 +2,6 @@
 (xset r rate 250 25; xset b off; xset m 7 5)
 (xset s 0 0; xset s noexpose; xset s noblank; xset s off; xset -dpms)
 xrdb -merge "$HOME/.Xresources"
+hsetroot -solid "#001E27"
 (update-desktop-database)
 (xdg-user-dirs-update)
-(picom) &
-
-# give the desktop time to launch
-(
-	sleep 3;
-	hsetroot -solid "#001E27" &
-	tint2 &
-	wallpaper &
-	conky -d -q &
-) &

+ 12 - 0
install/etc/skel/.config/systemd/user/conky.service

@@ -0,0 +1,12 @@
+[Unit]
+Description=Conky Status Window
+PartOf=graphical-session.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/conky
+Restart=on-failure
+RestartSec=3
+
+[Install]
+WantedBy=xsession.target

+ 1 - 0
install/etc/skel/.config/systemd/user/default.target.wants/ssh-agent.service

@@ -0,0 +1 @@
+../ssh-agent.service

+ 10 - 0
install/etc/skel/.config/systemd/user/openbox-autostart.service

@@ -0,0 +1,10 @@
+[Unit]
+Description=Openbox autostart script
+PartOf=graphical-session.target
+
+[Service]
+Type=oneshot
+ExecStart=%h/.config/openbox/autostart
+
+[Install]
+WantedBy=xsession.target

+ 12 - 0
install/etc/skel/.config/systemd/user/pasystray.service

@@ -0,0 +1,12 @@
+[Unit]
+Description=Pulse Audio System Tray Menu
+PartOf=graphical-session.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/pasystray
+Restart=on-failure
+RestartSec=3
+
+[Install]
+WantedBy=xsession.target

+ 12 - 0
install/etc/skel/.config/systemd/user/picom.service

@@ -0,0 +1,12 @@
+[Unit]
+Description=Picom window composite manager
+PartOf=graphical-session.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/picom
+Restart=on-failure
+RestartSec=3
+
+[Install]
+WantedBy=xsession.target

+ 12 - 0
install/etc/skel/.config/systemd/user/tint2.service

@@ -0,0 +1,12 @@
+[Unit]
+Description=Tint2 Menu
+PartOf=graphical-session.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/tint2
+Restart=on-failure
+RestartSec=3
+
+[Install]
+WantedBy=xsession.target

+ 12 - 0
install/etc/skel/.config/systemd/user/wallpaper.service

@@ -0,0 +1,12 @@
+[Unit]
+Description=Cycle Desktop Wallpaper
+PartOf=graphical-session.target
+
+[Service]
+Type=simple
+ExecStart=/usr/local/bin/wallpaper
+Restart=on-failure
+RestartSec=3
+
+[Install]
+WantedBy=xsession.target

+ 3 - 0
install/etc/skel/.config/systemd/user/xsession.target

@@ -0,0 +1,3 @@
+[Unit]
+Description=Xsession started
+BindsTo=graphical-session.target

+ 1 - 0
install/etc/skel/.config/systemd/user/xsession.target.wants/conky.service

@@ -0,0 +1 @@
+../conky.service

+ 1 - 0
install/etc/skel/.config/systemd/user/xsession.target.wants/openbox-autostart.service

@@ -0,0 +1 @@
+../openbox-autostart.service

+ 1 - 0
install/etc/skel/.config/systemd/user/xsession.target.wants/pasystray.service

@@ -0,0 +1 @@
+../pasystray.service

+ 1 - 0
install/etc/skel/.config/systemd/user/xsession.target.wants/picom.service

@@ -0,0 +1 @@
+../picom.service

+ 1 - 0
install/etc/skel/.config/systemd/user/xsession.target.wants/tint2.service

@@ -0,0 +1 @@
+../tint2.service

+ 1 - 0
install/etc/skel/.config/systemd/user/xsession.target.wants/wallpaper.service

@@ -0,0 +1 @@
+../wallpaper.service

+ 4 - 1
install/etc/skel/.xinitrc

@@ -1,2 +1,5 @@
 [ -f ~/.screenlayout/default.sh ] && . ~/.screenlayout/default.sh
-exec openbox-session
+/etc/X11/xinit/xinitrc.d/50-systemd-user.sh
+systemctl --user import-environment PATH DBUS_SESSION_BUS_ADDRESS
+systemctl --no-block --user start xsession.target
+exec openbox

+ 1 - 1
readme.md

@@ -48,7 +48,7 @@ The pinned comments on the AUR are offensive to beginners and do not answer any
 
 The `makepkg` restriction that prevents execution as root is dumb as hell.  I get the security constraints, but the instructions to run as nobody are hella flawed; test suites basically can't run as nobody due to directory permissions (so many with loads of undocumented ENV variables), and creating a faux user from a script just to install some relatively common and popular packages seems like a ridiculous work-around.  So great job making automation harder and solving nothing.
 
-Finally, while I am not a fan of how `systemd` forced proliferation into all linux distributions, nor do I care for binary logs (_that seems like a major step backwards_), I am incredibly thankful for how simple `bootctl` made EFI bootloader setup, and also user-space unit files.  _I only wish there was a more clear way to deal with setting up user-space files from scripts during arch installation._
+Finally, while I am not a fan of how `systemd` forced proliferation into all linux distributions, nor do I care for binary logs (_that seems like a major step backwards_), I am incredibly thankful for how simple `bootctl` made EFI bootloader setup, and also user-space unit files.  However, this also means traditional DOS/BIOS boot loaders such as grub are not supported by these scripts.  _I only wish there was a more clear way to deal with setting up user-space files from scripts during arch installation._
 
 
 # references

+ 1 - 1
setup/install.sh

@@ -79,7 +79,7 @@ mount "/dev/${partitions[0]}" /mnt/boot
 
 # install base and base-devel package sets, and generate the fstab
 pacstrap /mnt base base-devel
-genfstab -U -p /mnt >> /mnt/etc/fstab
+genfstab -Up /mnt > /mnt/etc/fstab
 
 # this assumes that arch.sh and install/ exist and will copy them to continue
 # @note: would prefer to copy to `/tmp` but `/mnt/tmp` from iso is a separate tmpfs