My scripts for startup, dmenu, and the command line
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.

85 lignes
1.5 KiB

  1. #!/bin/sh
  2. # A file used to automaticaly copy configs and macros to their appropriate
  3. # location
  4. CONFIGS=~/Source/configs
  5. MACROS=~/Source/macros
  6. # Copy a script over to /usr/local/bin and make it executable. Accepts the full
  7. # path of a file
  8. copy() {
  9. if [ ! -e $1 ]; then return 1; fi
  10. sudo cp $1 /usr/local/bin/
  11. sudo chmod a+x /usr/local/bin/$(basename $1)
  12. printf "Copied and made executable: %s\n" $(basename $1)
  13. }
  14. # Exclude files with extensions like .c or .sh that are not executable or
  15. # are incomplete and copy them over
  16. macros() {
  17. for f in $(find ~/Source/macros -maxdepth 1 -type f -not -name '*.*')
  18. do
  19. copy "$f"
  20. done
  21. }
  22. # Rebuilds selected custom applications
  23. builds() {
  24. for f in ~/Source/enabled/*
  25. do
  26. cd $f
  27. git -C $f pull
  28. sudo make clean install
  29. done
  30. }
  31. vim() {
  32. sudo cp ~/Source/configs/vimrc.local /etc/vim/vimrc.local
  33. # Should copy plugins too
  34. }
  35. neomutt() {
  36. sudo cp -r $CONFIGS/neomutt $XDG_CONFIG_HOME/
  37. }
  38. mbsync() {
  39. cp $CONFIGS/mbsyncrc ~/.mbsyncrc
  40. }
  41. bash() {
  42. cp $CONFIGS/.bashrc ~/.bashrc
  43. cp $CONFIGS/.profile ~/.profile
  44. }
  45. rtorrent() {
  46. cp $CONFIGS/.rtorrentrc
  47. }
  48. xsession() {
  49. cp $CONFIGS/.xsession ~/
  50. }
  51. installs() {
  52. ls
  53. }
  54. # Used to configure a new system or reset things for an existing one.
  55. all() {
  56. vim; neomutt; mbsync; bash; rtorrent; xsession
  57. }
  58. case $1 in
  59. configure) copy $MACROS/configure;;
  60. builds) builds;;
  61. vim) vim;;
  62. macros) macros;;
  63. rtorrent) rtorrent;;
  64. neomutt) neomutt;;
  65. bash) bash;;
  66. mbsync) mbsync;;
  67. xsession) xsession;;
  68. all) all;;
  69. *) printf "Invalid argument\n";;
  70. esac