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 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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. lc
  21. firefox
  22. kitty
  23. elvish
  24. kak (kakoune)
  25. pqiv
  26. mpv
  27. mpd
  28. ncmpcpp
  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 $arg.nim "$CONF/nim/config.nims";;
  56. bspwm)
  57. _install $arg "$CONF/bspwm/bspwmrc";;
  58. sxhkd)
  59. _install $arg "$CONF/sxhkd/sxhkdrc";;
  60. dunst)
  61. _render $arg "$CONF/dunst/dunstrc";;
  62. polybar)
  63. _render $arg "$CONF/polybar/config";;
  64. rofi)
  65. _install $arg.rasi "$CONF/rofi/config.rasi";;
  66. pqiv)
  67. _install $arg "$CONF/pqivrc";;
  68. mpv)
  69. _install $arg/mpv.conf "$CONF/mpv/mpv.conf";;
  70. mpd)
  71. _install $arg "$CONF/mpd/mpd.conf";;
  72. ncmpcpp)
  73. _install $arg "$CONF/ncmpcpp/config";;
  74. lc)
  75. _install $arg "$CONF/lc/config";;
  76. kak)
  77. _install $arg.kak "$CONF/kak/kakrc";;
  78. zathura)
  79. _render $arg "$CONF/zathura/zathurarc";;
  80. ranger)
  81. _install $arg/commands.py "$CONF/ranger/commands.py"
  82. _install $arg/rc.conf "$CONF/ranger/rc.conf"
  83. _install $arg/rifle.conf "$CONF/ranger/rifle.conf"
  84. _install $arg/scope.sh "$CONF/ranger/scope.sh";;
  85. kitty)
  86. _install $arg/kitty.conf "$CONF/kitty/kitty.conf"
  87. _install $arg/diff.conf "$CONF/kitty/diff.conf"
  88. _render kitty-colors "$CONF/kitty/colors.conf";;
  89. firefox)
  90. FF_DIR=$HOME/.mozilla/firefox/$(ls -tr "$HOME/.mozilla/firefox/" | grep -v profiles.ini | tail -1)
  91. FF_CHROME=$FF_DIR/chrome
  92. _install $arg/user.js "$FF_DIR/user.js"
  93. _install $arg/userChrome.css "$FF_CHROME/userChrome.css";;
  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. pulse)
  125. _install $arg/default.pa "$CONF/pulse/default.pa"
  126. _install $arg/daemon.conf "$CONF/pulse/daemon.conf";;
  127. fontconfig)
  128. _install $arg "$CONF/fontconfig/fonts.conf";;
  129. *)
  130. echo "Not recognized argument: $arg";;
  131. esac
  132. done