setup 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #!/bin/sh
  2. _pkg_installed() {
  3. echo $(($(xbps-query -l | grep $1 | wc -l)))
  4. }
  5. cd ~
  6. ln -sf ~/dotfiles/.aliases ~/.aliases
  7. echo "ln -sf ~/dotfiles/.aliases ~/.aliases"
  8. ln -sf ~/dotfiles/.xinitrc ~/.xinitrc
  9. echo "ln -sf ~/dotfiles/.xinitrc ~/.xinitrc"
  10. ln -sf ~/dotfiles/.xprofile ~/.xprofile
  11. echo "ln -sf ~/dotfiles/.xprofile ~/.xprofile"
  12. ln -sf ~/dotfiles/.profile ~/.profile
  13. echo "ln -sf ~/dotfiles/.profile ~/.profile"
  14. #ln -sf ~/dotfiles/.mkshrc ~/.mkshrc
  15. #echo "ln -sf ~/dotfiles/.mkshrc ~/.mkshrc"
  16. ln -sf ~/dotfiles/.bashrc ~/.bashrc
  17. echo "ln -sf ~/dotfiles/.mkshrc ~/.mkshrc"
  18. ln -sf ~/dotfiles/.bash_profile ~/.bash_profile
  19. echo "ln -sf ~/dotfiles/.mkshrc ~/.mkshrc"
  20. ln -sf ~/dotfiles/.urlview ~/.urlview
  21. echo "ln -sf ~/dotfiles/.urlview ~/.urlview"
  22. ln -sf ~/dotfiles/.xbindkeysrc ~/.xbindkeysrc
  23. echo "ln -sf ~/dotfiles/.xbindkeysrc ~/.xbindkeysrc"
  24. ln -sf ~/dotfiles/.config/dunst/.dunstrc ~/.config/dunst/.dunstrc
  25. echo "ln -sf ~/dotfiles/.config/dunst/.dunstrc ~/.config/dunst/.dunstrc"
  26. # xq -l:
  27. # your pkg manager here, where the query returns 1 line or none
  28. # grep newsboat
  29. # your package for newsboat here, depending which name pkg sources use
  30. if [ $(_pkg_installed newsboat) -eq 1 ]; then
  31. ln -sf ~/dotfiles/.newsboat/config ~/.newsboat/config
  32. echo "ln -sf ~/dotfiles/.newsboat/config ~/.newsboat/config"
  33. ln -sf ~/dotfiles/.newsboat/urls ~/.newsboat/urls
  34. echo "ln -sf ~/dotfiles/.newsboat/urls ~/.newsboat/urls"
  35. fi
  36. if [ $(_pkg_installed ghc) -eq 1 ]; then
  37. ln -sf ~/dotfiles/.ghci ~/.ghci
  38. echo "ln -sf ~/dotfiles/.ghci ~/.ghci"
  39. fi
  40. if [ $(_pkg_installed qutebrowser) -eq 1 ]; then
  41. cp -r ~/dotfiles/.config/qutebrowser ~/.config
  42. echo "cp -r ~/dotfiles/.config/qutebrowser ~/.config"
  43. cp -r ~/dotfiles/.local/share/qutebrowser ~/.local/share
  44. echo "cp -r ~/dotfiles/.local/share/qutebrowser ~/.local/share"
  45. fi
  46. [ ! -d ./bin ] &
  47. cp -r ~/dotfiles/bin .
  48. echo "cp -r ~/dotfiles/bin ."
  49. [ ! -d ./.config ] &
  50. cp -r ~/dotfiles/.config .
  51. echo "cp -r ~/dotfiles/.config ."
  52. # bgs
  53. rm -rf ~/.config/walls
  54. echo "rm -rf ~/.config/walls"
  55. cp -r ~/dotfiles/.config/walls ~/.config/
  56. echo "cp -r ~/dotfiles/.config/walls ~/.config/"
  57. # vis
  58. cd /usr/share/vis
  59. sudo cp ~/dotfiles/vis/visrc.lua .
  60. echo "sudo cp ~/dotfiles/vis/visrc.lua ."
  61. sudo cp ~/dotfiles/vis/themes/* ./themes/
  62. echo "sudo cp ~/dotfiles/vis/themes/* ./themes/"
  63. sudo cp ~/dotfiles/vis/plugins/* ./plugins/
  64. echo "sudo cp ~/dotfiles/vis/plugins/* ./plugins/"
  65. # mnt
  66. cd ~
  67. mkdir -p ~/1mnt ~/2mnt ~/3mnt
  68. echo "mkdir -p ~/1mnt ~/2mnt ~/3mnt"
  69. # backlight
  70. [ $PERSONALDEVICE -eq 1 ] &&
  71. sudo sudo cp ~/dotfiles/.config/udev/20-backlight.rules /usr/lib/udev/rules.d/20-backlight.rules &&
  72. echo "sudo cp ~/dotfiles/.config/udev/20-backlight.rules /usr/lib/udev/rules.d/20-backlight.rules"