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.

setup 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. #!/bin/sh
  2. cd "$(dirname "$0")"
  3. OP="ln -s"
  4. DIR="$(pwd)"
  5. CONF=${XDG_CONFIG_HOME:-$HOME/.config/}
  6. CONTEXT=${COLORSCHEME:-$(ls "$DIR/ntr/contexts" | sort -R | head -1)}
  7. _help() {
  8. echo 'Available targets:
  9. profile
  10. nim
  11. ntr
  12. splug
  13. xinit | sx
  14. Xresources
  15. bspwm
  16. sxhkd
  17. polybar
  18. dunst
  19. rofi
  20. firefox
  21. kitty
  22. elvish
  23. kak (kakoune)
  24. pqiv
  25. mpv
  26. mpd
  27. ncmpcpp
  28. ranger
  29. zathura
  30. neofetch
  31. user-dirs
  32. fontconfig'
  33. }
  34. _install() {
  35. if [ -e "$2" ]; then
  36. echo "$2 already exists. Skipping..."
  37. else
  38. mkdir -p "$(dirname "$2")"
  39. $OP "$DIR/$1" "$2" && echo "$1 installed to $2"
  40. fi
  41. }
  42. _render() {
  43. ntr -i:"$DIR/ntr/templates/$1" -o:"$2" "$CONTEXT"
  44. }
  45. for arg; do
  46. case $arg in
  47. h|help)
  48. _help;;
  49. -c)
  50. OP="cp -r";;
  51. nim)
  52. _install $arg.nim "$CONF/nim/config.nims";;
  53. bspwm)
  54. _install $arg "$CONF/bspwm/bspwmrc";;
  55. sxhkd)
  56. _install $arg "$CONF/sxhkd/sxhkdrc";;
  57. dunst)
  58. _render $arg "$CONF/dunst/dunstrc";;
  59. polybar)
  60. _render $arg "$CONF/polybar/config";;
  61. rofi)
  62. _install $arg.rasi "$CONF/rofi/config.rasi";;
  63. pqiv)
  64. _install $arg "$CONF/pqivrc";;
  65. mpv)
  66. _install $arg/mpv.conf "$CONF/mpv/mpv.conf"
  67. _install $arg/scripts "$CONF/mpv/scripts";;
  68. mpd)
  69. _install $arg "$CONF/mpd/mpd.conf";;
  70. ncmpcpp)
  71. _install $arg "$CONF/ncmpcpp/config";;
  72. kak)
  73. _install $arg/kakrc "$CONF/kak/kakrc"
  74. _install $arg/autoload "$CONF/kak/autoload";;
  75. zathura)
  76. _render $arg "$CONF/zathura/zathurarc";;
  77. ranger)
  78. _install $arg/commands.py "$CONF/ranger/commands.py"
  79. _install $arg/rc.conf "$CONF/ranger/rc.conf"
  80. _install $arg/rifle.conf "$CONF/ranger/rifle.conf"
  81. _install $arg/scope.sh "$CONF/ranger/scope.sh";;
  82. kitty)
  83. _install $arg/kitty.conf "$CONF/kitty/kitty.conf"
  84. _install $arg/diff.conf "$CONF/kitty/diff.conf"
  85. _render kitty-colors "$CONF/kitty/colors.conf";;
  86. firefox)
  87. FF_DIR=$HOME/.mozilla/firefox/$(ls -tr "$HOME/.mozilla/firefox/" | grep -v profiles.ini | tail -1)
  88. FF_CHROME=$FF_DIR/chrome
  89. _install $arg/user.js "$FF_DIR/user.js"
  90. _install $arg/userChrome.css "$FF_CHROME/userChrome.css";;
  91. elvish)
  92. _install $arg/rc.elv "$HOME/.elvish/rc.elv"
  93. for i in "$arg"/lib/* ; do
  94. _install "$i" "$HOME/.elvish/lib/$(basename "$i")"
  95. done;;
  96. neofetch)
  97. _install $arg.sh "$CONF/neofetch/config.conf";;
  98. gitconfig)
  99. _install $arg.ini "$CONF/git/config";;
  100. xbps-src)
  101. _install $arg "$XBPS_DISTDIR/etc/conf";;
  102. profile)
  103. _install $arg "$HOME/.profile";;
  104. Xresources)
  105. _render $arg "$HOME/.Xresources";;
  106. XCompose)
  107. _install $arg "$HOME/.XCompose";;
  108. xinit)
  109. _install sx.sh "$HOME/.xinitrc";;
  110. sx)
  111. _install $arg.sh "$CONF/sx/sxrc";;
  112. ntr)
  113. _install $arg "$CONF/ntr";;
  114. splug)
  115. _install $arg.toml "$CONF/splug/config.toml";;
  116. user-dirs)
  117. _install $arg "$CONF/user-dirs.dirs";;
  118. fontconfig)
  119. _install $arg "$CONF/fontconfig/fonts.conf";;
  120. *)
  121. echo "Not recognized argument: $arg";;
  122. esac
  123. done