dkeger 621 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. # IMPORTANT: add #include </home/user/.Xresources_colors>
  3. # to your ~/.Xresources file, preferrably at the bottom
  4. XRES=~/.Xresources_colors
  5. COLORS=~/xcolors/xcolor_code
  6. term_restart(){
  7. xrdb -merge ~/.Xresources
  8. /bin/bash -c x-terminal-emulator &
  9. }
  10. menu(){
  11. array=( $(ls "$COLORS") )
  12. select opt in "${array[@]}"; do
  13. echo "Copying $opt to $XRES"
  14. cp $COLORS/$opt $XRES
  15. echo $opt > ~/.xcolorselect
  16. term_restart
  17. break
  18. done
  19. }
  20. [[ -z $1 ]] && menu && exit 0
  21. if [ -e $COLORS/$1 ]; then
  22. cp $COLORS/$1 $XRES
  23. echo $1 > ~/.xcolorselect
  24. term_restart
  25. exit 0
  26. fi