#!/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}" RUSTICL="${RUSTICL:-yes}" 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 \ 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 sudo apt build-dep -y neovim if ! [ -d "$nvimdir" ] ; then git clone https://github.com/neovim/neovim "$nvimdir" fi cd "$nvimdir" git fetch --force --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 <