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.

239 lines
7.2 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
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.rice) && exit 1
  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/dotfiles/tools/mc > "$HOME/.local/bin/mc"
  75. chmod +x "$HOME/.local/bin/mc"
  76. $HOME/.local/bin/mc alias set fr1nge-dots https://minio.yigitcolakoglu.com "" ""
  77. mc cp -r fr1nge-dots/dotfiles/fonts/ ~/.local/share/fonts/
  78. fc-cache
  79. ## Backgrounds
  80. mc cp -r fr1nge-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 0644 "/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 "0 * * * * /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 "0 * * * * /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_HOME/mail"
  120. mkdir -p "$XDG_CONFIG_HOME/git"
  121. mkdir -p "$XDG_CACHE_HOME/surf"
  122. mkdir -p "$HOME/.ssh"
  123. echo "AddKeysToAgent yes" > "$HOME/.ssh/config"
  124. chmod 700 "$GNUPGHOME"
  125. touch "$XDG_CONFIG_HOME/git/config"
  126. touch "$_Z_DATA"
  127. # Root Files and Directories
  128. sudo mkdir -p /usr/share/xsessions
  129. sudo cp ~/.dotfiles/root/dwm.desktop /usr/share/xsessions
  130. sudo cp ~/.dotfiles/root/issue /etc/issue
  131. sudo cp ~/.dotfiles/root/motd /etc/motd
  132. sudo cp ~/.dotfiles/root/nancyj.flf /usr/share/figlet/fonts
  133. if [ "$(grep artix < $(uname -a))" = "" ]; then
  134. sudo cp ~/.dotfiles/root/quark /etc/init.d
  135. else
  136. sudo cp ~/.dotfiles/root/quark.service /usr/lib/systemd/system
  137. fi
  138. sudo cp ~/.dotfiles/root/kdialog /usr/local/bin/kdialog
  139. sudo cp ~/.dotfiles/root/udevil.conf /etc/udevil/udevil.conf
  140. sudo chmod +x /usr/local/bin/kdialog
  141. sudo systemctl daemon-reload
  142. sudo groupadd nogroup
  143. sudo systemctl enable quark
  144. if [ "$username" = "yigit" ]; then
  145. ~/.dotfiles/arch-setup/fetch_keys.sh # Fetch keys (For personal use, this is not for you)
  146. mkdir -p "$XDG_DATA_HOME/mail/yigitcolakoglu@hotmail.com"
  147. git config --global user.email "yigitcolakoglu@hotmail.com"
  148. git config --global user.name "Yigit Colakoglu"
  149. fi
  150. # Build and Install Everything
  151. ## Suckless utilities
  152. echo "Installing suckless utilities"
  153. (cd ~/.dotfiles/suckless; ~/.dotfiles/suckless/build.sh > /dev/null 2> /dev/null)
  154. ## Tela Icons
  155. echo "Installing Icons"
  156. ~/.dotfiles/local/share/icons/Tela-Icons/install.sh > /dev/null 2> /dev/null
  157. ## Start page
  158. echo "Setting up start page"
  159. prev=$(pwd)
  160. cd ~/.dotfiles/browser/startpage
  161. sudo npm install -g parcel-bundler
  162. npm install > /dev/null 2> /dev/null
  163. npm run build > /dev/null 2> /dev/null
  164. cd $prev
  165. # Vim and tmux plugins
  166. mkdir -p ~/.tmux/plugins
  167. vim +PlugInstall +qall
  168. cd ~/.config/coc/extensions
  169. yarn
  170. cd $prev
  171. # Install mconnect
  172. echo "Installing mconnect"
  173. git clone https://github.com/theFr1nge/mconnect.git /tmp/mconnect.git > /dev/null 2> /dev/null
  174. cd /tmp/mconnect.git
  175. mkdir -p build
  176. cd build
  177. meson .. > /dev/null 2> /dev/null
  178. ninja > /dev/null 2> /dev/null
  179. sudo ninja install > /dev/null 2> /dev/null
  180. cd $prev
  181. mkdir -p ~/Downloads/mconnect
  182. ## Bitwarden Dmenu
  183. echo "Installing bitwardedn-dmenu"
  184. sudo git clone https://github.com/theFr1nge/bitwarden-dmenu.git /usr/share/bwdmenu > /dev/null 2> /dev/null
  185. cd /usr/share/bwdmenu
  186. sudo npm install > /dev/null 2> /dev/null
  187. sudo npm i -g > /dev/null 2> /dev/null
  188. cd $prev
  189. ## Simcrop
  190. echo "Installing simcrop"
  191. git clone https://github.com/theFr1nge/simcrop.git /tmp/simcrop > /dev/null 2> /dev/null
  192. cd /tmp/simcrop
  193. sudo make install > /dev/null 2> /dev/null
  194. cd $prev
  195. # Do a cleanup and delete some problematic files
  196. rm -rf ~/.fzf*
  197. rm -rf ~/.bash_profile
  198. rm -rf ~/.dotfiles/yarn.lock
  199. rm -rf ~/.dotfiles/.git/hooks/*
  200. sudo rm -rf /etc/urlview/system.urlview
  201. sudo rm -rf /etc/sudoers.d/nopwd