From 49de04a67a2946267ff85b7d4500c16552617eaa Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Thu, 30 Mar 2023 18:14:13 -0400 Subject: [PATCH] Change system+login shell to Dash, add zsh and configuration --- README.md | 7 +-- chrootInstall.sh | 29 +++++++---- config-files/bashrc | 1 + config-files/dash-link.hook | 11 ++++ config-files/konsolerc | 5 ++ config-files/modemmanager-hook | 11 ---- config-files/modemmanager.hook | 11 ++++ .../{nvidia-hook-lts => nvidia-lts.hook} | 1 - config-files/{nvidia-hook => nvidia.hook} | 1 - ...accache-clean-hook => paccache-clean.hook} | 0 config-files/{bash_profile => shell-profile} | 9 +--- config-files/zshrc | 52 +++++++++++++++++++ install.sh | 4 +- programs/pipewire-start/pipewire-start.sh | 2 +- programs/plasma-blank/plasmablank-root.sh | 2 +- programs/plasma-blank/plasmablank.sh | 2 +- programs/powerset/powerset.sh | 4 +- .../xcaffeine.desktop | 0 .../{xcaffeine => xcaffeine.old}/xcaffeine.sh | 0 19 files changed, 112 insertions(+), 40 deletions(-) create mode 100644 config-files/dash-link.hook create mode 100644 config-files/konsolerc delete mode 100644 config-files/modemmanager-hook create mode 100644 config-files/modemmanager.hook rename config-files/{nvidia-hook-lts => nvidia-lts.hook} (80%) mode change 100755 => 100644 rename config-files/{nvidia-hook => nvidia.hook} (79%) rename config-files/{paccache-clean-hook => paccache-clean.hook} (100%) rename config-files/{bash_profile => shell-profile} (70%) create mode 100644 config-files/zshrc rename programs/{xcaffeine => xcaffeine.old}/xcaffeine.desktop (100%) rename programs/{xcaffeine => xcaffeine.old}/xcaffeine.sh (100%) diff --git a/README.md b/README.md index f98aaf1..229cbaa 100755 --- a/README.md +++ b/README.md @@ -7,9 +7,10 @@ Some major/noteworthy differences from common configurations: - pipewire is used in place of pulseaudio - OpenRC is the chosen init system - EXT4 fast_commit mode is enabled by default -- makepkg is configured for better than stock performance -- a custom .bashrc with useful power management aliases is included -- ...all of this and more on KDE Plasma (Wayland) +- makepkg is configured for better than stock performance and uses more space-efficient compression +- dash is used as the system and login shell +- custom zshrc and bashrc files are included with useful system management aliases +- ...all of this and more on KDE Plasma Wayland # Usage Upon loading up the official Artix base ISO (tested on weekly base images only), logging in, connecting to the internet, and switching to the root user, run: diff --git a/chrootInstall.sh b/chrootInstall.sh index d2e3929..9c21af8 100755 --- a/chrootInstall.sh +++ b/chrootInstall.sh @@ -28,7 +28,7 @@ rc-update add NetworkManager # bootloader installation and configuration pacman -S grub efibootmgr os-prober mtools dosfstools --noconfirm if [ "$boot" == 1 ]; then - grub-install --target=x86_64-efi --efi-directory=/boot/EFI --bootloader-id=GRUB-rwinkhart --recheck + grub-install --target=x86_64-efi --efi-directory=/boot/EFI --bootloader-id=GRUB --recheck fi if [ "$boot" == 2 ]; then grub-install --target=i386-pc "$disk" @@ -63,19 +63,26 @@ permit nopass $username as root cmd /usr/bin/reboot curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/config-files/doas-completion -o /usr/share/bash-completion/completions/doas ln -s /usr/bin/doas /usr/bin/sudo -# misc. configuration -curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/config-files/makepkg.conf -o /etc/makepkg.conf +# shell configuration +curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/config-files/shell-profile -o /home/"$username"/.profile curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/config-files/bashrc -o /home/"$username"/.bashrc -chown "$username":"$users" /home/"$username"/.bashrc +curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/config-files/zshrc -o /home/"$username"/.zshrc +chown "$username":users /home/"$username"/{.profile,.bashrc,.zshrc} +chsh -s /bin/dash "$username" +ln -sfT dash /usr/bin/sh +pacman -Sy zsh zsh-autosuggestions zsh-syntax-highlighting openrc-zsh-completions --noconfirm # pacman configuration curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/config-files/pacman.conf -o /etc/pacman.conf -pacman -Sy yay pacman-contrib --noconfirm +curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/config-files/makepkg.conf -o /etc/makepkg.conf +pacman -S pacman-contrib --noconfirm mkdir -p /etc/pacman.d/hooks -curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/config-files/paccache-clean-hook -o /etc/pacman.d/hooks/paccache-clean.hook -curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/config-files/modemmanager-hook -o /etc/pacman.d/hooks/modemmanager.hook +curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/config-files/paccache-clean.hook -o /etc/pacman.d/hooks/paccache-clean.hook +curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/config-files/modemmanager.hook -o /etc/pacman.d/hooks/modemmanager.hook +curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/config-files/dash-link.hook -o /etc/pacman.d/hooks/dash-link.hook if [ "$gpu" == 'NVIDIA' ]; then - curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/config-files/nvidia-hook -o /etc/pacman.d/hooks/nvidia.hook + curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/config-files/nvidia.hook -o /etc/pacman.d/hooks/nvidia.hook + curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/config-files/nvidia-lts.hook -o /etc/pacman.d/hooks/nvidia-lts.hook fi # installing hardware-specific packages @@ -123,10 +130,12 @@ chmod 755 /home/"$username"/{.config,.local/share} if [ "$formfactor" == 1 ] || [ "$formfactor" == 2 ] || [ "$formfactor" == 3 ]; then pacman -S plasma-desktop plasma-wayland-session plasma-wayland-protocols kscreen kwallet-pam kdeplasma-addons spectacle gwenview plasma-nm plasma-pa breeze-gtk kde-gtk-config kio-extras khotkeys kwalletmanager yakuake ark kate bluedevil dolphin qt5-imageformats pipewire pipewire-pulse pipewire-jack pipewire-alsa wireplumber wayland-protocols polkit micro bluez-openrc --needed --noconfirm curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/config-files/pam-login -o /etc/pam.d/login - echo -e "if [ -z \$DISPLAY ] && [ "\$\(tty\)" = "/dev/tty1" ]; then exec dbus-run-session startplasma-wayland; fi" >> /home/"$username"/.bash_profile + curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/config-files/konsolerc -o /home/"$username"/.config/konsolerc + chmod 755 /home/"$username"/.config/konsolerc + chown "$username":users /home/"$username"/.config/konsolerc fi -mkdir -p /home/"$username"/.config/autostart/ +mkdir /home/"$username"/.config/autostart curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/programs/pipewire-start/pipewire.desktop -o /home/"$username"/.config/autostart/pipewire.desktop curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/programs/powerset/powerset.sh -o /usr/local/bin/powerset.sh curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/programs/pipewire-start/pipewire-start.sh -o /usr/local/bin/pipewire-start.sh diff --git a/config-files/bashrc b/config-files/bashrc index 8b69a73..27314ed 100755 --- a/config-files/bashrc +++ b/config-files/bashrc @@ -13,5 +13,6 @@ alias schedutil='doas /usr/local/bin/powerset.sh schedutil' alias ondemand='doas /usr/local/bin/powerset.sh ondemand' alias poweroff='doas /usr/bin/poweroff' alias reboot='doas /usr/bin/reboot' +alias blank='/usr/local/bin/plasmablank.sh' PS1='\[\e[36m\]\u\[\e[0m\]@\[\e[36m\]\h:\[\e[0m\]\W\[\e[36m\]|$\[\e[0m\] ' diff --git a/config-files/dash-link.hook b/config-files/dash-link.hook new file mode 100644 index 0000000..ed08b69 --- /dev/null +++ b/config-files/dash-link.hook @@ -0,0 +1,11 @@ +[Trigger] +Type = Package +Operation = Install +Operation = Upgrade +Target = bash + +[Action] +Description = Re-pointing /bin/sh symlink to dash... +When = PostTransaction +Exec = /usr/bin/ln -sfT dash /usr/bin/sh +Depends = dash diff --git a/config-files/konsolerc b/config-files/konsolerc new file mode 100644 index 0000000..21e3b2c --- /dev/null +++ b/config-files/konsolerc @@ -0,0 +1,5 @@ +[Desktop Entry] +DefaultProfile=Custom.profile + +[General] +ConfigVersion=1 diff --git a/config-files/modemmanager-hook b/config-files/modemmanager-hook deleted file mode 100644 index d4b0bca..0000000 --- a/config-files/modemmanager-hook +++ /dev/null @@ -1,11 +0,0 @@ -[Trigger] -Operation=Install -Operation=Upgrade -Type=Package -Target=modemmanager - -[Action] -Description=Re-disable ModemManager DBUS service after upgrade. -When=PostTransaction -NeedsTargets -Exec=/bin/sh -c 'echo -e "[D-BUS Service]\nName=org.freedesktop.ModemManager1\nExec=/bin/false\nUser=root\nSystemdService=dbus-org.freedesktop.ModemManager1.service" > /usr/share/dbus-1/system-services/org.freedesktop.ModemManager1.service' diff --git a/config-files/modemmanager.hook b/config-files/modemmanager.hook new file mode 100644 index 0000000..b0e53c5 --- /dev/null +++ b/config-files/modemmanager.hook @@ -0,0 +1,11 @@ +[Trigger] +Operation=Install +Operation=Upgrade +Type=Package +Target=modemmanager + +[Action] +Description=Re-disable ModemManager DBUS service after upgrade. +When=PostTransaction +NeedsTargets +Exec=/bin/sh -c 'printf "[D-BUS Service]\nName=org.freedesktop.ModemManager1\nExec=/bin/false\nUser=root\nSystemdService=dbus-org.freedesktop.ModemManager1.service" > /usr/share/dbus-1/system-services/org.freedesktop.ModemManager1.service' diff --git a/config-files/nvidia-hook-lts b/config-files/nvidia-lts.hook old mode 100755 new mode 100644 similarity index 80% rename from config-files/nvidia-hook-lts rename to config-files/nvidia-lts.hook index 733c434..aff92a2 --- a/config-files/nvidia-hook-lts +++ b/config-files/nvidia-lts.hook @@ -5,7 +5,6 @@ Operation=Remove Type=Package Target=nvidia-lts Target=linux-lts -# Change the linux part above and in the Exec line if a different kernel is used [Action] Description=Update Nvidia module in initcpio diff --git a/config-files/nvidia-hook b/config-files/nvidia.hook similarity index 79% rename from config-files/nvidia-hook rename to config-files/nvidia.hook index d7c1cc8..a0bc6cc 100755 --- a/config-files/nvidia-hook +++ b/config-files/nvidia.hook @@ -5,7 +5,6 @@ Operation=Remove Type=Package Target=nvidia Target=linux -# Change the linux part above and in the Exec line if a different kernel is used [Action] Description=Update Nvidia module in initcpio diff --git a/config-files/paccache-clean-hook b/config-files/paccache-clean.hook similarity index 100% rename from config-files/paccache-clean-hook rename to config-files/paccache-clean.hook diff --git a/config-files/bash_profile b/config-files/shell-profile similarity index 70% rename from config-files/bash_profile rename to config-files/shell-profile index 91c5aca..2adeb9d 100644 --- a/config-files/bash_profile +++ b/config-files/shell-profile @@ -1,6 +1,4 @@ -# -# ~/.bash_profile -# +#!/bin/sh # WAYLAND ENV export MOZ_ENABLE_WAYLAND=1 @@ -13,14 +11,11 @@ export XDG_STATE_HOME="$HOME"/.local/state export XDG_CACHE_HOME="$HOME"/.cache # DOTFILE MANAGEMENT -export HISTFILE="${XDG_STATE_HOME}"/bash/history export CUDA_CACHE_PATH="$XDG_CACHE_HOME"/nv export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc export LESSHISTFILE="$XDG_CACHE_HOME"/less/history export EDITOR=micro export BUILDDIR=/tmp/makepkg -export HISTSIZE=10000 -export HISTFILESIZE=100000 -if [ -z $DISPLAY ] && [ $(tty) = /dev/tty6 ]; then exec setterm --blank=force; exit; fi +[ -z $DISPLAY ] && [ $(tty) = /dev/tty1 ] && exec dbus-run-session startplasma-wayland diff --git a/config-files/zshrc b/config-files/zshrc new file mode 100644 index 0000000..3aeada4 --- /dev/null +++ b/config-files/zshrc @@ -0,0 +1,52 @@ +# Lines configured by zsh-newuser-install +HISTFILE=~/.local/share/zsh/histfile +HISTSIZE=1000 +SAVEHIST=1000 +unsetopt beep +bindkey -e +# End of lines configured by zsh-newuser-install +# The following lines were added by compinstall +zstyle :compinstall filename '/home/cuan/.zshrc' +autoload -Uz compinit +compinit +# End of lines added by compinstall +# The following lines represent custom user configuration +art_cat='%F{214}/\_,_/\ +\ 0 0 /%f' +art_dog=' %F{222}/___/ +| 6.6 |%f' +art_snail=' %F{114}|_/ +/o o\%f' +art_bunny=' /_/ +|^.^|' +art_jellyfish='%F{183}<===> +//|\\%f' +art_school=' %F{214}<°))>< %F{222}><(((.> +%F{114}><(((°> %F{183}><((((°>%f' +art_array=("$art_cat" "$art_dog" "$art_snail" "$art_bunny" "$art_jellyfish" "$art_school") +print -Pr "$art_array[$((RANDOM%6+1))]" +PS1='%F{cyan}%n%f@%F{cyan}%m:%f%1~%f%F{cyan}|%#%f ' +source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh +bindkey '^[[H' beginning-of-line +bindkey '^[[F' end-of-line +bindkey '^[[3~' delete-char +function yakuake_clear() { + clear + print -Pr "$art_array[$((RANDOM%6+1))]" + print -Pn $PS1 +} +zle -N zsh-redraw yakuake_clear +bindkey "^L" zsh-redraw +# End of lines representing custom user configuration +# The following lines represent custom user aliases +alias ls='ls --color=auto' +alias orphans='doas pacman -Rcns $(pacman -Qqdt)' +alias powersave='doas /usr/local/bin/powerset.sh powersave' +alias performance='doas /usr/local/bin/powerset.sh performance' +alias schedutil='doas /usr/local/bin/powerset.sh schedutil' +alias ondemand='doas /usr/local/bin/powerset.sh ondemand' +alias poweroff='doas /usr/bin/poweroff' +alias reboot='doas /usr/bin/reboot' +alias blank='/usr/local/bin/plasmablank.sh' +# End of lines representing custom user aliases diff --git a/install.sh b/install.sh index 933c07c..8737d8e 100755 --- a/install.sh +++ b/install.sh @@ -3,7 +3,7 @@ loadkeys us echo ---------------------------------------------------------------------------------------------- echo rwinkhart\'s artix install script -echo last updated march 07, 2023 +echo last updated march 30, 2023 echo ---------------------------------------------------------------------------------------------- echo You will be asked some questions before installation. echo -e "----------------------------------------------------------------------------------------------\n" @@ -164,7 +164,7 @@ echo "$hostname" > /mnt/etc/hostname echo "hostname=\'"$hostname"\'" > /mnt/etc/conf.d/hostname # installing base packages -base_devel='db diffutils gc guile libisl libmpc perl autoconf automake bash binutils bison esysusers etmpfiles fakeroot file findutils flex gawk gcc gettext grep groff gzip libtool m4 make pacman pacman-contrib patch pkgconf python sed opendoas texinfo which bc udev' +base_devel='db diffutils gc guile libisl libmpc perl autoconf automake bash dash binutils bison esysusers etmpfiles fakeroot file findutils flex gawk gcc gettext grep groff gzip libtool m4 make pacman pacman-contrib patch pkgconf python sed opendoas texinfo which bc udev' basestrap /mnt base $base_devel openrc elogind-openrc linux linux-firmware git micro man-db bash-completion # exporting variables diff --git a/programs/pipewire-start/pipewire-start.sh b/programs/pipewire-start/pipewire-start.sh index 3eb9cdf..a74c1bb 100755 --- a/programs/pipewire-start/pipewire-start.sh +++ b/programs/pipewire-start/pipewire-start.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh /usr/bin/pipewire & /usr/bin/pipewire-pulse & /usr/bin/wireplumber diff --git a/programs/plasma-blank/plasmablank-root.sh b/programs/plasma-blank/plasmablank-root.sh index f8611bc..ff513e9 100755 --- a/programs/plasma-blank/plasmablank-root.sh +++ b/programs/plasma-blank/plasmablank-root.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh timeout 5s ydotoold & sleep 1 ydotool key 1:1 1:0 diff --git a/programs/plasma-blank/plasmablank.sh b/programs/plasma-blank/plasmablank.sh index 05c0ebb..295355e 100755 --- a/programs/plasma-blank/plasmablank.sh +++ b/programs/plasma-blank/plasmablank.sh @@ -1,3 +1,3 @@ -#!/usr/bin/env bash +#!/bin/sh qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock doas /usr/local/bin/plasmablank-root.sh diff --git a/programs/powerset/powerset.sh b/programs/powerset/powerset.sh index 6131ba2..ada9bdc 100755 --- a/programs/powerset/powerset.sh +++ b/programs/powerset/powerset.sh @@ -1,5 +1,5 @@ -#!/usr/bin/env bash +#!/bin/sh for CPU in $(seq 0 $(($(nproc) - 1))); do - echo $1 > /sys/devices/system/cpu/cpu"$CPU"/cpufreq/scaling_governor + printf $1 > /sys/devices/system/cpu/cpu"$CPU"/cpufreq/scaling_governor cat /sys/devices/system/cpu/cpu"$CPU"/cpufreq/scaling_governor done diff --git a/programs/xcaffeine/xcaffeine.desktop b/programs/xcaffeine.old/xcaffeine.desktop similarity index 100% rename from programs/xcaffeine/xcaffeine.desktop rename to programs/xcaffeine.old/xcaffeine.desktop diff --git a/programs/xcaffeine/xcaffeine.sh b/programs/xcaffeine.old/xcaffeine.sh similarity index 100% rename from programs/xcaffeine/xcaffeine.sh rename to programs/xcaffeine.old/xcaffeine.sh