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.

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