From f8d380472d95099e67c37f72d2d8c7590546a536 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Thu, 3 Jul 2025 21:51:49 -0400 Subject: Add inital script for setting up Devuan --- distro/devuan.sh | 200 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 distro/devuan.sh (limited to 'distro') diff --git a/distro/devuan.sh b/distro/devuan.sh new file mode 100644 index 0000000..eb5a951 --- /dev/null +++ b/distro/devuan.sh @@ -0,0 +1,200 @@ +#!/bin/sh +# distro/devuan.sh +echo "This script is designed to be run twice, once as root ( e.g. 'su -' )" +echo "Then again as your normal user without sudo, it will call sudo as needed" +if [ "$(id -u)" -eq 0 ] ; then + if ! grep -q 'EDITOR=' ~/.bashrc ; then + echo "EDITOR=vi" >> ~/.bashrc + fi + echo '%sudo ALL=(ALL:ALL) ALL' > /etc/sudoers.d/sudo_enable + printf "Enter username to add to sudo group (enter to skip): " + read -r _un + if ! [ -z "$_un" ] ; then + gpasswd -a "$_un" sudo + else + echo skipping... + fi + touch /etc/.sudo_configured + echo "now run as a regular user" + exit 0 +else + if ! [ -r /etc/.sudo_configured ] ; then + echo "Run as root first, then as a regular user" + exit 1 + fi +fi +set -ex + +codedir="$HOME/scm/pub" +nvimdir="${codedir}/neovim-nvim" +_nvim_msg=0 +okshdir="${codedir}/ibara-oksh" + +dwmdir="${codedir}/x/dwm" +dwmStdir="${codedir}/x/st" +dwmDmenudir="${codedir}/x/dmenu" +dwmSesdir="${codedir}/x/session" + +BRAVE="${BRAVE:-yes}" +NVIM="${NVIM:-yes}" +OKSH="${OKSH:-yes}" +PACKAGES="${PACKAGES:-yes}" +FONTS="${FONTS:-yes}" +DWM="${DWM:-no}" + +if [ "$PACKAGES" = yes ] ; then +# Get rid of the CDROM source, lol +sudo sed -i '/cdrom:/d' /etc/apt/sources.list + +sudo apt update + +sudo apt install -y git curl \ + tmux \ + htop \ + neofetch \ + oathtool \ + pavucontrol \ + scdaemon \ + vim \ + evemu-tools \ + evtest \ + libarchive-tools \ + evolution \ + gimp \ + git-lfs \ + ncdu \ + nload \ + pv \ + pwgen \ + ripgrep \ + wireguard-tools \ + zstd \ + dunst \ + xclip \ + restic \ + tree \ + + +fi + +if [ "$NVIM" = yes ] ; then + sudo apt build-dep -y neovim + + if ! [ -d "$nvimdir" ] ; then + git clone https://github.com/neovim/neovim "$nvimdir" + fi + cd "$nvimdir" + git fetch --tags + git checkout v0.11.2 + rm -rf build || echo "" + make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$HOME/.local" -j"$(nproc)" + make install + cd - + + _paq_dir="${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/pack/paqs/start/paq-nvim + if ! [ -d "$_paq_dir" ] ; then + git clone --depth=1 https://github.com/savq/paq-nvim.git "$_paq_dir" + _nvim_msg=1 + fi +fi + +if [ "$OKSH" = yes ] ; then + if ! [ -d "$okshdir" ] ; then + git clone https://github.com/ibara/oksh "$okshdir" + fi + cd "$okshdir" + git checkout oksh-7.6 + ./configure + make + sudo make install + cd - + + if ! grep /usr/local/bin/oksh /etc/shells ; then + sudo sh -c 'echo /usr/local/bin/oksh >> /etc/shells' + fi + + if ! grep -qF 'export ENV=$HOME/.kshrc' ~/.profile; then + echo 'export ENV=$HOME/.kshrc' >> ~/.profile + fi + + set +x + if ! grep ^$(id -un) /etc/passwd | grep /usr/local/bin/oksh ; then + printf "Change shell to oksh? [y]es/[n]o: " + read -r resp + if [ "$resp" = "y" ] ; then + chsh -s /usr/local/bin/oksh + fi + fi + set -x + + +fi + +if [ "$BRAVE" = yes ] ; then +sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg \ + https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg + +sudo curl -fsSLo /etc/apt/sources.list.d/brave-browser-release.sources \ + https://brave-browser-apt-release.s3.brave.com/brave-browser.sources + +sudo apt update + +sudo apt install -y brave-browser + +fi + +if [ "$FONTS" = yes ] ; then + if ! [ -d ~/.fonts ]; then + git clone https://git.riedstra.dev/mitch/fonts ~/.fonts + fi + sudo rm /etc/fonts/conf.d/70-no-bitmaps.conf || echo "" +fi + +if [ "$DWM" = yes ] ; then + sudo apt -y install compton + sudo apt -y build-dep dwm st + + if ! [ -d "$dwmdir" ] ; then + git clone https://git.riedstra.dev/x/dwm "$dwmdir" + fi + cd "$dwmdir" + make + sudo make clean install + cd - + + if ! [ -d "$dwmStdir" ] ; then + git clone https://git.riedstra.dev/x/st "$dwmStdir" + fi + cd "$dwmStdir" + make + sudo make clean install + cd - + + if ! [ -d "$dwmDmenudir" ] ; then + git clone https://git.riedstra.dev/x/dmenu "$dwmDmenudir" + fi + cd "$dwmDmenudir" + make + sudo make clean install + cd - + + if ! [ -d "$dwmSesdir" ] ; then + git clone https://git.riedstra.dev/x/session "$dwmSesdir" + fi + cd "$dwmSesdir" + sudo make install + cd - + + if ! [ -f ~/.xinitrc ] ; then +cat > ~/.xinitrc < Date: Fri, 4 Jul 2025 10:36:53 -0400 Subject: Add a note about rusticl --- distro/devuan.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'distro') diff --git a/distro/devuan.sh b/distro/devuan.sh index eb5a951..8e32dbb 100644 --- a/distro/devuan.sh +++ b/distro/devuan.sh @@ -41,6 +41,9 @@ OKSH="${OKSH:-yes}" PACKAGES="${PACKAGES:-yes}" FONTS="${FONTS:-yes}" DWM="${DWM:-no}" +RUSTICL="${RUSTICL:-yes}" + + if [ "$PACKAGES" = yes ] ; then # Get rid of the CDROM source, lol @@ -73,8 +76,19 @@ sudo apt install -y git curl \ xclip \ restic \ tree \ + feh \ + +fi +if [ "$RUSTICL" = "yes" ] ; then + sudo apt install -y \ + mesa-opencl-icd + printf "\033[1;32m" + echo "Note, for GPU accelerated darktable with RustiCL you may need to:" + echo "export RUSTICL_ENABLE=radeonsi; darktable -d opencl" + echo "or similar, for intel change radeonsi to 'iris'" + printf "\033[0m" fi if [ "$NVIM" = yes ] ; then @@ -84,7 +98,7 @@ if [ "$NVIM" = yes ] ; then git clone https://github.com/neovim/neovim "$nvimdir" fi cd "$nvimdir" - git fetch --tags + git fetch --force --tags git checkout v0.11.2 rm -rf build || echo "" make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$HOME/.local" -j"$(nproc)" -- cgit v1.2.3 From 993693ea161a37ef55ed9683387c21e8adda4d24 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Fri, 4 Jul 2025 10:37:56 -0400 Subject: Auto allow thunderbolt --- distro/devuan.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'distro') diff --git a/distro/devuan.sh b/distro/devuan.sh index 8e32dbb..8348ecf 100644 --- a/distro/devuan.sh +++ b/distro/devuan.sh @@ -42,6 +42,7 @@ PACKAGES="${PACKAGES:-yes}" FONTS="${FONTS:-yes}" DWM="${DWM:-no}" RUSTICL="${RUSTICL:-yes}" +THUNDERBOLT="${THUNDERBOLT:-yes}" @@ -80,6 +81,13 @@ sudo apt install -y git curl \ fi +if [ "$THUNDERBOLT" = "yes" ] ; then +cat > /etc/udev/rules.d/99-removable.rules < Date: Sun, 20 Jul 2025 12:51:44 -0400 Subject: add a few misc programs to devuan --- distro/devuan.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'distro') diff --git a/distro/devuan.sh b/distro/devuan.sh index 8348ecf..9824f20 100644 --- a/distro/devuan.sh +++ b/distro/devuan.sh @@ -78,6 +78,11 @@ sudo apt install -y git curl \ restic \ tree \ feh \ + sipcalc \ + bluez-alsa-utils \ + bluez-firmware \ + pulseaudio-module-bluetooth \ + fi -- cgit v1.2.3 From cda49c518529c089b7392a2f11312092ea5849df Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Fri, 4 Jul 2025 20:58:35 -0400 Subject: Update arch script and pull oksh compiling into its own script --- distro/arch.sh | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'distro') diff --git a/distro/arch.sh b/distro/arch.sh index 55e0a31..72971ef 100755 --- a/distro/arch.sh +++ b/distro/arch.sh @@ -5,12 +5,12 @@ if [ "$(id -u)" -ne 0 ] ; then exit 1; fi +# Todo add in sipcalc, it's in the AUR now... + pkgs=" alsa-utils ansible arandr -avr-gcc -avr-libc base base-devel bind @@ -23,7 +23,6 @@ chromium cmake colordiff ctags -docker dosfstools dunst ed @@ -41,14 +40,11 @@ gdisk gimp git git-lfs -gpa hdparm htop inkscape iotop iperf3 -jdk11-openjdk -jdk8-openjdk kdenlive libconfig # dmenu-pinentry libfido2 @@ -70,7 +66,6 @@ multipath-tools # kpartx ncdu ncmpc ncspot -neofetch neovim net-tools networkmanager @@ -101,17 +96,14 @@ qemu qt5ct # https://wiki.archlinux.org/title/qt#Appearance rclone redshift -rlwrap # used for clj rsync scrot seahorse shellcheck shellcheck -sipcalc smartmontools speedtest-cli swig # ykman -the_silver_searcher tmux usbutils v4l2loopback-dkms @@ -123,7 +115,9 @@ whois wireguard-tools wireless_tools wl-clipboard -wlroots +wlroots0.17 +wlroots0.18 +wlroots0.19 xclip xdotool xfce4 -- cgit v1.2.3 From 80bff39581ee9bbda6b8d60553c548339ebd570f Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Sun, 20 Jul 2025 12:57:08 -0400 Subject: Switch to just warning about /etc/systemd/logind.conf. Remove old bootbackup. Add OpenCL for Intel --- distro/arch.sh | 55 ++++++++++++++++++------------------------------------- 1 file changed, 18 insertions(+), 37 deletions(-) (limited to 'distro') diff --git a/distro/arch.sh b/distro/arch.sh index 72971ef..ef896a3 100755 --- a/distro/arch.sh +++ b/distro/arch.sh @@ -137,28 +137,11 @@ zstd #shellcheck disable=SC2046 pacman -S --needed $(echo "$pkgs" | awk '{print $1}' | tr '\n' ' ') -fn="/etc/systemd/logind.conf" -bak="$fn.$(date +%s)" -cp "$fn" "$bak" -ed "$fn" </dev/null ; then - rm "$bak" -fi +grep -q '^KillUserProcesses=yes' /etc/systemd/logind.conf || \ + echo "You may want to set KillUserProcesses=yes in /etc/systemd/logind.conf" +grep -q '^HandleLidSwitch=ignore' /etc/systemd/logind.conf || \ + echo "You may want to set HandleLidSwitch=ignore in /etc/systemd/logind.conf" cat > /etc/udev/rules.d/99-removable.rules < /etc/pacman.d/hooks/95-bootbackup.hook < /etc/modprobe.d/v4l2loopback.conf < /etc/modules-load.d/v4l2loopback.conf < Date: Wed, 20 Aug 2025 19:01:42 -0400 Subject: Add a note on rocm-opencl --- distro/arch.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'distro') diff --git a/distro/arch.sh b/distro/arch.sh index ef896a3..528ccca 100755 --- a/distro/arch.sh +++ b/distro/arch.sh @@ -164,6 +164,9 @@ case $(lspci | grep VGA) in pacman -S --needed intel-compute-runtime ;; *AMD*) + # OpenCL Drivers + echo "Note ROCM isn't supported by all AMD GPUs" + pacman -S --needed rocm-opencl-runtime ;; *Nvidia*) ;; -- cgit v1.2.3 From 21cbbd2d61b4020817c31cc61ea665301866e0c8 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Thu, 4 Sep 2025 17:09:58 -0400 Subject: Update arch install and setup scripts. Add paq clone to the install script --- distro/arch-install.sh | 77 +++++++++++++++++++ distro/arch.sh | 203 +++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 265 insertions(+), 15 deletions(-) create mode 100755 distro/arch-install.sh (limited to 'distro') diff --git a/distro/arch-install.sh b/distro/arch-install.sh new file mode 100755 index 0000000..6cfb095 --- /dev/null +++ b/distro/arch-install.sh @@ -0,0 +1,77 @@ +#!/bin/sh +set -ex + +do_edit() { +printf "Edit \"$1\" ? : " +read -r resp +case $resp in + Y|y) arch-chroot "${_install_path}" nvim "$1" ;; + *) ;; +esac +} + +do_chroot() { + arch-chroot "$_install_path" "$@" +} + +_install_path="${INSTALL_PATH:-/mnt}" +_tz="${TZ:-America/New_York}" +_hostname="${INSTALL_HOSTNAME:-arch}" +PACSTRAP="${PACSTRAP:-1}" + +set +x +if ! awk '{print $2}' /proc/mounts | grep -q '^'"$_install_path"'$' ; then + echo "Cannot install to \"$_install_path\" because it is not a mountpoint" + echo "if you've mounted somewhere other than /mnt use:" + echo " env INSTALL_PATH= ./arch-install.sh" + echo where '' is the mount point in question + exit 1 +fi +set -x + +if [ $PACSTRAP -eq 1 ] ; then +pacstrap -K "$_install_path" \ + arch-install-scripts \ + base \ + base-devel \ + cryptsetup \ + dosfstools \ + e2fsprogs \ + efibootmgr \ + git \ + gptfdisk \ + grub \ + linux \ + linux-firmware \ + linux-firmware-marvell \ + lvm2 \ + networkmanager \ + nvim \ + sof-firmware \ + tmux \ + xfsprogs \ + +fi + + +genfstab -U "$_install_path" >> "${_install_path}/etc/fstab" + +do_edit /etc/fstab + +do_edit /etc/locale.gen + +do_chroot locale-gen + +do_chroot ln -sf "/usr/share/zoneinfo/$_tz" /etc/localtime + +do_edit /etc/mkinitcpio.conf + +do_chroot mkinitcpio -p linux + +do_edit /etc/default/grub + +do_chroot grub-install --target=x86_64-efi --removable --efi-directory=/boot/efi + +do_chroot grub-mkconfig -o /boot/grub/grub.cfg + +do_chroot passwd diff --git a/distro/arch.sh b/distro/arch.sh index 528ccca..72b5db4 100755 --- a/distro/arch.sh +++ b/distro/arch.sh @@ -1,11 +1,33 @@ #!/bin/sh set -e -if [ "$(id -u)" -ne 0 ] ; then - echo "Run as root" +if [ "$(id -u)" -eq 0 ] ; then + echo "Run as normal user w/ sudo access" exit 1; fi -# Todo add in sipcalc, it's in the AUR now... +codedir="$HOME/scm" +okshdir="${codedir}/pub/ibara-oksh" +rivercfgdir="${codedir}/wl/rivercfg" +yaydir="${codedir}/pub/yay" + +GRAPHICS="${GRAPHICS:-yes}" +THUNDERBOLT="${THUNDERBOLT:-yes}" +PACKAGES="${PACKAGES:-yes}" +FONTS="${FONTS:-yes}" +YAY="${YAY:-yes}" +BRAVE="${BRAVE:-yes}" +OKSH="${OKSH:-yes}" +RIVER="${RIVER:-yes}" +V4L2LOOPBACK="${V4L2LOOPBACK:-yes}" +LOGIND="${LOGIND:-yes}" +DWM="${DWM:-no}" +DPW="${DPW:-yes}" + +dpwdir="${codedir}/me/dpw" +dwmdir="${codedir}/x/dwm" +dwmStdir="${codedir}/x/st" +dwmDmenudir="${codedir}/x/dmenu" +dwmSesdir="${codedir}/x/session" pkgs=" alsa-utils @@ -31,6 +53,7 @@ ethtool evince evolution exfat-utils +fastfetch feh firefox fuse @@ -46,16 +69,12 @@ inkscape iotop iperf3 kdenlive +less libconfig # dmenu-pinentry libfido2 libvirt # If you want libxcb libxkbcommon -lightdm -lightdm-gtk-greeter -linux -linux-firmware -linux-zen lvm2 lxappearance man-pages @@ -96,11 +115,12 @@ qemu qt5ct # https://wiki.archlinux.org/title/qt#Appearance rclone redshift +ripgrep rsync scrot +sddm seahorse shellcheck -shellcheck smartmontools speedtest-cli swig # ykman @@ -134,30 +154,178 @@ zathura-ps zstd " +if [ "$PACKAGES" = "yes" ] ; then #shellcheck disable=SC2046 -pacman -S --needed $(echo "$pkgs" | awk '{print $1}' | tr '\n' ' ') +sudo pacman -S --needed $(echo "$pkgs" | awk '{print $1}' | tr '\n' ' ') +fi +if [ "$LOGIND" = "yes" ] ; then +fn="/etc/systemd/logind.conf" +bak="$fn.$(date +%s)" +sudo cp "$fn" "$bak" +sudo sed -i -E -e 's/^.*KillUserProcesses=.*$/KillUserProcesses=yes/g' "$fn" +sudo sed -i -E -e 's/^.*HandleLidSwitch=.*$/HandleLidSwitch=ignore/g' "$fn" +if sudo diff -q "$fn" "$bak" >/dev/null ; then + sudo rm "$bak" +fi +fi grep -q '^KillUserProcesses=yes' /etc/systemd/logind.conf || \ echo "You may want to set KillUserProcesses=yes in /etc/systemd/logind.conf" grep -q '^HandleLidSwitch=ignore' /etc/systemd/logind.conf || \ echo "You may want to set HandleLidSwitch=ignore in /etc/systemd/logind.conf" -cat > /etc/udev/rules.d/99-removable.rules < /etc/udev/rules.d/99-removable.rules < /etc/modprobe.d/v4l2loopback.conf < /etc/modprobe.d/v4l2loopback.conf < /etc/modules-load.d/v4l2loopback.conf < /etc/modules-load.d/v4l2loopback.conf <> /etc/shells' + fi + + if ! grep -qF 'export ENV=$HOME/.kshrc' ~/.profile; then + echo 'export ENV=$HOME/.kshrc' >> ~/.profile + fi + + set +x + if ! grep "^$(id -un)" /etc/passwd | grep /usr/local/bin/oksh ; then + printf "Change shell to oksh? [y]es/[n]o: " + read -r resp + if [ "$resp" = "y" ] ; then + chsh -s /usr/local/bin/oksh + fi + fi + set -x + + +fi + +if [ "$FONTS" = yes ] ; then + if ! [ -d ~/.fonts ]; then + git clone https://git.riedstra.dev/mitch/fonts ~/.fonts + fi +fi + +if [ "$RIVER" = yes ] ; then + if ! [ -d "$rivercfgdir" ] ; then + git clone https://git.riedstra.dev/wl/rivercfg "$rivercfgdir" + fi + cd "$rivercfgdir" + sudo pacman -S river foot swaylock waybar wlr-randr bemenu bemenu-wayland swaybg grim slurp + ./link.sh + cd - + + wlcustomdir="$rivercfgdir"/../wlcustom + if ! [ -d "$wlcustomdir" ] ; then + git clone https://git.riedstra.dev/wl/wlcustom "$wlcustomdir" + fi + cd "$wlcustomdir" + sudo make install + cd - +fi + +if [ "$DPW" = yes ] ; then + if ! [ -d "$dpwdir" ] ; then + git clone https://git.riedstra.dev/mitch/dpw "$dpwdir" + fi + cd "$dpwdir" + make PREFIX="$HOME" install + cd - +fi + +if [ "$YAY" = yes ] ; then + if ! [ -d "$yaydir" ] ; then + git clone https://aur.archlinux.org/yay.git "$yaydir" + fi + cd "$yaydir" + yay --version || makepkg -si + cd - +fi + +if [ "$BRAVE" = yes ] ;then +if [ "$YAY" == yes ] ; then + yay -Sy brave-bin +else + echo "You need to install yay ( env YAY=yes ./distro/arch.sh or so )" + echo "In order to install brave via this script" +fi +fi + + +if [ "$DWM" = yes ] ; then + sudo pacman -S picom + + if ! [ -d "$dwmdir" ] ; then + git clone https://git.riedstra.dev/x/dwm "$dwmdir" + fi + cd "$dwmdir" + make + sudo make clean install + cd - + + if ! [ -d "$dwmStdir" ] ; then + git clone https://git.riedstra.dev/x/st "$dwmStdir" + fi + cd "$dwmStdir" + make + sudo make clean install + cd - + + if ! [ -d "$dwmDmenudir" ] ; then + git clone https://git.riedstra.dev/x/dmenu "$dwmDmenudir" + fi + cd "$dwmDmenudir" + make + sudo make clean install + cd - + + if ! [ -d "$dwmSesdir" ] ; then + git clone https://git.riedstra.dev/x/session "$dwmSesdir" + fi + cd "$dwmSesdir" + sudo make install + cd - + + if ! [ -f ~/.xinitrc ] ; then +cat > ~/.xinitrc <