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.

225 lines
7.0 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 -s ~/.dotfiles/profile ~/.profile
  67. cp ~/.dotfiles/config.env.def ~/.config.env
  68. # Downloading assets
  69. ##Fonts
  70. echo "Downloading assets"
  71. prev=$(pwd)
  72. cd ~/.local/share/fonts
  73. curl -O https://minio.yigitcolakoglu.com/dotfiles/Caskaydia%20Cove%20Regular%20Nerd%20Font%20Complete.otf > /dev/null 2> /dev/null
  74. curl -O https://minio.yigitcolakoglu.com/dotfiles/Caskaydia%20Cove%20Regular%20Nerd%20Font%20Complete%20Mono.otf > /dev/null 2> /dev/null
  75. curl -O https://minio.yigitcolakoglu.com/dotfiles/Caskaydia%20Cove%20Bold%20Nerd%20Font%20Complete.otf > /dev/null 2> /dev/null
  76. curl -O https://minio.yigitcolakoglu.com/dotfiles/Caskaydia%20Cove%20Bold%20Nerd%20Font%20Complete%20Mono.otf > /dev/null 2> /dev/null
  77. fc-cache
  78. ## Backgrounds
  79. cd ~/.local/backgrounds
  80. curl -O https://minio.yigitcolakoglu.com/dotfiles/lock.jpg > /dev/null 2> /dev/null
  81. curl -O https://minio.yigitcolakoglu.com/dotfiles/wallpaper-mountain.jpg > /dev/null 2> /dev/null
  82. curl -O https://minio.yigitcolakoglu.com/dotfiles/wallpaper-sea.jpg > /dev/null 2> /dev/null
  83. curl -O https://minio.yigitcolakoglu.com/dotfiles/wallpaper-shack.jpg > /dev/null 2> /dev/null
  84. cd $prev
  85. # Setup Crontab
  86. if [ ! -f "/var/spool/cron/$username" ]; then
  87. sudo touch "/var/spool/cron/$username"
  88. sudo chown $username:$username "/var/spool/cron/$username"
  89. sudo chmod 755 "/var/spool/cron/$username"
  90. echo "*/8 * * * * /home/$username/.local/bin/mailsync" > /var/spool/cron/$username
  91. echo "*/15 * * * * /home/$username/.local/bin/scripts/nextcloud-sync" >> /var/spool/cron/$username
  92. echo "*/30 * * * * calcurse-caldav" >> /var/spool/cron/$username
  93. echo "*/30 * * * * vdirsyncer sync" >> /var/spool/cron/$username
  94. else
  95. echo -n "An existing cron file is detected, would you like to overwrite it?(Y/n): "
  96. read cron
  97. if [ ! "$cron" = "n" ]; then
  98. cp /var/spool/cron/$username ~/.dotfiles_backup/crontab
  99. echo "*/8 * * * * /home/$username/.local/bin/mailsync" > /var/spool/cron/$username
  100. echo "*/15 * * * * /home/$username/.local/bin/scripts/nextcloud-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 "$_Z_DATA"
  124. # Root Files and Directories
  125. sudo mkdir -p /usr/share/xsessions
  126. sudo cp ~/.dotfiles/root/dwm.desktop /usr/share/xsessions
  127. sudo cp ~/.dotfiles/root/nancyj.flf /usr/share/figlet/fonts
  128. sudo cp ~/.dotfiles/root/quark.service /usr/lib/systemd/system
  129. sudo cp ~/.dotfiles/root/kdialog /usr/local/bin/kdialog
  130. sudo cp ~/.dotfiles/root/udevil.conf /etc/udevil/udevil.conf
  131. sudo chmod +x /usr/local/bin/kdialog
  132. sudo systemctl daemon-reload
  133. sudo groupadd nogroup
  134. sudo systemctl enable quark
  135. if [ "$username" = "yigit" ]; then
  136. ~/.dotfiles/arch-setup/fetch_keys.sh # Fetch keys (For personal use, this is not for you)
  137. mkdir -p "$XDG_DATA_DIR/mail/yigitcolakoglu@hotmail.com"
  138. git config --global user.email "yigitcolakoglu@hotmail.com"
  139. git config --global user.name "Yigit Colakoglu"
  140. fi
  141. # Build and Install Everything
  142. ## Suckless utilities
  143. echo "Installing suckless utilities"
  144. (cd ~/.dotfiles/suckless; ~/.dotfiles/suckless/build.sh > /dev/null 2> /dev/null)
  145. ## Tela Icons
  146. echo "Installing Icons"
  147. ~/.dotfiles/local/share/icons/Tela-Icons/install.sh > /dev/null 2> /dev/null
  148. ## Start page
  149. echo "Setting up start page"
  150. prev=$(pwd)
  151. cd ~/.dotfiles/browser/startpage
  152. npm install > /dev/null 2> /dev/null
  153. npm run build > /dev/null 2> /dev/null
  154. cd $prev
  155. # Vim and tmux plugins
  156. mkdir -p ~/.tmux/plugins
  157. vim +PlugInstall +qall
  158. cd ~/.config/coc/extensions
  159. yarn
  160. cd $prev
  161. # Install mconnect
  162. echo "Installing mconnect"
  163. git clone https://github.com/theFr1nge/mconnect.git /tmp/mconnect.git > /dev/null 2> /dev/null
  164. cd /tmp/mconnect.git
  165. mkdir -p build
  166. cd build
  167. meson .. > /dev/null 2> /dev/null
  168. ninja > /dev/null 2> /dev/null
  169. sudo ninja install > /dev/null 2> /dev/null
  170. cd $prev
  171. mkdir -p ~/Downloads/mconnect
  172. ## Bitwarden Dmenu
  173. echo "Installing bitwardedn-dmenu"
  174. sudo git clone https://github.com/theFr1nge/bitwarden-dmenu.git /usr/share/bwdmenu > /dev/null 2> /dev/null
  175. cd /usr/share/bwdmenu
  176. sudo npm install > /dev/null 2> /dev/null
  177. sudo npm i -g > /dev/null 2> /dev/null
  178. cd $prev
  179. ## Simcrop
  180. echo "Installing simcrop"
  181. git clone https://github.com/theFr1nge/simcrop.git /tmp/simcrop > /dev/null 2> /dev/null
  182. cd /tmp/simcrop
  183. sudo make install > /dev/null 2> /dev/null
  184. cd $prev
  185. # Do a cleanup and delete some problematic files
  186. mv ~/.fzf ~/.local/share/fzf
  187. rm -rf ~/.fzf*
  188. rm -rf ~/.bash_profile
  189. sudo rm -rf /etc/urlview/system.urlview
  190. sudo rm -rf /etc/sudoers.d/nopwd