Browse Source

haha murder funny

master
xSlendiX 6 months ago
parent
commit
f38aa97299
3 changed files with 301 additions and 2 deletions
  1. +15
    -2
      installer.sh
  2. +245
    -0
      post_installer.sh
  3. +41
    -0
      programs.csv

+ 15
- 2
installer.sh View File

@ -405,10 +405,16 @@ LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed"
MAKEOPTS="--jobs=$CORES"
EMERGE_DEFAULT_OPTS="--jobs=$CORES"
USE="-gnome threads xinerama git subversion openssl X -gtk -qt4 -qt5 -kde alsa"
USE="-gnome threads xinerama git subversion pulseaudio alsa alsa-lib glib -oss \
-selinux dbus openssl X -gtk -qt4 -qt5 -kde elogind -systemd \
-ios -ipod -emacs -xemacs -smartcard -quicktime -css -3dfx opengl config-file"
PORTAGE_COMPRESS="xz"
PORTAGE_COMPRESS_FLAGS="-9"
ACCEPT_LICENSE="*"
LC_MESSAGES=C
GRUB_PLATFORMS="efi-64"
$DIST_MIRROR
EOF
@ -499,6 +505,13 @@ EOF
passwd root
$ROOT_PASSWORD
$ROOT_PASSWORD
EOF
printf "$BLUE ::$RESET Downloading post_installer.sh"
$_CHROOT > /dev/null << EOF
cd
wget https://git.xslendi.xyz/xslendix/gentoo_installer/raw/branch/master/post_installer.sh
chmod +x post_installer
EOF
}
@ -512,7 +525,7 @@ do_kernel() {
cd /usr/src/linux
genkernel all --makeopts=-j${CORES} --compress-initrd --zfs
EOF
if [[ "EFI_INSTALL" -eq 1 ]]; then
if [[ "EFI_INSTALL" -eq 0 ]]; then
$_CHROOT << EOF
mount -o remount,rw /boot
grub-install /dev/sda


+ 245
- 0
post_installer.sh View File

@ -0,0 +1,245 @@
#!/bin/bash
BLACK="\033[0;30m"
BLUE="\033[0;34m"
GREEN="\033[0;32m"
CYAN="\033[0;36m"
RED="\033[0;31m"
PURPLE="\033[0;35m"
BROWN="\033[0;33m"
BLUE="\033[0;34m"
GREEN="\033[0;32m"
CYAN="\033[0;36m"
RED="\033[0;31m"
PURPLE="\033[0;35m"
BROWN="\033[0;33m"
RESET="\033[0m"
DIALOG_BACKTITLE="xSlendiX's Gentoo Installer"
log() { printf "$BLUE ::$RESET $@\n" }
error() { printf "$RED ::$RESET $@" ; exit 1 }
if ! dialog > /dev/null ; then
log "Dialog not installed. Installing..."
emerge dialog
fi
ask_questions() {
# Username
while true; do
$DIALOG --backtitle "$DIALOG_BACKTITLE" \
--title "Username" \
--inputbox "What do you wish to be your user account' username?" $DIALOG_SIZE_TEXT 2> /tmp/choice_setup
response=$?
retval=$(cat /tmp/choice_setup)
case $response in
0)
if [[ -n "$retval" ]]; then
USERNAME="$retval"
break
fi
;;
*)
;;
esac
done
# Password
while true; do
$DIALOG --backtitle "$DIALOG_BACKTITLE" --insecure --passwordbox "Enter user password" $DIALOG_SIZE_TEXT 2> /tmp/choice_setup
retval=$?
ANSWER=$(cat /tmp/choice_setup)
if [[ "$retval" -ne 0 ]]; then
continue
fi
$DIALOG --backtitle "$DIALOG_BACKTITLE" --insecure --passwordbox "Enter user password again" $DIALOG_SIZE_TEXT 2> /tmp/choice_setup
retval=$?
ANSWER2=$(cat /tmp/choice_setup)
if [[ "$retval" -ne 0 ]]; then
continue
fi
if [[ "$ANSWER" = "$ANSWER2" ]]; then
PASSWORD="$ANSWER"
break;
else
$DIALOG --backtitle "$DIALOG_BACKTITLE" \
--title "Oops!" \
--msgbox "Passwords do not match! Please try again." $DIALOG_SIZE_S
continue
fi
done
# X11
$DIALOG --backtitle "$DIALOG_BACKTITLE" \
--title "Question" --yesno "Do you use a touchpad?" $DIALOG_SIZE_S
response=$?
case $response in
0)
TOUCHPAD=" synaptics"
;;
*)
TOUCHPAD=""
;;
esac
$DIALOG --backtitle "$DIALOG_BACKTITLE" \
--title "Question" --yesno "Do you use a nVidia?" $DIALOG_SIZE_S
response=$?
case $response in
0)
NVIDIA=1
;;
*)
NVIDIA=0
;;
esac
if [[ "$NVIDIA" -ne 1 ]]; then
$DIALOG --backtitle "$DIALOG_BACKTITLE" \
--title "Question" --yesno "Do you use AMD/ATI?" $DIALOG_SIZE_S
response=$?
case $response in
0)
AMD=1
;;
*)
AMD=0
;;
esac
fi
}
TO_INSTALL=()
install_deps() {
log "Installing dependencies..."
rm -rf /etc/portage/package.use
echo "dev-vcs/subversion perl" >> /etc/portage/package.use
emerge dev-vcs/git dev-python/pip
}
pipinstall() { pip3 install "$1" > /dev/tty8 ;}
gitinstall() { \
pname="$(basename "$1" .git)"
srcdir="$repodir/$pname"
echo " :: Installing $pname in $repodir (git/make)"
sudo -u "$USERNAME" git clone --depth 1 "$1" "$srcdir" > /dev/tty8
cd "$srcdir" || error "Could not change directory to $srcdir during installation of $pname!"
sudo -u "$USERNAME" make > /dev/tty8
make install > /dev/tty8
cd /tmp || error "FATAL: Could not change directory to /tmp! Base installation may be broken!"
}
gitinstall2() { \
pname="$(basename "$1" .git)"
srcdir="$repodir/$pname"
echo " :: Installing $pname in $repodir (git/make)"
sudo -u "$USERNAME" git clone --depth 1 "$1" "$srcdir" > /dev/tty8
cd "$srcdir" || error "Could not change directory to $srcdir during installation of $pname!"
sudo -u "$USERNAME" ./autogen.sh > /dev/tty8
sudo -u "$USERNAME" ./configure > /dev/tty8
sudo -u "$USERNAME" make > /dev/tty8
make install > /dev/tty8
cd /tmp || error "FATAL: Could not change directory to /tmp! Base installation may be broken!"
}
install_loop() {
TO_INSTALL=()
([ -f "programs.csv" ] && cp "programs.csv" /tmp/prfile.csv) || curl -Ls https://git.xslendi.xyz/xslendix/gentoo_installer/raw/branch/master/programs.csv | sed '/^;/d' > /tmp/prfile.csv
total=$(wc -l /tmp/prfile.csv)
log "Total packages to be installed: $total"
while IFS=, read -r type package comment; do
n=$((n+1))
echo " :: Installing package nr. $n: $package"
echo "$comment" | grep -q "^\".*\"$" && comment="$(echo "$comment" | sed "s/\(^\"\|\"$\)//g")"
case "$type" in
"P") pipinstall "$package" ;;
"G") gitinstall "$package" ;;
"C") gitinstall2 "$package" ;;
*)
TO_INSTALL+="$package"
;;
esac
done < /tmp/prfile.csv
emerge "${TO_INSTALL[@]}"
cat >> make.conf <<EOF
INPUT_DEVICES="libinput$TOUCHPAD"
EOF
if [[ "$NVIDIA" -eq 1 ]]; then
cat >> make.conf <<EOF
VIDEO_CARDS="nouveau"
EOF
fi
if [[ "$AMD" -eq 1 ]]; then
cat >> make.conf <<EOF
VIDEO_CARDS="radeon"
EOF
fi
emerge --autounmask-continue x11-base/xorg-drivers
env-update
source /etc/profile
}
do_rice() {
log "Downloading rice"
sudo -u $USERNAME git clone --depth 1 https://git.xslendi.xyz/xSlendiX/dotfiles /home/$USERNAME/rice
log "Setting up applications"
log "vim-plug"
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
log "Changing shell of $USERNAME"
chsh -s /usr/bin/zsh $USERNAME
sudo -u "$USERNAME" mkdir -p "/home/$USERNAME/.cache/zsh"
log "Installing Oh My Zsh, bloated but who cares I like it"
sudo -u "$USERNAME" sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
log "Installing Oh My Zsh plugins"
sudo -u "$USERNAME" git clone --depth 1 https://github.com/zsh-users/zsh-autosuggestions.git .oh-my-zsh/custom/plugins/zsh-autosuggestions
sudo -u "$USERNAME" git clone --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting.git .oh-my-zsh/custom/plugins/zsh-syntax-highlighting
log "Installing rice"
sudo -u $USERNAME mv -fv ~/rice/* ~/.
sudo -u $USERNAME mv -fv ~/rice/.* ~/.
sudo -u $USERNAME rm -rf ~/.git ~/rice
log "Configuring NeoVim plugins"
sudo -u "$USERNAME" nvim +PlugInstall
log "Blacklisting pcspkr"
rmmod pcspkr
echo "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf
log "Starting Pulseaudio"
killall pulseaudio; sudo -u "$USERNAME" pulseaudio -D
}
do_services() {
log "Configuring services"
rc-update add acpid default
rc-update add mpd default
rc-update add dbus default
}
ask_questions
install_deps
install_loop
do_rice
do_services
echo "Done! Final restart needed though."

+ 41
- 0
programs.csv View File

@ -0,0 +1,41 @@
,sys-apps/lshw,
,app-misc/neofetch,
,media-gfx/feh,Image viewer used for bg
,media-gfx/scrot,Screenshot tool
,media-gfx/sxiv,Image viewer
,sys-fs/ntfs3g,ntfs
,net-misc/whois,Whois
,net-analyzer/netcat,NetCat
,app-text/zathura,PDF reader
,media-sound/pulseaudio-ctl,Pulseaudio volume control (CLI)
,media-sound/pavucontrol,Pulseaudio volume control
,app-admin/keepassxc,Password manager
,app-editors/vim,Vim
,app-editors/neovim,Neovim
,net-im/signal-desktop-bin,Signal
,www-client/firefox,Firefox
,net-misc/youtube-dl,Youtube-dl
,media-video/mpv,MPV
,app-arch/dpkg,DPKG
,net-libs/glib-networking,
,media-sound/audacity,Audacity audio editor
,doas,Is just better than sudo
,acpid,Everyone like the power button
,xinit,startx
,sxhkd,Simple X hotkey daemon
,bspwm,Binary space partitioning window manager
,media-plugins/alsa-plugins,
,x11-misc/dunst,Lightweight notification daemon
,st,
,fzf,
,zsh,
,mediainfo,Mediainfo
G,https://git.xslendi.xyz/xSlendiX/st.git,My st build
G,https://git.xslendi.xyz/xSlendiX/dmenu.git,My dmenu build
G,https://github.com/ujjwal96/xwinwrap.git,
G,https://github.com/Uniminin/Swallow.git,BSPWM swallowing
G,https://github.com/LemonBoy/bar,Lemonbar
C,https://gitlab.freedesktop.org/mawww/libxft.git,
,mpd,MPD
,x11-misc/picom,
,x11-libs/libnotify,

Loading…
Cancel
Save