diff --git a/devware.csv b/devware.csv index 38ff5cb..ef0d605 100644 --- a/devware.csv +++ b/devware.csv @@ -1,16 +1,27 @@ NAME,DESCRIPTION,GIT, build-base,"Meta package for build base",D, +patch,"Utility to apply diffs to files",D, tcc,"Tiny C Compiler",D, tcc-libs,"Tiny C Compiler (libraries)",D, tcc-libs-static,"Tiny C Compiler (static library)",D, clang20,"C language family front-end for LLVM",D, -libinput,"Library for handling input devices",D, +clang20-extra-tools,"Extra tools built using Clang's tooling APIs",D, +tinymist,"Language service for Typst",D, +git,"Distributed version control system",D, +tar,"Utility used to store, backup, and transport files",D, +curl,"URL retrival utility and library",D, +wl-clipboard,"Command-line copy/paste utilities for Wayland",D, +bash,"The GNU Bourne Again shell",D, libinput-dev,"Library for handling input devices (development files)",D, -wayland,"A computer display server protocol",D, wayland-dev,"A computer display server protocol (development files)",D, -wlroots,"Modular Wayland compositor library",D, wlroots-dev,"Modular Wayland compositor library (development files)",D, -libxkbcommon,"keyboard handling library",D, libxkbcommon-dev,"keyboard handling library (development files)",D, wayland-protocols,"Protocols and protocol extensions complementing the Wayland core protocol",D, pkgconf,"development framework configuration tools",D, +neovim,"Vim-fork focused on extensibility and agility",D, +fcft-dev,"Simple library for font loading and glyph rasterization using FontConfig, FreeType and pixman (development files)",D, +ripgrep,"ripgrep combines the usability of The Silver Searcher with the raw speed of grep",D, +alsa-lib-dev,"Advanced Linux Sound Architecture (ALSA) library (development files)",D, +file-dev,"File type identification utility (development files)",D, +openssl-dev,"Toolkit for Transport Layer Security (TLS) (development files)",D, + diff --git a/installer.sh b/installer.sh index fff6e6e..3159b89 100644 --- a/installer.sh +++ b/installer.sh @@ -2,19 +2,19 @@ dotfiles="https://git.amolinae.com/amolinae06/dotfiles.git" software="https://git.amolinae.com/amolinae06/installer/raw/branch/main/software.csv" -postinstall="https://git.amolinae.com/amolinae06/installer/raw/branch/main/postinstall.sh" +devware="https://git.amolinae.com/amolinae06/installer/raw/branch/main/devware.csv" apk_install(){ - echo "installing $1"; apk add "$1" >/dev/null 2>&1 + echo "installing $1"; doas apk add "$1" >/dev/null 2>&1 +} + +bwapk_install (){ + echo "installing $1 on chroot environment" + doas bwroot apk add "$1" >/dev/null 2>&1 } git_install(){ - echo "cloning from $1"; su - "$user" -c "cd ~/.local/src && git clone \"$1\"" >/dev/null 2>&1 -} - -deploy_dotfiles(){ - printf "Deploying dotfiles...\n" - su - $user -c "git clone $dotfiles && cd dotfiles && rm -rf .git .gitmodules README.md && cp -r .cache .config .local .zprofile /home/$user/ && cd && rm -rf dotfiles" + echo "cloning from $1"; cd $HOME/.local/src && git clone \"$1\" >/dev/null 2>&1 } read_software(){ @@ -24,6 +24,7 @@ read_software(){ case "$GIT" in "N") apk_install $NAME ;; "Y") git_install "$GIT_URL" ;; + "D") bwapk_install $NAME ;; *) echo "ERROR: failed to determine $NAME."; exit 1 ;; esac done @@ -35,85 +36,81 @@ read_software(){ setup_greetd(){ printf "Setting up greetd\n" - # Check if greetd directory exists, if not, create it. [ -d "/etc/greetd" ] || mkdir "/etc/greetd" - cat < /etc/greetd/config.toml + doas cat < /etc/greetd/config.toml [terminal] vt = 7 [default_session] -command = "tuigreet -t -r --cmd /home/$user/.local/bin/dwllaunch" +command = "agreety -t -r --cmd /home/$USER/.local/bin/dwllaunch" user = "greetd" EOF - rc-update add greetd default + doas rc-update add greetd default printf "Finished setting up greetd.\n" } setup_shell(){ - sed -i "/^$user:/s#:[^:]*\$#:/bin/zsh#" /etc/passwd - mkdir -p "/home/$user/.cache/zsh" - touch "/home/$user/.cache/zsh/history" - chown -R "$user":"$user" "/home/$user/.cache/" - echo "changed "$user"'s shell to zsh" + doas sed -i "/^$USER:/s#:[^:]*\$#:/bin/zsh#" /etc/passwd + mkdir -p $HOME/.cache/zsh + touch $HOME/.cache/zsh/history + echo "changed $USER's shell to zsh" } setup_bluetooth(){ printf "Setting up bluetooth\n" - rc-update add bluetooth default + doas rc-update add bluetooth default printf "Done.\n" } setup_home(){ - su - $user -c "xdg-user-dirs-update && mkdir ~/Documents/Miscellaneous" + doas apk add git + printf "Deploying dotfiles...\n" + git clone --recursive $dotfiles + cd dotfiles + rm -rf .git .gitmodules + cp -r .cache .config .local .zprofile $HOME + cd $HOME + rm -rf dotfiles/ + xdg-user-dirs-update + mkdir $HOME/Documents/Miscellaneous + export PATH="$PATH:$(find ~/.local/bin -type d | paste -sd ':' -)" + doas apk del git } setup_chroot(){ printf "Setting up chroot\n" apk_install curl - cd "/home/$user/Documents/Miscellaneous" + cd $HOME/Documents/Miscellaneous mkdir alpchroot curl -LO https://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/apk-tools-static-2.14.4-r1.apk tar -xzf apk-tools-static-*.apk ./sbin/apk.static -X https://dl-cdn.alpinelinux.org/alpine/v3.20/main -U --allow-untrusted -p alpchroot/ --initdb add alpine-base - mount -o bind /dev alpchroot/dev - mount -t proc none alpchroot/proc - mount -o bind /sys alpchroot/sys - cp -L /etc/resolv.conf alpchroot/etc/ - chown -R "$user":"$user" alpchroot/ >/dev/null 2>&1 + doas cp -L /etc/resolv.conf alpchroot/etc/ + doas chown -R $USER:$USER alpchroot/ >/dev/null 2>&1 mkdir -p alpchroot/etc/apk - cp /etc/apk/repositories alpchroot/etc/apk/repositories - apk del curl + doas cp /etc/apk/repositories alpchroot/etc/apk/repositories + doas apk del curl printf "Finished setting up chroot!\n" } -post_install(){ - printf "Postinstall\n" - ([ -f "$postinstall" ] && cp "$postinstall" /tmp/postinstall.sh) || wget -qO- "$1" > /tmp/postinstall.sh - su - "$user" -c "zsh -lc 'sh /tmp/postinstall.sh \"$@\" '" +compile() { + cd "$HOME/.local/src/$1/" + bwroot make clean install } -check_root(){ - if [ "$(id -u)" -ne 0 ]; then - echo "ERROR: you must run this script as root."; exit 1 - fi -} - -get_user(){ - printf "Please enter the name of your user: " - read -r user -} - -check_root +compile "dwl" echo "Welcome to the installer" -apk_install git get_user read_software "$software" setup_home -deploy_dotfiles setup_greetd setup_shell setup_bluetooth setup_chroot -post_install "$user" +read_software "$devware" +compile dwl +compile slstatus +compile hellwal +compile ctpv diff --git a/postinstall.sh b/postinstall.sh deleted file mode 100644 index 1a848fc..0000000 --- a/postinstall.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh - -software="https://git.amolinae.com/amolinae06/installer/raw/branch/main/devware.csv" - -apk_install(){ - echo "installing $1"; bwroot apk add "$1" >/dev/null 2>&1 -} - -read_software(){ - ([ -f "$1" ] && cp "$1" /tmp/temp.csv) || wget -qO- "$1" > /tmp/temp.csv - - tail -n +2 "/tmp/temp.csv" | sed -E ':a; s/("[^"]*),([^"]*")/\1\2/; ta' | while IFS=',' read -r NAME DESCRIPTION GIT GIT_URL; do - case "$GIT" in - "D") apk_install $NAME ;; - *) echo "ERROR: failed to determine $NAME."; exit 1 ;; - esac - done - - rm "/tmp/temp.csv" - printf "Successfully installed all software!\n" -} - -make_dwl() { - cd $HOME/.local/src/dwl/ - bwroot make install -} - -make_slstatus() { - cd $HOME/.local/src/slstatus/ - bwroot make install -} - -make_ctpv() { - cd $HOME/.local/src/hellwal/ - bwroot make install -} - -make_hellwal() { - cd $HOME/.local/src/hellwal/ - bwroot make install -} - -cd "/home/$@/" -read_software $software -make_dwl -make_slstatus -make_ctpv -make_hellwal diff --git a/software.csv b/software.csv index 93c6a84..5fa0799 100644 --- a/software.csv +++ b/software.csv @@ -9,10 +9,7 @@ fastfetch,"Maintained, feature-rich and performance oriented", neofetch-like sys ffmpeg,"Complete and free Internet live audio and video broadcasting solution for Linux/Unix",N, foot,"Fast, lightweight and minimalistic Wayland terminal emulator",N, fuzzel,"Application launcher for wlroots-based Wayland compositors",N, -git,"Distributed version control system",N, -gnome-keyring,"GNOME keyring",N, greetd,"Minimal and flexible login manager daemon",N, -greetd-tuigreet,"Graphical console greeter for greetd",N, grim,"Grabs images from Wayland compositors",N, imv-wayland,"Image viewer for Wayland",N, kanshi,"Dynamic display configuration for Wayland",N, @@ -24,9 +21,6 @@ libxkbcommon,"keyboard handling library",N, mako,"A lightweight notification daemon for Wayland",N, mpv,"Video player based on MPlayer/mplayer2",N, ncpamixer,"ncurses PulseAudio Mixer",N, -neovim,"Vim-fork focused on extensibility and agility",N, -font-noto,"Noto font families for Latin, Cyrillic and Greek scripts",N, -font-noto-cjk,"Google's font family that aims to support all the world's languages (cjk)",N, openssh,"Port of OpenBSD's free SSH release",N, papirus-icon-theme,"papirus icon theme",N, pipewire,"Multimedia processing graphs",N, @@ -34,14 +28,12 @@ pipewire-alsa,"ALSA support for pipewire",N, pipewire-jack,"JACK support for pipewire",N, pipewire-pulse,"Pulseaudio support for pipewire",N, pipewire-spa-bluez, "PipeWire BlueZ5 SPA plugin (Bluetooth)",N -ripgrep,"ripgrep combines the usability of The Silver Searcher with the raw speed of grep",N, sc-im,"ncurses spreadsheet program based on SC",N, slurp,"Interaction screen selection on Wayland compositors",N, spotify-player,"Command driven spotify player",N, sshfs,"FUSE client based on the SSH File Transfer Protocol",N, swayidle,"Idle management daemon for Wayland",N, swaylock-effects,"Screen locker for Wayland with fancy effects",N, -font-inconsolata,"Inconsolata fonts",N, font-inconsolata-nerd,"Inconsolata Nerd Font",N, typst,"New markup-based typesetting system that is powerful and easy to learn",N, wayland,"A computer display server protocol",N, @@ -57,7 +49,7 @@ xdg-desktop-portal-wlr,"wlroots implementation of xdg-desktop-portal",N, xdg-user-dirs,"Manage user directories like ~/Desktop and ~/Music",N, xdg-utils,"Basic desktop integration functions",N, zathura,"Highly customizable and functional document viewer",N, -zathura-pdf-poppler,"Poppler plugin adds PDF support to zathura",N, +zathura-pdf-mupdf,"mupdf plugin to zathura",N, zsh,"Very advanced and programmable command interpreter (shell)",N, zsh-completions,"Additional completion definitions for Zsh (packaged as a plugin)",N, zsh-fast-syntax-highlighting,"Feature-rich syntax highlighting for ZSH",N,