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.9KB

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