setup 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #!/bin/sh
  2. _pkg_installed() {
  3. echo $(($(xbps-query -l | grep $1 | wc -l)))
  4. }
  5. # home (sweet home)
  6. home_target_dir=/home/strlst
  7. cd "$home_target_dir"
  8. ln -sf ~/dotfiles"$home_target_dir"/.aliases ~/.aliases
  9. echo "ln -sf ~/dotfiles$home_target_dir/.aliases ~/.aliases"
  10. ln -sf ~/dotfiles"$home_target_dir"/.xinitrc ~/.xinitrc
  11. echo "ln -sf ~/dotfiles$home_target_dir/.xinitrc ~/.xinitrc"
  12. ln -sf ~/dotfiles"$home_target_dir"/.xprofile ~/.xprofile
  13. echo "ln -sf ~/dotfiles$home_target_dir/.xprofile ~/.xprofile"
  14. ln -sf ~/dotfiles"$home_target_dir"/.profile ~/.profile
  15. echo "ln -sf ~/dotfiles$home_target_dir/.profile ~/.profile"
  16. #ln -sf ~/dotfiles"$home_target_dir"/.mkshrc ~/.mkshrc
  17. #echo "ln -sf ~/dotfiles$home_target_dir/.mkshrc ~/.mkshrc"
  18. ln -sf ~/dotfiles"$home_target_dir"/.bashrc ~/.bashrc
  19. echo "ln -sf ~/dotfiles$home_target_dir/.mkshrc ~/.mkshrc"
  20. ln -sf ~/dotfiles"$home_target_dir"/.bash_profile ~/.bash_profile
  21. echo "ln -sf ~/dotfiles$home_target_dir/.mkshrc ~/.mkshrc"
  22. ln -sf ~/dotfiles"$home_target_dir"/.urlview ~/.urlview
  23. echo "ln -sf ~/dotfiles$home_target_dir/.urlview ~/.urlview"
  24. ln -sf ~/dotfiles"$home_target_dir"/.xbindkeysrc ~/.xbindkeysrc
  25. echo "ln -sf ~/dotfiles$home_target_dir/.xbindkeysrc ~/.xbindkeysrc"
  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"$home_target_dir"/.newsboat/config ~/.newsboat/config
  32. echo "ln -sf ~/dotfiles$home_target_dir/.newsboat/config ~/.newsboat/config"
  33. ln -sf ~/dotfiles"$home_target_dir"/.newsboat/urls ~/.newsboat/urls
  34. echo "ln -sf ~/dotfiles$home_target_dir/.newsboat/urls ~/.newsboat/urls"
  35. fi
  36. if [ $(_pkg_installed ghc) -eq 1 ]; then
  37. ln -sf ~/dotfiles"$home_target_dir"/.ghci ~/.ghci
  38. echo "ln -sf ~/dotfiles$home_target_dir/.ghci ~/.ghci"
  39. fi
  40. if [ $(_pkg_installed qutebrowser) -eq 1 ]; then
  41. cp -r ~/dotfiles"$home_target_dir"/.config/qutebrowser ~/.config
  42. echo "cp -r ~/dotfiles$home_target_dir/.config/qutebrowser ~/.config"
  43. cp -r ~/dotfiles"$home_target_dir"/.local/share/qutebrowser ~/.local/share
  44. echo "cp -r ~/dotfiles$home_target_dir/.local/share/qutebrowser ~/.local/share"
  45. fi
  46. [ ! -d ./bin ] &
  47. cp -r ~/dotfiles"$home_target_dir"/bin .
  48. echo "cp -r ~/dotfiles$home_target_dir/bin ."
  49. [ ! -d ./.config ] &
  50. cp -r ~/dotfiles"$home_target_dir"/.config .
  51. echo "cp -r ~/dotfiles$home_target_dir/.config ."
  52. # bgs
  53. rm -rf ~/.config/walls
  54. echo "rm -rf ~/.config/walls"
  55. cp -r ~/dotfiles"$home_target_dir"/.config/walls ~/.config/
  56. echo "cp -r ~/dotfiles$home_target_dir/.config/walls ~/.config/"
  57. # vis
  58. vis_target_dir=/usr/share/vis
  59. sudo cp ~/dotfiles"$vis_target_dir"/visrc.lua "$vis_target_dir"
  60. echo "sudo cp ~/dotfiles$vis_target_dir/visrc.lua $vis_target_dir"
  61. sudo cp -r ~/dotfiles"$vis_target_dir"/themes "$vis_target_dir"
  62. echo "sudo cp -r ~/dotfiles$vis_target_dir/themes $vis_target_dir"
  63. sudo cp -r ~/dotfiles"$vis_target_dir"/plugins "$vis_target_dir"
  64. echo "sudo cp -r ~/dotfiles$vis_target_dir/plugins $vis_target_dir"
  65. # lf
  66. cp -r ~/dotfiles"$home_target_dir"/.config/lf "$home_target_dir"/.config
  67. echo "cp -r ~/dotfiles$home_target_dir/.config/lf $home_target_dir/.config"
  68. # mnt
  69. mkdir -p ~/1mnt ~/2mnt ~/3mnt
  70. echo "mkdir -p ~/1mnt ~/2mnt ~/3mnt"
  71. # backlight
  72. [ $PERSONALDEVICE -eq 1 ] &&
  73. sudo sudo cp ~/dotfiles"$home_target_dir"/.config/udev/20-backlight.rules /usr/lib/udev/rules.d/20-backlight.rules &&
  74. echo "sudo cp ~/dotfiles$home_target_dir/.config/udev/20-backlight.rules /usr/lib/udev/rules.d/20-backlight.rules"