diff options
author | awy <awy@awy.one> | 2024-11-28 17:49:11 +0300 |
---|---|---|
committer | awy <awy@awy.one> | 2024-11-28 17:49:11 +0300 |
commit | abeb2dcdf2f2e6ca3ed1836d8cf3d6edf93129f3 (patch) | |
tree | b67df3bfdaeddf4165361899053cb4c74d2681e5 /rice.sh |
upload
Diffstat (limited to 'rice.sh')
-rwxr-xr-x | rice.sh | 108 |
1 files changed, 108 insertions, 0 deletions
@@ -0,0 +1,108 @@ +#!/bin/sh +set -e +WORKDIRECTORY=$PWD +PERMUSER=$(logname) + +if [ "$(id -u)" -ne 0 ] + then printf "The script has to be run as root.\n" + exit +fi + +DEPLIST="`sed -e 's/#.*$//' -e '/^$/d' dependencies.txt | tr '\n' ' '`" +pacman -Sy --noconfirm +pacman -S $DEPLIST --noconfirm + +usermod -aG seat,input,audio,video $PERMUSER +doas -u $PERMUSER cp -r "$WORKDIRECTORY"/.config /home/$PERMUSER +doas -u $PERMUSER cp -r "$WORKDIRECTORY"/.local /home/$PERMUSER +doas -u $PERMUSER cp -a "$WORKDIRECTORY"/.zprofile /home/$PERMUSER + +doas -u $PERMUSER mkdir -p /home/$PERMUSER/.config/git +doas -u $PERMUSER mkdir -p /home/$PERMUSER/.config/npm +doas -u $PERMUSER touch /home/$PERMUSER/.config/npm/npmrc +doas -u $PERMUSER mkdir -p /home/$PERMUSER/.cache/lf +doas -u $PERMUSER mkdir -p /home/$PERMUSER/.cache/zsh +doas -u $PERMUSER mkdir -p /home/$PERMUSER/.local/share/themes +doas -u $PERMUSER mkdir -p /home/$PERMUSER/.local/share/icons +doas -u $PERMUSER mkdir -p /home/$PERMUSER/.local/share/fonts + +cd "$WORKDIRECTORY" || exit +doas -u $PERMUSER git clone https://github.com/awnrt/gruvbox-gtk-theme +doas -u $PERMUSER cp -r gruvbox-gtk-theme/Gruvbox-Dark /home/$PERMUSER/.local/share/themes +doas -u $PERMUSER cp -r gruvbox-gtk-theme/Gruvbox-Icons /home/$PERMUSER/.local/share/icons + +doas -u $PERMUSER dbus-launch gsettings set org.gnome.desktop.interface gtk-theme "Gruvbox-Dark" +doas -u $PERMUSER dbus-launch gsettings set org.gnome.desktop.interface icon-theme "Gruvbox-Icons" +doas -u $PERMUSER dbus-launch gsettings set org.gnome.desktop.wm.preferences button-layout 'appmenu' +doas -u $PERMUSER dbus-launch gsettings set org.gnome.desktop.interface font-name "Sans 11" + +cd "$WORKDIRECTORY" || exit +doas -u $PERMUSER git clone https://github.com/zdharma-continuum/fast-syntax-highlighting +#doas -u $PERMUSER git clone https://github.com/Aloxaf/fzf-tab +mkdir -p /usr/share/zsh/plugins +cp -rf fast-syntax-highlighting /usr/share/zsh/plugins +#cp -rf fzf-tab /usr/share/zsh/plugins +git clone https://git.awy.one/dwl +cd dwl +make clean install +cd "$WORKDIRECTORY" +git clone https://git.awy.one/someblocks +cd someblocks +make clean install +cd "$WORKDIRECTORY" + +ln -s /usr/bin/wmenu /usr/bin/dmenu + +doas -u $PERMUSER mkdir -p /home/$PERMUSER/.ssh +doas -u $PERMUSER mkdir -p /home/$PERMUSER/.gnupg +doas -u $PERMUSER touch /home/$PERMUSER/.gnupg/gpg-agent.conf + +cat <<EOL >> /home/$PERMUSER/.gnupg/gpg-agent.conf +enable-ssh-support +pinentry-program /usr/bin/pinentry-qt +default-cache-ttl 34560000 +max-cache-ttl 34560000 +EOL + +cat <<EOL >> /home/$PERMUSER/.config/npm/npmrc +prefix=\${XDG_DATA_HOME}/npm +cache=\${XDG_CACHE_HOME}/npm +init-module=\${XDG_CONFIG_HOME}/npm/config/npm-init.js +logs-dir=\${XDG_STATE_HOME}/npm/logs +EOL + +doas -u $PERMUSER find /home/$PERMUSER/.gnupg -type f -exec chmod 600 {} \; +doas -u $PERMUSER find /home/$PERMUSER/.gnupg -type d -exec chmod 700 {} \; +doas -u $PERMUSER find /home/$PERMUSER/.ssh -type f -exec chmod 600 {} \; +doas -u $PERMUSER find /home/$PERMUSER/.ssh -type d -exec chmod 700 {} \; + +chsh -s /bin/zsh $PERMUSER + +mkdir -p /root/.config/nvim +cat <<EOL >> /root/.config/nvim/init.vim +set title +set clipboard+=unnamedplus +set relativenumber +colorscheme vim +EOL + +sed -i -e "/^#"Color"/s/^#//" /etc/pacman.conf +sed -i -e '/Color/a\ILoveCandy' /etc/pacman.conf + +rm /home/$PERMUSER/.bash* + +# makeflags set to number of threads and pacman elevation is doas +sed -i 's/#MAKEFLAGS=.*$/MAKEFLAGS="-j'$(nproc)'"/' /etc/makepkg.conf +sed -i 's/#PACMAN_AUTH=.*$/PACMAN_AUTH=(doas)/' /etc/makepkg.conf +doas -u $PERMUSER git clone https://aur.archlinux.org/yay.git +cd yay +doas -u $PERMUSER makepkg -csi --noconfirm +cd "$WORKDIRECTORY" +DEPLIST="`sed -e 's/#.*$//' -e '/^$/d' aurdeps.txt | tr '\n' ' '`" +doas -u $PERMUSER yay -S $DEPLIST --noconfirm +cd .. +rm -rf dwldots +rm -rf yay +rm -rf go + +echo "Your linux is riced!" |