Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

229 lines
6.9 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. #!/bin/bash
  2. source ~/.dotfiles/profile
  3. username=$(whoami)
  4. mvie(){
  5. if [ -e "$1" ];then
  6. rm -rf "$2"
  7. mv "$1" "$2"
  8. fi
  9. }
  10. # Configuring for your username
  11. if [ ! "$username" = "yigit" ]; then
  12. echo "Setting up the dotfiles according to your username"
  13. find . -type f -exec sed -i "s/\/home\/yigit/\/home\/$username/g" "{}" +
  14. fi
  15. # Don't prompt for a password for the rest of the script
  16. sudo bash -c 'echo "%wheel ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/nopwd'
  17. # Install packages
  18. echo -n "Would you like to install all the necessary packages, not doing so might break most of the functionality?(Y/n): "
  19. read deps
  20. if [ ! "$deps" = "n" ]; then
  21. echo "Running update"
  22. yay -S --needed --noconfirm $(cat ~/.dotfiles/arch-setup/packages.minimal)
  23. fi
  24. rm -rf ~/.dotfiles_backup
  25. mkdir -p ~/.dotfiles_backup
  26. # Link XDG Directories
  27. # Config
  28. mvie ~/.config ~/.dotfiles_backup
  29. ln -s ~/.dotfiles/config ~/.config
  30. for d in ~/.dotfiles_backup/config/* ; do
  31. mv $d ~/.config 2> /dev/null
  32. done
  33. #Local
  34. mkdir -p ~/.dotfiles_backup/local
  35. mkdir -p ~/.local
  36. ## Local/Share
  37. mvie ~/.local/share ~/.dotfiles_backup/local/share
  38. ln -s ~/.dotfiles/local/share ~/.local/share
  39. for d in ~/.dotfiles_backup/local/share/* ; do
  40. mv $d ~/.local/share 2> /dev/null
  41. done
  42. ## Local/Bin
  43. mvie ~/.local/bin ~/.dotfiles_backup/local/bin
  44. ln -s ~/.dotfiles/local/bin ~/.local/bin
  45. for d in ~/.dotfiles_backup/local/bin/* ; do
  46. mv $d ~/.local/bin 2> /dev/null
  47. done
  48. ## Local/Backgrounds
  49. mvie ~/.local/backgrounds ~/.dotfiles_backup/local/backgrounds
  50. ln -s ~/.dotfiles/local/backgrounds ~/.local/backgrounds
  51. for d in ~/.dotfiles_backup/local/backgrounds/* ; do
  52. mv $d ~/.local/backgrounds 2> /dev/null
  53. done
  54. ## Local/Src
  55. mvie ~/.local/src ~/.dotfiles_backup/local/src
  56. ln -s ~/.dotfiles/suckless ~/.local/src
  57. ## Theme and Icon Folders
  58. mvie ~/.themes ~/.dotfiles_backup/themes
  59. ln -s ~/.dotfiles/local/share/themes ~/.themes
  60. mvie ~/.icons ~/.dotfiles_backup/icons
  61. ln -s ~/.dotfiles/local/share/icons ~/.icons
  62. # Create individual files
  63. echo 'ZDOTDIR=$HOME/.config/zsh' > $HOME/.zshenv
  64. chmod +x $HOME/.zshenv
  65. mvie ~/.profile ~/.dotfiles_backup/profile
  66. ln -sf ~/.dotfiles/profile ~/.profile
  67. mvie ~/.bash_logout ~/.dotfiles_backup/bash_logout
  68. ln -sf ~/.dotfiles/bash_logout ~/.bash_logout
  69. cp ~/.dotfiles/config.env.def ~/.config.env
  70. # Downloading assets
  71. ##Fonts
  72. echo "Downloading assets"
  73. prev=$(pwd)
  74. curl https://minio.yigitcolakoglu.com/minio/dotfiles/tools/mc > "$HOME/.local/bin"
  75. chmod +x "$HOME/.local/bin/mc"
  76. $HOME/.local/bin/mc alias set fr1nge-dots https://minio.yigitcolakoglu.com "" ""
  77. mc cp -r yeet-dots/dotfiles/fonts/* ~/.local/share/fonts/
  78. fc-cache
  79. ## Backgrounds
  80. mc cp -r yeet-dots/dotfiles/backgrounds/* ~/.local/backgrounds/
  81. # Setup Crontab
  82. if [ ! -f "/var/spool/cron/$username" ]; then
  83. sudo touch "/var/spool/cron/$username"
  84. sudo chown $username:$username "/var/spool/cron/$username"
  85. sudo chmod 755 "/var/spool/cron/$username"
  86. echo "*/8 * * * * /home/$username/.local/bin/mailsync" > /var/spool/cron/$username
  87. echo "*/15 * * * * /home/$username/.local/bin/nextcloud-sync" >> /var/spool/cron/$username
  88. echo "* */1 * * * /home/$username/.local/bin/check-updates" >> /var/spool/cron/$username
  89. echo "*/30 * * * * /home/$username/.local/bin/firefox-sync" >> /var/spool/cron/$username
  90. echo "*/30 * * * * calcurse-caldav" >> /var/spool/cron/$username
  91. echo "*/30 * * * * vdirsyncer sync" >> /var/spool/cron/$username
  92. else
  93. echo -n "An existing cron file is detected, would you like to overwrite it?(Y/n): "
  94. read cron
  95. if [ ! "$cron" = "n" ]; then
  96. cp /var/spool/cron/$username ~/.dotfiles_backup/crontab
  97. echo "*/8 * * * * /home/$username/.local/bin/mailsync" > /var/spool/cron/$username
  98. echo "*/15 * * * * /home/$username/.local/bin/nextcloud-sync" >> /var/spool/cron/$username
  99. echo "* */1 * * * /home/$username/.local/bin/check-updates" >> /var/spool/cron/$username
  100. echo "*/30 * * * * /home/$username/.local/bin/firefox-sync" >> /var/spool/cron/$username
  101. echo "*/30 * * * * calcurse-caldav" >> /var/spool/cron/$username
  102. echo "*/30 * * * * vdirsyncer sync" >> /var/spool/cron/$username
  103. fi
  104. fi
  105. # Create necessary folders
  106. mkdir -p "$HOME/.local/share/ncmpcpp/lyrics"
  107. mkdir -p "$HOME/.local/share/calcurse"
  108. mkdir -p "$CARGO_HOME"
  109. mkdir -p "$GOPATH"
  110. mkdir -p "$ANDROID_HOME"
  111. mkdir -p "$FLUTTER_HOME"
  112. mkdir -p "$LEIN_HOME"
  113. mkdir -p "$NVM_DIR"
  114. mkdir -p "$GNUPGHOME"
  115. mkdir -p "$WEECHAT_HOME"
  116. mkdir -p "$JUPYTER_CONFIG_DIR"
  117. mkdir -p "$PYLINTHOME"
  118. mkdir -p "$HOME/.local/share/zsh"
  119. mkdir -p "$XDG_DATA_DIR/mail"
  120. mkdir -p "$XDG_CONFIG_DIR/git"
  121. mkdir -p "$XDG_CACHE_DIR/surf"
  122. chmod 700 "$GNUPGHOME"
  123. touch "$XDG_CONFIG_DIR/git/config"
  124. touch "$_Z_DATA"
  125. # Root Files and Directories
  126. sudo mkdir -p /usr/share/xsessions
  127. sudo cp ~/.dotfiles/root/dwm.desktop /usr/share/xsessions
  128. sudo cp ~/.dotfiles/root/nancyj.flf /usr/share/figlet/fonts
  129. sudo cp ~/.dotfiles/root/quark.service /usr/lib/systemd/system
  130. sudo cp ~/.dotfiles/root/kdialog /usr/local/bin/kdialog
  131. sudo cp ~/.dotfiles/root/udevil.conf /etc/udevil/udevil.conf
  132. sudo chmod +x /usr/local/bin/kdialog
  133. sudo systemctl daemon-reload
  134. sudo groupadd nogroup
  135. sudo systemctl enable quark
  136. if [ "$username" = "yigit" ]; then
  137. ~/.dotfiles/arch-setup/fetch_keys.sh # Fetch keys (For personal use, this is not for you)
  138. mkdir -p "$XDG_DATA_DIR/mail/yigitcolakoglu@hotmail.com"
  139. git config --global user.email "yigitcolakoglu@hotmail.com"
  140. git config --global user.name "Yigit Colakoglu"
  141. fi
  142. # Build and Install Everything
  143. ## Suckless utilities
  144. echo "Installing suckless utilities"
  145. (cd ~/.dotfiles/suckless; ~/.dotfiles/suckless/build.sh > /dev/null 2> /dev/null)
  146. ## Tela Icons
  147. echo "Installing Icons"
  148. ~/.dotfiles/local/share/icons/Tela-Icons/install.sh > /dev/null 2> /dev/null
  149. ## Start page
  150. echo "Setting up start page"
  151. prev=$(pwd)
  152. cd ~/.dotfiles/browser/startpage
  153. npm install > /dev/null 2> /dev/null
  154. npm run build > /dev/null 2> /dev/null
  155. cd $prev
  156. # Vim and tmux plugins
  157. mkdir -p ~/.tmux/plugins
  158. vim +PlugInstall +qall
  159. cd ~/.config/coc/extensions
  160. yarn
  161. cd $prev
  162. # Install mconnect
  163. echo "Installing mconnect"
  164. git clone https://github.com/theFr1nge/mconnect.git /tmp/mconnect.git > /dev/null 2> /dev/null
  165. cd /tmp/mconnect.git
  166. mkdir -p build
  167. cd build
  168. meson .. > /dev/null 2> /dev/null
  169. ninja > /dev/null 2> /dev/null
  170. sudo ninja install > /dev/null 2> /dev/null
  171. cd $prev
  172. mkdir -p ~/Downloads/mconnect
  173. ## Bitwarden Dmenu
  174. echo "Installing bitwardedn-dmenu"
  175. sudo git clone https://github.com/theFr1nge/bitwarden-dmenu.git /usr/share/bwdmenu > /dev/null 2> /dev/null
  176. cd /usr/share/bwdmenu
  177. sudo npm install > /dev/null 2> /dev/null
  178. sudo npm i -g > /dev/null 2> /dev/null
  179. cd $prev
  180. ## Simcrop
  181. echo "Installing simcrop"
  182. git clone https://github.com/theFr1nge/simcrop.git /tmp/simcrop > /dev/null 2> /dev/null
  183. cd /tmp/simcrop
  184. sudo make install > /dev/null 2> /dev/null
  185. cd $prev
  186. # Do a cleanup and delete some problematic files
  187. mv ~/.fzf ~/.local/share/fzf
  188. rm -rf ~/.fzf*
  189. rm -rf ~/.bash_profile
  190. sudo rm -rf /etc/urlview/system.urlview
  191. sudo rm -rf /etc/sudoers.d/nopwd