Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. user-dirs
  33. fontconfig'
  34. }
  35. _install() {
  36. if [ -e "$2" ]; then
  37. echo "$2 already exists. Skipping..."
  38. else
  39. mkdir -p "$(dirname "$2")"
  40. $OP "$DIR/$1" "$2" && echo "$1 installed to $2"
  41. fi
  42. }
  43. _render() {
  44. ntr -i:"$DIR/ntr/templates/$1" -o:"$2" "$CONTEXT"
  45. }
  46. for arg; do
  47. case $arg in
  48. h|help)
  49. _help;;
  50. -c)
  51. OP="cp -r";;
  52. nim)
  53. _install $arg.nim "$CONF/nim/config.nims";;
  54. bspwm)
  55. _install $arg "$CONF/bspwm/bspwmrc";;
  56. sxhkd)
  57. _install $arg "$CONF/sxhkd/sxhkdrc";;
  58. dunst)
  59. _render $arg "$CONF/dunst/dunstrc";;
  60. polybar)
  61. _render $arg "$CONF/polybar/config";;
  62. rofi)
  63. _install $arg.rasi "$CONF/rofi/config.rasi";;
  64. pqiv)
  65. _install $arg "$CONF/pqivrc";;
  66. mpv)
  67. _install $arg/mpv.conf "$CONF/mpv/mpv.conf";;
  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. fish)
  92. _install $arg/config.fish "$CONF/fish/config.fish";;
  93. elvish)
  94. _install $arg/rc.elv "$HOME/.elvish/rc.elv"
  95. for i in "$arg"/lib/* ; do
  96. _install "$i" "$HOME/.elvish/lib/$(basename "$i")"
  97. done;;
  98. neofetch)
  99. _install $arg.sh "$CONF/neofetch/config.conf";;
  100. gitconfig)
  101. _install $arg.ini "$CONF/git/config";;
  102. xbps-src)
  103. _install $arg "$XBPS_DISTDIR/etc/conf";;
  104. profile)
  105. _install $arg "$HOME/.profile";;
  106. Xresources)
  107. _render $arg "$HOME/.Xresources";;
  108. XCompose)
  109. _install $arg "$HOME/.XCompose";;
  110. xinit)
  111. _install sx.sh "$HOME/.xinitrc";;
  112. sx)
  113. _install $arg.sh "$CONF/sx/sxrc";;
  114. ntr)
  115. _install $arg "$CONF/ntr";;
  116. splug)
  117. _install $arg.toml "$CONF/splug/config.toml";;
  118. user-dirs)
  119. _install $arg "$CONF/user-dirs.dirs";;
  120. fontconfig)
  121. _install $arg "$CONF/fontconfig/fonts.conf";;
  122. *)
  123. echo "Not recognized argument: $arg";;
  124. esac
  125. done