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.

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