colorchanger 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/sh
  2. # changes the color of i3-gaps and the terminal
  3. # needs: $HOME/.scripts/color/i3
  4. # needs: $HOME/.scripts/color/shell
  5. # needs: $HOME/.scripts/color/rofi
  6. # usage: colorchanger <base16_color>
  7. # uses base16_tomorrow-night as default color when run without argument
  8. change_rofi() {
  9. rb_path=$HOME/.scripts/colors/rofi
  10. rasi="$rb_path/$base16_color.rasi"
  11. if [ -f $rasi ]; then
  12. rm -f "$rb_path/default.rasi"
  13. ln -s $rasi "$rb_path/default.rasi"
  14. fi
  15. }
  16. change_xres () {
  17. bi3_dir=$HOME/.scripts/colors/xres
  18. xr="$bi3_dir/$base16_color.Xresources"
  19. if [ -f $xr ]; then
  20. xrdb -override "$xr"
  21. i3-msg reload -q
  22. fi
  23. }
  24. main (){
  25. change_xres
  26. change_rofi
  27. i3-msg reload -q
  28. }
  29. if [ "$1" = "--list" ]; then
  30. ls -l $HOME/.scripts/colors/xres | awk '{print $9}' | sed 's/\.sh//'
  31. exit 1
  32. fi
  33. if [ "$#" != "1" ]; then
  34. echo "[*] Settings default color."
  35. base16_color="orangina"
  36. else
  37. echo "[*] Settings colorscheme to $1."
  38. base16_color=$1
  39. fi
  40. main