85 lines
		
	
	
	
		
			2 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			85 lines
		
	
	
	
		
			2 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| post_install() {
 | |
|     # Initiate the stow repo
 | |
|     >&2 echo "Cloning stow git repository"
 | |
|     git clone --depth 1 --progress https://git.depeuter.tk/tdpeuter/arch-pkgs /usr/share/tdpeuter/arch-pkgs
 | |
|    
 | |
|     post_upgrade
 | |
| }
 | |
| 
 | |
| post_upgrade() {
 | |
|     install_software
 | |
|     install_fonts
 | |
|     do_stow
 | |
| }
 | |
| 
 | |
| pre_remove() {
 | |
|     rm -rf /usr/share/tdpeuter/arch-pkgs
 | |
| }
 | |
| 
 | |
| install_one() {
 | |
|     user=$(who | cut -f1 -d' ')
 | |
|     cd "/home/${user}/.cache/tdpeuter"
 | |
| 
 | |
|     >&2 echo "Installing ${1}"
 | |
|     git clone --depth 1 --progress "https://aur.archlinux.org/${1}.git"
 | |
|     cd "${1}"
 | |
|     git pull
 | |
| 
 | |
|     dir=$(pwd)
 | |
|     echo "${dir} by ${user}"
 | |
| 
 | |
|     su -c "cd ${dir} && makepkg -ic" - "${user}"
 | |
| }
 | |
| 
 | |
| install_software() {
 | |
|     install_one "betterbird-bin"
 | |
|     install_one "google-chrome"
 | |
| 
 | |
|     >&2 echo "Installing hamsket"
 | |
|     git clone --depth 1 --progress https://aur.archlinux.org/hamsket-bin.git
 | |
|     cd hamsket-bin
 | |
|     git pull
 | |
|     $(su -w PATH -c "makepkg -ic" - "${user}")
 | |
|     cd
 | |
| 
 | |
|     >&2 echo "Installing jetbrains-toolbox"
 | |
|     git clone --depth 1 --progress https://aur.archlinux.org/jetbrains-toolbox.git
 | |
|     cd jetbrains-toolbox
 | |
|     git pull
 | |
|     $(su -w PATH -c "makepkg -ic" - "${user}")
 | |
|     cd
 | |
| 
 | |
|     >&2 echo "Installing sway-git"
 | |
|     git clone --depth 1 --progress https://aur.archlinux.org/sway-git.git
 | |
|     cd sway-git
 | |
|     git pull
 | |
|     $(su -w PATH -c "makepkg -ic" - "${user}")
 | |
|     cd
 | |
| 
 | |
| }
 | |
| 
 | |
| install_fonts() {
 | |
|     mkdir -p /usr/local/share/fonts/letter
 | |
| 
 | |
|     >&2 echo "Installing letter (font)"
 | |
|     git clone --depth 1 --progress https://github.com/tdpeuter/letter.git
 | |
|     cd letter
 | |
|     cp ttf/* /usr/local/share/fonts/letter/
 | |
|     cp ttf-unhinted/* /usr/local/share/fonts/letter/
 | |
|     cp woff2/* /usr/local/share/fonts/letter/
 | |
|     cd
 | |
| }
 | |
| 
 | |
| do_stow() {
 | |
|     >&2 echo "Moving to dotfile directory"
 | |
|     cd /usr/share/tdpeuter/arch-pkgs/ 
 | |
| 
 | |
|     >&2 echo "Pulling stow git repository"
 | |
|     git pull
 | |
| 
 | |
|     user=$(who | cut -f1 -d' ')
 | |
|     packages=$(ls ./stow)
 | |
|     
 | |
|     >&2 echo "Stowing all packages"
 | |
|     stow -d ./stow -t "/home/${user}" ${packages}
 | |
| }
 |