summaryrefslogtreecommitdiff
path: root/INSTALL/gentoo-install
blob: a574a4f58f36d141833c6a768c693e45d728fef3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/sh

#
# Gentoo dots install
#

cd .. || exit
CURDIR=$(pwd)

echo "######################"
echo "# dotfiles Installer #"
echo "######################"
echo "|    Gentoo Linux    |"
echo "**********************"

if [ "$(id -u)" = "0" ]; then
	cp -rf ROOT/doas/doas.conf /etc
	cp -rf ROOT/issue/issue /etc
	cp -rf ROOT/hosts/hosts /etc

	printf "Do you want to install User Packages? [Y/n]" && read -r USERPACKAGES
	if [ "$USERPACKAGES" != "N" ] && [ "$USERPACKAGES" != "n" ]; then
		emerge --ask --quiet app-text/zathura-meta sys-fs/ntfs3g noto-emoji noto-cjk vifm make bc xorg-x11 xinit zsh doas sys-fs/dosfstools app-editors/neovim pulsemixer pipewire gentoolkit stow app-admin/pass app-arch/p7zip app-arch/p7zip zathura zathura-pdf-poppler xwallpaper x11-misc/xclip sxiv mpv newsboat ncmpcpp media-sound/mpc mpd redshift android-tools texlive-latex texlive-latexextra texlive-latexrecommended net-libs/nodejs libreoffice-bin unoconv dev-util/ctags gimp imagemagick net-misc/ntp maim net-libs/webkit-gtk media-libs/gst-plugins-good media-plugins/gst-plugins-libav latex-beamer go sys-apps/net-tools app-emulation/libvirt app-emulation/qemu app-emulation/virt-manager neofetch dev-python/pip x11-themes/arc-theme x11-themes/papirus-icon-theme ffmpegthumbnailer x11-misc/screenkey net-misc/yt-dlp net-p2p/transmission x11-misc/picom media-gfx/simple-scan dev-python/lxml media-libs/vulkan-loader media-libs/vulkan-layers net-print/hplip net-print/cups testdisk foremost app-crypt/swtpm && poweroff

		# Adding System default init services
		# go to https://localhost:631/ to configure the printer or run hp-setup
		USER=$(getent passwd | cut -d: -f6 | grep ^\/home | cut -d/ -f3 | head -1)
		gpasswd -a "$USER" lp
		gpasswd -a "$USER" lpadmin
		rc-update add cupsd default
	fi

	printf "Do you want to install Extra Packages? [Y/n]" && read -r EXTRA
	if [ "$EXTRA" != "N" ] && [ "$EXTRA" != "n" ]; then
		emerge --ask --quiet app-emulation/winetricks games-util/lutris app-emulation/wine-staging
		poweroff
	fi
else
	{

		# Building Folder Structure
		mkdir -p ~/Documents/PDF ~/Documents/Text ~/Documents/Disks ~/Documents/Archives ~/Documents/VMs ~/Downloads ~/Games/WINEPREFIX ~/Pictures/Screenshots ~/Pictures/GIMP ~/Videos/Recordings ~/Code ~/.config/git ~/.config/wallpaper ~/.local/share/gnupg ~/.local/share/pass

		doas sh -c 'echo "export _JAVA_AWT_WM_NONREPARENTING=1" >>/etc/profile.d/jre.sh'
		chsh -s /bin/zsh

		# Deploy Dots
		stow --target="$HOME" fonts gtk man misc mpd ncmpcpp newsboat neovim npm picom qt shell scripts suckless sxiv vifm X11 zathura zsh
		touch ~/.config/X11/Xauthority ~/.config/mpd/database ~/.config/mpd/log ~/.config/mpd/pid  ~/.config/mpd/state ~/.config/mpd/sticker.sql

		cd ~/.local/src && sh compileSource && cd "$CURDIR" || exit

		# Installing python scripts
		pip install --user pywal ueberzug

		# Setting up Neovim
		## Linking Neovim to Vim
		ln -s /usr/bin/nvim ~/.local/bin/vim

		## Installing Neovim Plugin Manager (Vim Plug)
		curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
			https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

		## Installing Plugins
		nvim -c PlugInstall

		# Setup Git account
		printf "Do yo want to setup Git account? [Y/n]" && read -r GIT
		if [ "$GIT" != "N" ] && [ "$GIT" != "n" ]; then
			printf "Username: " && read -r USER
			printf "Email: " && read -r EMAIL
			git config --global user.name "$USER"
			git config --global user.email "$EMAIL"
			git config pull.rebase false
			mv ~/.gitconfig ~/.config/git/config
			git config --global pull.rebase false
		fi
	}
fi