diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2024-05-31 16:06:50 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2024-05-31 16:06:50 +0900 |
| commit | 60a19f0f33b52e66141a587b8129cf9a859d736a (patch) | |
| tree | 10780671b5c823cc43aa002a41a99801b806c4a5 | |
| parent | bb525232bd45f1e9bf786e40b3cffdfc8386a0f9 (diff) | |
Updates
| -rw-r--r-- | public/progs.csv | 25 | ||||
| -rwxr-xr-x | public/thesiah.sh | 151 | ||||
| -rw-r--r-- | static/progs.csv | 25 | ||||
| -rwxr-xr-x | static/thesiah.sh | 151 |
4 files changed, 238 insertions, 114 deletions
diff --git a/public/progs.csv b/public/progs.csv index c82c12b..c3a6c7d 100644 --- a/public/progs.csv +++ b/public/progs.csv @@ -3,21 +3,23 @@ ,libertinus-font,provides the sans and serif fonts for THESIAH. ,noto-fonts,is an expansive font package. ,noto-fonts-emoji,is an emoji font. -,powerline-fonts,powerline support. -,texlive-langkorean,Korean support. +,powerline-fonts,provides powerline support. +,texlive-langkorean,provides Korean support. ,ttf-font-awesome,provides extended glyph support. ,ttf-dejavu,properly displays emojis. -,ttf-droid,popular font. -,ttf-firacode-nerd,popular font. -,ttf-hack-nerd,popular font. -,ttf-melso-nerd,powerlevel10k support. +,ttf-droid,is a popular font. +,ttf-firacode-nerd,is a popular font. +,ttf-hack-nerd,is a popular font. +,ttf-melso-nerd,provides powerlevel10k support. A,abook,is an offline addressbook usable by neomutt. ,arandr,allows the user to customize monitor arrangements. A,arkenfox-user.js,provides hardened security settings for Firefox and Librewolf to avoid Mozilla spyware and general web fingerprinting. ,atool,manages and gives information about archives. ,atuin,replaces the existing shell history with a SQLite database. +A,auto-cpufreq,is a optimizer for automatic CPU speed and power. ,bash-completion,is a programmable completion for the bash shell. ,bat,can highlight code output and display files and is used to generate previews in the file browser. +,bbswitch,is a Kernel module allowing to switch dedicated graphics card. ,bc,is a mathematics language used for the dropdown calculator. ,bluez,is a tool for bluetooth control command line. ,bluez-utils,is utils for bluetooth. @@ -45,11 +47,13 @@ A,gtk-theme-arc-gruvbox-git,gives the dark GTK theme used in LARBS. A,htop-vim,is a graphical and colorful system monitor. ,hugo,is a fastest framework for building websites. ,imagemagick,is an image viewing/manipulation program. +,jq,is a command-line JSON processor. A,kakaotalk,is a messenger for Korean. ,lazygit,manages git in Neovim. A,lf-bin,is an extensive terminal file manager that everyone likes. ,lib32-pipewire-jack,is a low-latency audio/video router and processor for multilib support. ,libnotify,allows desktop notifications. +,libreoffice-fresh,is a multi-platform office productivity suite. A,librewolf-bin,is the default browser of LARBS which also comes with ad-blocking and other sensible and necessary features by default. ,lynx,"is a terminal browser also used in LARBS for generating in-terminal previews of websites, emails and HTML files." ,lxpolkit,is a policykit agent for LXDE. @@ -78,6 +82,7 @@ A,pam-gnupg,auto unlocks when log-in. ,pulsemixer,is an audio controller. P,pynvim,is for lsp in neovim. ,python-qdarkstyle,provides a dark Qt theme. +,reflector,retrieves and filters the latest Pacman mirror list. ,ripgrep,recursively searches the current directory for a regex pattern. ,ripgrep-all,searches words in a line. ,rsync,is a fast and versatile file copying tool. @@ -120,10 +125,4 @@ A,urlview,enables to view url in a terminal. ,zathura,is a pdf viewer with vim-like bindings. ,zathura-pdf-mupdf,allows mupdf pdf compatibility in zathura. ,zoxide,is a tool enhanced cd command. -G,https://github.com/TheSiahxyz/dwm.git,is TheSiahxyz's dwm. -G,https://github.com/TheSiahxyz/dwmblocks.git,is TheSiahxyz's dwmblocks. -G,https://github.com/TheSiahxyz/dmenu.git,is TheSiahxyz's dmenu. -G,https://github.com/TheSiahxyz/st.git,is TheSiahxyz's st. -G,https://github.com/TheSiahxyz/slock.git,is TheSiahxyz's slock. -G,https://github.com/TheSiahxyz/THESIAH.git,is TheSiahxyz's THESIAH. -G,https://github.com/TheSiahxyz/.password-store.git,is TheSiahxyz's password-store. +G,https://github.com/TheSiahxyz/suckless.git,is TheSiahxyz's suckless programs. diff --git a/public/thesiah.sh b/public/thesiah.sh index 48b7e2b..3aca943 100755 --- a/public/thesiah.sh +++ b/public/thesiah.sh @@ -7,6 +7,9 @@ ### OPTIONS AND VARIABLES ### dotfilesrepo="https://github.com/TheSiahxyz/.dotfiles.git" +passwordrepo="https://github.com/TheSiahxyz/.password-store.git" +obsidianrepo="https://github.com/TheSiahxyz/Obsidian.git" +webrepo="https://github.com/TheSiahxyz/THESIAH.git" progsfile="https://raw.githubusercontent.com/TheSiahxyz/THESIAH/main/static/progs.csv" aurhelper="yay" repobranch="main" @@ -50,12 +53,19 @@ getuserandpass() { epass1=$(whiptail --nocancel --passwordbox "Enter a password for ecryptfs which will be used to set up an encrypt folder." 10 60 3>&1 1>&2 2>&3 3>&1) epass2=$(whiptail --nocancel --passwordbox "Retype password." 10 60 3>&1 1>&2 2>&3 3>&1) while ! [ "$epass1" = "$epass2" ]; do - unset pass2 + unset epass2 epass1=$(whiptail --nocancel --passwordbox "Passwords do not match.\\n\\nEnter password again." 10 60 3>&1 1>&2 2>&3 3>&1) epass2=$(whiptail --nocancel --passwordbox "Retype password." 10 60 3>&1 1>&2 2>&3 3>&1) done } +repocheck() { + putrepo=$(whiptail --inputbox "Do you want to clone TheSiahxyz's repositories? y/n" 10 60 3>&1 1>&2 2>&3 3>&1) || exit 1 + while [ "$putrepo" != "y" ] && [ "$putrepo" != "n" ]; do + putrepo=$(whiptail --inputbox "Invalid option! Choose 'y' or 'n'.\nDo you want to clone TheSiahxyz's repositories? y/n" 10 60 3>&1 1>&2 2>&3 3>&1) || exit 1 + done +} + usercheck() { ! { id -u "$name" >/dev/null 2>&1; } || whiptail --title "WARNING" --yes-button "CONTINUE" \ @@ -76,7 +86,7 @@ adduserandpass() { # Adds user `$name` with password $pass1. whiptail --infobox "Adding user \"$name\"..." 7 50 useradd -m -g wheel -s /bin/zsh "$name" >/dev/null 2>&1 || - usermod -a -G wheel "$name" && mkdir -p /home/"$name"/{.config.secret,Documents,Downloads,Music,Personal,Pictures,Public,Videos} /home/"$name"/Torrents/{complete,incomplete} /home/"$name"/.local/{bin,share,src,state} /media/{flash,hdd,ssd} /mnt/extra/{backup,videos,win10} && chown "$name":wheel /home/"$name" + usermod -a -G wheel "$name" && mkdir -p /home/"$name"/{.config,.secret,Documents,Downloads,Music,Pictures,Private,Public,Videos} /home/"$name"/Torrents/{complete,incomplete} /home/"$name"/.local/{bin,share,src,state} /media/{flash,hdd,ipdisk,ssd,private} /mnt/extra/{backup,videos,win10} && chown "$name":wheel /home/"$name" export repodir="/home/$name/.local/src" mkdir -p "$repodir" chown -R "$name":wheel "$(dirname "$repodir")" @@ -89,6 +99,7 @@ refreshkeys() { *systemd*) whiptail --infobox "Refreshing Arch Keyring..." 7 40 pacman --noconfirm -S archlinux-keyring >/dev/null 2>&1 + installpkg arch-install-scripts ;; *) whiptail --infobox "Enabling Arch Repositories for more a more extensive software collection..." 7 40 @@ -96,9 +107,12 @@ refreshkeys() { artix-keyring artix-archlinux-support >/dev/null 2>&1 grep -q "^\[extra\]" /etc/pacman.conf || echo "[extra] +Include = /etc/pacman.d/mirrorlist-arch\n +[multilib] Include = /etc/pacman.d/mirrorlist-arch" >>/etc/pacman.conf pacman -Sy --noconfirm >/dev/null 2>&1 pacman-key --populate archlinux >/dev/null 2>&1 + installpkg artools-base ;; esac } @@ -295,19 +309,23 @@ addsudo() { } pamgnupg() { + whiptail --infobox "Setting up pam-gnupg..." 7 50 + $aurhelper -Qq pam-gnupg >/dev/null 2>&1 || aurinstall pam-gnupg echo "auth optional pam_gnupg.so store-only" >>/etc/pam.d/system-login >/dev/null 2>&1 echo "session optional pam_gnupg.so " >>/etc/pam.d/system-login >/dev/null 2>&1 } ecryptfssetup() { - [ -d "/home/$name/.secret" ] && [ -d "/home/$name/Personal" ] || { mkdir -p /home/"$name"/{.secret,Personal} && chown "$name":wheel /home/"$name"/{.secret,Personal} } >/dev/null 2>&1 + whiptail --infobox "Setting up ecryptfs..." 7 50 + [ -x "$(command -v "ecryptfs")" ] || installpkg ecryptfs-utils + [ -d "/home/$name/.secret" ] && [ -d "/home/$name/Private" ] || { mkdir -p /home/"$name"/{.secret,Private} && chown "$name":wheel /home/"$name"/{.secret,Private} } >/dev/null 2>&1 # Ecrypt the folder - printf '\nyes\nyes\n' | mount -t ecryptfs .secret Personal -o ecryptfs_passthrough=n,ecryptfs_enable_filename_crypto=y,passphrase_passwd="$epass1",ecryptfs_cipher=aes,ecryptfs_key_bytes=32 >/dev/null 2>&1 || exit 1 - umount /home/"$name"/Media >/dev/null 2>&1 + printf '\nyes\nyes\n' | mount -t ecryptfs .secret Private -o ecryptfs_passthrough=n,ecryptfs_enable_filename_crypto=y,passphrase_passwd="$epass1",ecryptfs_cipher=aes,ecryptfs_key_bytes=32 >/dev/null 2>&1 || exit 1 + umount /home/"$name"/Private >/dev/null 2>&1 } ufwsetup() { - whiptail --infobox "Setting service ufw..." 7 50 + whiptail --infobox "Setting up ufw..." 7 50 [ -x "$(command -v "ufw")" ] || installpkg ufw pacman -Qq ufw-"$initsys" >/dev/null 2>&1 || install ufw-"$initsys" ufw default deny incoming >/dev/null 2>&1 @@ -343,7 +361,7 @@ ufwsetup() { } sambasetup() { - whiptail --infobox "Setting service samba..." 7 50 + whiptail --infobox "Setting up samba..." 7 50 [ -x "$(command -v "samba")" ] || installpkg samba pacman -Qq samba-"$initsys" >/dev/null 2>&1 || installpkg samba-"$initsys" ufw allow 137/tcp >/dev/null 2>&1 @@ -374,36 +392,16 @@ sambasetup() { esac } -tlpsetup() { - whiptail --infobox "Setting service tlp..." 7 50 - [ -x "$(command -v "tlp")" ] || installpkg tlp - pacman -Qq tlp-"$initsys" >/dev/null 2>&1 || installpkg tlp-"$initsys" - sed -Ei "s/^#(CPU_ENERGY_PERF_POLICY_ON_AC=).*/\1balance_performance/" /etc/tlp.conf >/dev/null 2>&1 - sed -Ei "s/^#(CPU_ENERGY_PERF_POLICY_ON_BAT=).*/\1balance_poewr/" /etc/tlp.conf >/dev/null 2>&1 - sed -Ei "s/^#(START_CHARGE_THRESH_BAT0=).*/\150/" /etc/tlp.conf >/dev/null 2>&1 - sed -Ei "s/^#(STOP_CHARGE_THRESH_BAT0=).*/\175/" /etc/tlp.conf >/dev/null 2>&1 - sed -Ei "s/^#(START_CHARGE_THRESH_BAT1=).*/\150/" /etc/tlp.conf >/dev/null 2>&1 - sed -Ei "s/^#(STOP_CHARGE_THRESH_BAT1=).*/\175/" /etc/tlp.conf >/dev/null 2>&1 - case "$initsys" in - "runit") - ln -s /etc/runit/sv/tlp /run/runit/service/ >/dev/null 2>&1 - sv start tlp >/dev/null 2>&1 - ;; - "openrc") - rc-update add tlp default >/dev/null 2>&1 - rc-service tlp start >/dev/null 2>&1 - ;; - "s6") - ln -s /etc/s6/sv/tlp /run/s6/services/ >/dev/null 2>&1 - s6-svc -u /run/s6/services/tlp >/dev/null 2>&1 - ;; - esac - tlp start >/dev/null 2>&1 +bbswitchsetup() { + whiptail --infobox "Setting up bbswitch..." 7 50 + pacman -Qq bbswitch >/dev/null 2>&1 || installpkg bbswitch + echo "bbswitch" > /etc/modules-load.d/bbswitch.conf >/dev/null 2>&1 + echo "options bbswitch load_state=0 unload_state=1" > /etc/modprobe.d/bbswitch.conf >/dev/null 2>&1 } cronsetup() { - whiptail --infobox "Setting service cronjob..." 7 50 - [ -x "$(command -v "cronie")" ] || installpkg cronie + whiptail --infobox "Setting up cronjob..." 7 50 + pacman -Qq cronie >/dev/null 2>&1 || installpkg cronie pacman -Qq cronie-"$initsys" >/dev/null 2>&1 || installpkg cronie-"$initsys" case "$initsys" in "runit") @@ -421,8 +419,36 @@ cronsetup() { esac } +tlpsetup() { + whiptail --infobox "Setting up tlp..." 7 50 + [ -x "$(command -v "tlp")" ] || installpkg tlp + pacman -Qq tlp-"$initsys" >/dev/null 2>&1 || installpkg tlp-"$initsys" + sed -Ei " + s/^#(PLATFORM_PROFILE_ON_AC=).*/\1performance/g; + s/^#(PLATFORM_PROFILE_ON_BAT=).*/\1balanced/g; + s/^#(START_CHARGE_THRESH_BAT0=).*/\150/g; + s/^#(STOP_CHARGE_THRESH_BAT0=).*/\175/g; + s/^#(START_CHARGE_THRESH_BAT1=).*/\150/g; + s/^#(STOP_CHARGE_THRESH_BAT1=).*/\175/g" >/dev/null 2>&1 + case "$initsys" in + "runit") + ln -s /etc/runit/sv/tlp /run/runit/service/ >/dev/null 2>&1 + sv start tlp >/dev/null 2>&1 + ;; + "openrc") + rc-update add tlp default >/dev/null 2>&1 + rc-service tlp start >/dev/null 2>&1 + ;; + "s6") + ln -s /etc/s6/sv/tlp /run/s6/services/ >/dev/null 2>&1 + s6-svc -u /run/s6/services/tlp >/dev/null 2>&1 + ;; + esac + tlp start >/dev/null 2>&1 +} + vpnsetup() { - whiptail --infobox "Setting service vpn..." 7 50 + whiptail --infobox "Setting up vpn..." 7 50 [ -x "$(command -v "openvpn")" ] || installpkg openvpn pacman -Qq openvpn-"$initsys" >/dev/null 2>&1 || installpkg openvpn-"$initsys" pacman -Qq networkmanager-openvpn >/dev/null 2>&1 || installpkg networkmanager-openvpn @@ -447,6 +473,17 @@ Depends = dash' > /usr/share/libalpm/hooks/relinking-dash.hook ln -sfT dash /usr/bin/sh } +gpusetup() { + gpu_info=$(lspci | grep -E "VGA|Display") + if echo "$gpu_info" | grep -qi "Intel"; then + installpkg xf86-video-intel + installpkg intel-ucode + elif echo "$gpu_info" | grep -qi "AMD"; then + installpkg xf86-video-amdgpu + installpkg amd-ucode + fi +} + finalize() { # Farewell whiptail --title "All done!" \ @@ -467,6 +504,9 @@ welcomemsg || error "User exited." # Get and verify username and password. getuserandpass || error "User exited." +# Decide cloning repositories. +repocheck || error "User exited." + # Give warning if user already exists. usercheck || error "User exited." @@ -608,28 +648,51 @@ pkill -u "$name" librewolf # (like `shutdown` to run without password). addsudo -# Set pam-gnupg +[ ! -f /usr/share/libalpm/hooks/statusbar.hook ] && 'printf [Trigger] +Operation = Upgrade +Type = Package +Target = * + +[Action] +Description = Updating statusbar... +When = PostTransaction +Exec = /usr/bin/pkill -RTMIN+8 dwmblocks' >/usr/share/libalpm/hooks/statusbar.hook + +# Set up pam-gnupg pamgnupg || error "Failed to set up pam-gnupg" -# ecryptfs set up +# Set up ecryptfs ecryptfssetup || error "Failed to set up ecryptfs rules." -# ufw set up +# Set up ufw ufwsetup || error "Failed to set up ufw rules." -# samba set up +# Set up samba sambasetup || error "Failed to set up samba." -# tlp set up -tlpsetup || error "Failed to set up tlp" +# Set up bbswitch +bbswitchsetup || error "Failed to set up bbswitch" -# cronjob set up +# Set up cronjob cronsetup || error "Failed to set up cron" -# vpn set up +# Set up tlp +tlpsetup || error "Failed to set up tlp" + +# Set up vpn vpnsetup || error "Failed to set up vpn" -# dash set up +# Set up gpu +gpusetup || error "Failed to install gpu" + +# Clone TheSiahxyz's repositories +[ "$putrepo" = "y" ] && { + putgitrepo "$passwordrepo" "/home/$name/.local/share" "$repobranch" + putgitrepo "$obsidianrepo" "/home/$name" "$repobranch" + putgitrepo "$webrepo" "/home/$name" "$repobranch" +} + +# Set up dash dashsetup || error "Failed to set up dash" # Last message! Install complete! diff --git a/static/progs.csv b/static/progs.csv index c82c12b..c3a6c7d 100644 --- a/static/progs.csv +++ b/static/progs.csv @@ -3,21 +3,23 @@ ,libertinus-font,provides the sans and serif fonts for THESIAH. ,noto-fonts,is an expansive font package. ,noto-fonts-emoji,is an emoji font. -,powerline-fonts,powerline support. -,texlive-langkorean,Korean support. +,powerline-fonts,provides powerline support. +,texlive-langkorean,provides Korean support. ,ttf-font-awesome,provides extended glyph support. ,ttf-dejavu,properly displays emojis. -,ttf-droid,popular font. -,ttf-firacode-nerd,popular font. -,ttf-hack-nerd,popular font. -,ttf-melso-nerd,powerlevel10k support. +,ttf-droid,is a popular font. +,ttf-firacode-nerd,is a popular font. +,ttf-hack-nerd,is a popular font. +,ttf-melso-nerd,provides powerlevel10k support. A,abook,is an offline addressbook usable by neomutt. ,arandr,allows the user to customize monitor arrangements. A,arkenfox-user.js,provides hardened security settings for Firefox and Librewolf to avoid Mozilla spyware and general web fingerprinting. ,atool,manages and gives information about archives. ,atuin,replaces the existing shell history with a SQLite database. +A,auto-cpufreq,is a optimizer for automatic CPU speed and power. ,bash-completion,is a programmable completion for the bash shell. ,bat,can highlight code output and display files and is used to generate previews in the file browser. +,bbswitch,is a Kernel module allowing to switch dedicated graphics card. ,bc,is a mathematics language used for the dropdown calculator. ,bluez,is a tool for bluetooth control command line. ,bluez-utils,is utils for bluetooth. @@ -45,11 +47,13 @@ A,gtk-theme-arc-gruvbox-git,gives the dark GTK theme used in LARBS. A,htop-vim,is a graphical and colorful system monitor. ,hugo,is a fastest framework for building websites. ,imagemagick,is an image viewing/manipulation program. +,jq,is a command-line JSON processor. A,kakaotalk,is a messenger for Korean. ,lazygit,manages git in Neovim. A,lf-bin,is an extensive terminal file manager that everyone likes. ,lib32-pipewire-jack,is a low-latency audio/video router and processor for multilib support. ,libnotify,allows desktop notifications. +,libreoffice-fresh,is a multi-platform office productivity suite. A,librewolf-bin,is the default browser of LARBS which also comes with ad-blocking and other sensible and necessary features by default. ,lynx,"is a terminal browser also used in LARBS for generating in-terminal previews of websites, emails and HTML files." ,lxpolkit,is a policykit agent for LXDE. @@ -78,6 +82,7 @@ A,pam-gnupg,auto unlocks when log-in. ,pulsemixer,is an audio controller. P,pynvim,is for lsp in neovim. ,python-qdarkstyle,provides a dark Qt theme. +,reflector,retrieves and filters the latest Pacman mirror list. ,ripgrep,recursively searches the current directory for a regex pattern. ,ripgrep-all,searches words in a line. ,rsync,is a fast and versatile file copying tool. @@ -120,10 +125,4 @@ A,urlview,enables to view url in a terminal. ,zathura,is a pdf viewer with vim-like bindings. ,zathura-pdf-mupdf,allows mupdf pdf compatibility in zathura. ,zoxide,is a tool enhanced cd command. -G,https://github.com/TheSiahxyz/dwm.git,is TheSiahxyz's dwm. -G,https://github.com/TheSiahxyz/dwmblocks.git,is TheSiahxyz's dwmblocks. -G,https://github.com/TheSiahxyz/dmenu.git,is TheSiahxyz's dmenu. -G,https://github.com/TheSiahxyz/st.git,is TheSiahxyz's st. -G,https://github.com/TheSiahxyz/slock.git,is TheSiahxyz's slock. -G,https://github.com/TheSiahxyz/THESIAH.git,is TheSiahxyz's THESIAH. -G,https://github.com/TheSiahxyz/.password-store.git,is TheSiahxyz's password-store. +G,https://github.com/TheSiahxyz/suckless.git,is TheSiahxyz's suckless programs. diff --git a/static/thesiah.sh b/static/thesiah.sh index 48b7e2b..3aca943 100755 --- a/static/thesiah.sh +++ b/static/thesiah.sh @@ -7,6 +7,9 @@ ### OPTIONS AND VARIABLES ### dotfilesrepo="https://github.com/TheSiahxyz/.dotfiles.git" +passwordrepo="https://github.com/TheSiahxyz/.password-store.git" +obsidianrepo="https://github.com/TheSiahxyz/Obsidian.git" +webrepo="https://github.com/TheSiahxyz/THESIAH.git" progsfile="https://raw.githubusercontent.com/TheSiahxyz/THESIAH/main/static/progs.csv" aurhelper="yay" repobranch="main" @@ -50,12 +53,19 @@ getuserandpass() { epass1=$(whiptail --nocancel --passwordbox "Enter a password for ecryptfs which will be used to set up an encrypt folder." 10 60 3>&1 1>&2 2>&3 3>&1) epass2=$(whiptail --nocancel --passwordbox "Retype password." 10 60 3>&1 1>&2 2>&3 3>&1) while ! [ "$epass1" = "$epass2" ]; do - unset pass2 + unset epass2 epass1=$(whiptail --nocancel --passwordbox "Passwords do not match.\\n\\nEnter password again." 10 60 3>&1 1>&2 2>&3 3>&1) epass2=$(whiptail --nocancel --passwordbox "Retype password." 10 60 3>&1 1>&2 2>&3 3>&1) done } +repocheck() { + putrepo=$(whiptail --inputbox "Do you want to clone TheSiahxyz's repositories? y/n" 10 60 3>&1 1>&2 2>&3 3>&1) || exit 1 + while [ "$putrepo" != "y" ] && [ "$putrepo" != "n" ]; do + putrepo=$(whiptail --inputbox "Invalid option! Choose 'y' or 'n'.\nDo you want to clone TheSiahxyz's repositories? y/n" 10 60 3>&1 1>&2 2>&3 3>&1) || exit 1 + done +} + usercheck() { ! { id -u "$name" >/dev/null 2>&1; } || whiptail --title "WARNING" --yes-button "CONTINUE" \ @@ -76,7 +86,7 @@ adduserandpass() { # Adds user `$name` with password $pass1. whiptail --infobox "Adding user \"$name\"..." 7 50 useradd -m -g wheel -s /bin/zsh "$name" >/dev/null 2>&1 || - usermod -a -G wheel "$name" && mkdir -p /home/"$name"/{.config.secret,Documents,Downloads,Music,Personal,Pictures,Public,Videos} /home/"$name"/Torrents/{complete,incomplete} /home/"$name"/.local/{bin,share,src,state} /media/{flash,hdd,ssd} /mnt/extra/{backup,videos,win10} && chown "$name":wheel /home/"$name" + usermod -a -G wheel "$name" && mkdir -p /home/"$name"/{.config,.secret,Documents,Downloads,Music,Pictures,Private,Public,Videos} /home/"$name"/Torrents/{complete,incomplete} /home/"$name"/.local/{bin,share,src,state} /media/{flash,hdd,ipdisk,ssd,private} /mnt/extra/{backup,videos,win10} && chown "$name":wheel /home/"$name" export repodir="/home/$name/.local/src" mkdir -p "$repodir" chown -R "$name":wheel "$(dirname "$repodir")" @@ -89,6 +99,7 @@ refreshkeys() { *systemd*) whiptail --infobox "Refreshing Arch Keyring..." 7 40 pacman --noconfirm -S archlinux-keyring >/dev/null 2>&1 + installpkg arch-install-scripts ;; *) whiptail --infobox "Enabling Arch Repositories for more a more extensive software collection..." 7 40 @@ -96,9 +107,12 @@ refreshkeys() { artix-keyring artix-archlinux-support >/dev/null 2>&1 grep -q "^\[extra\]" /etc/pacman.conf || echo "[extra] +Include = /etc/pacman.d/mirrorlist-arch\n +[multilib] Include = /etc/pacman.d/mirrorlist-arch" >>/etc/pacman.conf pacman -Sy --noconfirm >/dev/null 2>&1 pacman-key --populate archlinux >/dev/null 2>&1 + installpkg artools-base ;; esac } @@ -295,19 +309,23 @@ addsudo() { } pamgnupg() { + whiptail --infobox "Setting up pam-gnupg..." 7 50 + $aurhelper -Qq pam-gnupg >/dev/null 2>&1 || aurinstall pam-gnupg echo "auth optional pam_gnupg.so store-only" >>/etc/pam.d/system-login >/dev/null 2>&1 echo "session optional pam_gnupg.so " >>/etc/pam.d/system-login >/dev/null 2>&1 } ecryptfssetup() { - [ -d "/home/$name/.secret" ] && [ -d "/home/$name/Personal" ] || { mkdir -p /home/"$name"/{.secret,Personal} && chown "$name":wheel /home/"$name"/{.secret,Personal} } >/dev/null 2>&1 + whiptail --infobox "Setting up ecryptfs..." 7 50 + [ -x "$(command -v "ecryptfs")" ] || installpkg ecryptfs-utils + [ -d "/home/$name/.secret" ] && [ -d "/home/$name/Private" ] || { mkdir -p /home/"$name"/{.secret,Private} && chown "$name":wheel /home/"$name"/{.secret,Private} } >/dev/null 2>&1 # Ecrypt the folder - printf '\nyes\nyes\n' | mount -t ecryptfs .secret Personal -o ecryptfs_passthrough=n,ecryptfs_enable_filename_crypto=y,passphrase_passwd="$epass1",ecryptfs_cipher=aes,ecryptfs_key_bytes=32 >/dev/null 2>&1 || exit 1 - umount /home/"$name"/Media >/dev/null 2>&1 + printf '\nyes\nyes\n' | mount -t ecryptfs .secret Private -o ecryptfs_passthrough=n,ecryptfs_enable_filename_crypto=y,passphrase_passwd="$epass1",ecryptfs_cipher=aes,ecryptfs_key_bytes=32 >/dev/null 2>&1 || exit 1 + umount /home/"$name"/Private >/dev/null 2>&1 } ufwsetup() { - whiptail --infobox "Setting service ufw..." 7 50 + whiptail --infobox "Setting up ufw..." 7 50 [ -x "$(command -v "ufw")" ] || installpkg ufw pacman -Qq ufw-"$initsys" >/dev/null 2>&1 || install ufw-"$initsys" ufw default deny incoming >/dev/null 2>&1 @@ -343,7 +361,7 @@ ufwsetup() { } sambasetup() { - whiptail --infobox "Setting service samba..." 7 50 + whiptail --infobox "Setting up samba..." 7 50 [ -x "$(command -v "samba")" ] || installpkg samba pacman -Qq samba-"$initsys" >/dev/null 2>&1 || installpkg samba-"$initsys" ufw allow 137/tcp >/dev/null 2>&1 @@ -374,36 +392,16 @@ sambasetup() { esac } -tlpsetup() { - whiptail --infobox "Setting service tlp..." 7 50 - [ -x "$(command -v "tlp")" ] || installpkg tlp - pacman -Qq tlp-"$initsys" >/dev/null 2>&1 || installpkg tlp-"$initsys" - sed -Ei "s/^#(CPU_ENERGY_PERF_POLICY_ON_AC=).*/\1balance_performance/" /etc/tlp.conf >/dev/null 2>&1 - sed -Ei "s/^#(CPU_ENERGY_PERF_POLICY_ON_BAT=).*/\1balance_poewr/" /etc/tlp.conf >/dev/null 2>&1 - sed -Ei "s/^#(START_CHARGE_THRESH_BAT0=).*/\150/" /etc/tlp.conf >/dev/null 2>&1 - sed -Ei "s/^#(STOP_CHARGE_THRESH_BAT0=).*/\175/" /etc/tlp.conf >/dev/null 2>&1 - sed -Ei "s/^#(START_CHARGE_THRESH_BAT1=).*/\150/" /etc/tlp.conf >/dev/null 2>&1 - sed -Ei "s/^#(STOP_CHARGE_THRESH_BAT1=).*/\175/" /etc/tlp.conf >/dev/null 2>&1 - case "$initsys" in - "runit") - ln -s /etc/runit/sv/tlp /run/runit/service/ >/dev/null 2>&1 - sv start tlp >/dev/null 2>&1 - ;; - "openrc") - rc-update add tlp default >/dev/null 2>&1 - rc-service tlp start >/dev/null 2>&1 - ;; - "s6") - ln -s /etc/s6/sv/tlp /run/s6/services/ >/dev/null 2>&1 - s6-svc -u /run/s6/services/tlp >/dev/null 2>&1 - ;; - esac - tlp start >/dev/null 2>&1 +bbswitchsetup() { + whiptail --infobox "Setting up bbswitch..." 7 50 + pacman -Qq bbswitch >/dev/null 2>&1 || installpkg bbswitch + echo "bbswitch" > /etc/modules-load.d/bbswitch.conf >/dev/null 2>&1 + echo "options bbswitch load_state=0 unload_state=1" > /etc/modprobe.d/bbswitch.conf >/dev/null 2>&1 } cronsetup() { - whiptail --infobox "Setting service cronjob..." 7 50 - [ -x "$(command -v "cronie")" ] || installpkg cronie + whiptail --infobox "Setting up cronjob..." 7 50 + pacman -Qq cronie >/dev/null 2>&1 || installpkg cronie pacman -Qq cronie-"$initsys" >/dev/null 2>&1 || installpkg cronie-"$initsys" case "$initsys" in "runit") @@ -421,8 +419,36 @@ cronsetup() { esac } +tlpsetup() { + whiptail --infobox "Setting up tlp..." 7 50 + [ -x "$(command -v "tlp")" ] || installpkg tlp + pacman -Qq tlp-"$initsys" >/dev/null 2>&1 || installpkg tlp-"$initsys" + sed -Ei " + s/^#(PLATFORM_PROFILE_ON_AC=).*/\1performance/g; + s/^#(PLATFORM_PROFILE_ON_BAT=).*/\1balanced/g; + s/^#(START_CHARGE_THRESH_BAT0=).*/\150/g; + s/^#(STOP_CHARGE_THRESH_BAT0=).*/\175/g; + s/^#(START_CHARGE_THRESH_BAT1=).*/\150/g; + s/^#(STOP_CHARGE_THRESH_BAT1=).*/\175/g" >/dev/null 2>&1 + case "$initsys" in + "runit") + ln -s /etc/runit/sv/tlp /run/runit/service/ >/dev/null 2>&1 + sv start tlp >/dev/null 2>&1 + ;; + "openrc") + rc-update add tlp default >/dev/null 2>&1 + rc-service tlp start >/dev/null 2>&1 + ;; + "s6") + ln -s /etc/s6/sv/tlp /run/s6/services/ >/dev/null 2>&1 + s6-svc -u /run/s6/services/tlp >/dev/null 2>&1 + ;; + esac + tlp start >/dev/null 2>&1 +} + vpnsetup() { - whiptail --infobox "Setting service vpn..." 7 50 + whiptail --infobox "Setting up vpn..." 7 50 [ -x "$(command -v "openvpn")" ] || installpkg openvpn pacman -Qq openvpn-"$initsys" >/dev/null 2>&1 || installpkg openvpn-"$initsys" pacman -Qq networkmanager-openvpn >/dev/null 2>&1 || installpkg networkmanager-openvpn @@ -447,6 +473,17 @@ Depends = dash' > /usr/share/libalpm/hooks/relinking-dash.hook ln -sfT dash /usr/bin/sh } +gpusetup() { + gpu_info=$(lspci | grep -E "VGA|Display") + if echo "$gpu_info" | grep -qi "Intel"; then + installpkg xf86-video-intel + installpkg intel-ucode + elif echo "$gpu_info" | grep -qi "AMD"; then + installpkg xf86-video-amdgpu + installpkg amd-ucode + fi +} + finalize() { # Farewell whiptail --title "All done!" \ @@ -467,6 +504,9 @@ welcomemsg || error "User exited." # Get and verify username and password. getuserandpass || error "User exited." +# Decide cloning repositories. +repocheck || error "User exited." + # Give warning if user already exists. usercheck || error "User exited." @@ -608,28 +648,51 @@ pkill -u "$name" librewolf # (like `shutdown` to run without password). addsudo -# Set pam-gnupg +[ ! -f /usr/share/libalpm/hooks/statusbar.hook ] && 'printf [Trigger] +Operation = Upgrade +Type = Package +Target = * + +[Action] +Description = Updating statusbar... +When = PostTransaction +Exec = /usr/bin/pkill -RTMIN+8 dwmblocks' >/usr/share/libalpm/hooks/statusbar.hook + +# Set up pam-gnupg pamgnupg || error "Failed to set up pam-gnupg" -# ecryptfs set up +# Set up ecryptfs ecryptfssetup || error "Failed to set up ecryptfs rules." -# ufw set up +# Set up ufw ufwsetup || error "Failed to set up ufw rules." -# samba set up +# Set up samba sambasetup || error "Failed to set up samba." -# tlp set up -tlpsetup || error "Failed to set up tlp" +# Set up bbswitch +bbswitchsetup || error "Failed to set up bbswitch" -# cronjob set up +# Set up cronjob cronsetup || error "Failed to set up cron" -# vpn set up +# Set up tlp +tlpsetup || error "Failed to set up tlp" + +# Set up vpn vpnsetup || error "Failed to set up vpn" -# dash set up +# Set up gpu +gpusetup || error "Failed to install gpu" + +# Clone TheSiahxyz's repositories +[ "$putrepo" = "y" ] && { + putgitrepo "$passwordrepo" "/home/$name/.local/share" "$repobranch" + putgitrepo "$obsidianrepo" "/home/$name" "$repobranch" + putgitrepo "$webrepo" "/home/$name" "$repobranch" +} + +# Set up dash dashsetup || error "Failed to set up dash" # Last message! Install complete! |
