選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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