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.

107 lines
2.2 KiB

4 years ago
4 years ago
4 years ago
  1. #!/bin/zsh
  2. # TODO
  3. # bspwm
  4. # emacs
  5. # firefox
  6. # dunst
  7. # ncmpcpp? uses xresources, but might want customizations
  8. # nvim
  9. #gtk3
  10. PATH_THEME="$XDG_CONFIG_HOME/gtk-3.0/themes"
  11. case "$1" in
  12. light)
  13. cp "$PATH_THEME/onehalf-light.css" "$PATH_THEME/colors_current.css"
  14. ;;
  15. dark)
  16. cp "$PATH_THEME/onehalf-dark.css" "$PATH_THEME/colors_current.css"
  17. ;;
  18. esac
  19. #rofi
  20. PATH_THEME="$XDG_CONFIG_HOME/rofi/themes"
  21. case "$1" in
  22. light)
  23. cp "$PATH_THEME/onehalf-light.rasi" "$PATH_THEME/current.rasi"
  24. ;;
  25. dark)
  26. cp "$PATH_THEME/onehalf-dark.rasi" "$PATH_THEME/current.rasi"
  27. ;;
  28. esac
  29. #polybar
  30. PATH_THEME="$XDG_CONFIG_HOME/polybar/themes"
  31. case "$1" in
  32. light)
  33. cp "$PATH_THEME/onehalf-light.ini" "$PATH_THEME/current.ini"
  34. ;;
  35. dark)
  36. cp "$PATH_THEME/onehalf-dark.ini" "$PATH_THEME/current.ini"
  37. ;;
  38. esac
  39. if pgrep -u $UID -x polybar >/dev/null; then
  40. killall -q polybar
  41. polybar -c ~/.config/polybar/config.ini main &
  42. polybar -c ~/.config/polybar/config.ini system &
  43. fi
  44. #x11
  45. PATH_THEME="$XDG_CONFIG_HOME/X11/colors"
  46. case "$1" in
  47. light)
  48. cp "$PATH_THEME/onehalf-light" "$PATH_THEME/current"
  49. ;;
  50. dark)
  51. cp "$PATH_THEME/onehalf-dark" "$PATH_THEME/current"
  52. ;;
  53. esac
  54. xrdb "$PATH_THEME/current"
  55. # kitty
  56. PATH_THEME="$XDG_CONFIG_HOME/kitty/themes"
  57. SOCKET="/tmp/kitty-"$(pgrep kitty)
  58. case "$1" in
  59. light)
  60. cp "$PATH_THEME/onehalf-light.conf" "$PATH_THEME/current.conf"
  61. ;;
  62. dark)
  63. cp "$PATH_THEME/onehalf-dark.conf" "$PATH_THEME/current.conf"
  64. ;;
  65. esac
  66. #kitty @ set-colors --all --configured "$PATH_THEME/current.conf" > /dev/null
  67. kitty @ --to=unix:$SOCKET set-colors --all --configured "$PATH_THEME/current.conf"
  68. tput sgr0
  69. tput op
  70. # zsh
  71. # highlighting needs to be changed
  72. PATH_THEME="$XDG_CONFIG_HOME/zsh"
  73. case "$1" in
  74. light)
  75. cp "$PATH_THEME/theme_light" "$PATH_THEME/theme_current"
  76. ;;
  77. dark)
  78. cp "$PATH_THEME/theme_dark" "$PATH_THEME/theme_current"
  79. ;;
  80. esac
  81. source $PATH_THEME/theme_current
  82. # sourcing not enough to change autosuggestion color
  83. # exec updates current window and newly created,
  84. # but not other currently open terminals
  85. exec zsh