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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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 "$CONF/lc/config";;
  76. kak)
  77. _install kak.kak "$CONF/kak/kakrc";;
  78. zathura)
  79. _render zathura "$CONF/zathura/zathurarc";;
  80. ranger)
  81. _install ranger/commands.py "$CONF/ranger/commands.py"
  82. _install ranger/rc.conf "$CONF/ranger/rc.conf"
  83. _install ranger/rifle.conf "$CONF/ranger/rifle.conf"
  84. _install ranger/scope.sh "$CONF/ranger/scope.sh";;
  85. kitty)
  86. _install kitty/kitty.conf "$CONF/kitty/kitty.conf"
  87. _install kitty/diff.conf "$CONF/kitty/diff.conf"
  88. _render kitty-colors "$CONF/kitty/colors.conf";;
  89. firefox)
  90. FF_DIR=$HOME/.mozilla/firefox/$(ls -t "$HOME/.mozilla/firefox/" | grep -v profiles.ini | head -1)
  91. FF_CHROME=$FF_DIR/chrome
  92. _install firefox/user.js "$FF_DIR/user.js"
  93. _install firefox/userChrome.css "$FF_CHROME/userChrome.css"
  94. nim e -p:$HOME/sns/ firefox/homepage.nims >"$HOME/.mozilla/firefox/homepage.html"
  95. _render homepage.css "$HOME/.mozilla/firefox/homepage.css";;
  96. elvish)
  97. _install elvish/rc.elv "$HOME/.elvish/rc.elv"
  98. for i in elvish/lib/* ; do
  99. _install "$i" "$HOME/.elvish/lib/$(basename "$i")"
  100. done;;
  101. neofetch)
  102. _install neofetch.sh "$CONF/neofetch/config.conf";;
  103. gitconfig)
  104. _install gitconfig.ini "$CONF/git/config";;
  105. xbps-src)
  106. _install xbps-src "$XBPS_DISTDIR/etc/conf";;
  107. profile)
  108. _install profile "$HOME/.profile";;
  109. Xresources)
  110. _render Xresources "$HOME/.Xresources";;
  111. XCompose)
  112. _install XCompose "$HOME/.XCompose";;
  113. xinit)
  114. _install sx.sh "$HOME/.xinitrc";;
  115. sx)
  116. _install sx.sh "$CONF/sx/sxrc";;
  117. ntr)
  118. _install ntr "$CONF/ntr";;
  119. splug)
  120. _install splug.toml "$CONF/splug/config.toml";;
  121. gtk)
  122. _install gtk/gtkrc "${GTK2_RC_FILES:-$HOME/.gtkrc}"
  123. _install gtk/settings.ini "$CONF/gtk-3.0/settings.ini";;
  124. user-dirs)
  125. _install user-dirs "$CONF/user-dirs.dirs";;
  126. pulse)
  127. _install pulse/default.pa "$CONF/pulse/default.pa"
  128. _install pulse/daemon.conf "$CONF/pulse/daemon.conf";;
  129. fontconfig)
  130. _install fontconfig "$CONF/fontconfig/fonts.conf";;
  131. xonotic)
  132. _install xonotic.cfg "$HOME/.xonotic/autoexec.cfg";;
  133. *)
  134. echo "Not recognized argument: $arg";;
  135. esac
  136. done