main.py 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/usr/bin/env python
  2. # License: GPLv3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
  3. import sys
  4. from typing import List
  5. from kitty.cli import CompletionSpec
  6. help_text = (
  7. 'Change the kitty theme. If no theme name is supplied, run interactively, otherwise'
  8. ' change the current theme to the specified theme name.'
  9. )
  10. usage = '[theme name to switch to]'
  11. OPTIONS = '''
  12. --cache-age
  13. type=float
  14. default=1
  15. Check for new themes only after the specified number of days. A value of
  16. zero will always check for new themes. A negative value will never check
  17. for new themes, instead raising an error if a local copy of the themes
  18. is not available.
  19. --reload-in
  20. default=parent
  21. choices=none,parent,all
  22. By default, this kitten will signal only the parent kitty instance it is
  23. running in to reload its config, after making changes. Use this option
  24. to instead either not reload the config at all or in all running
  25. kitty instances.
  26. --dump-theme
  27. type=bool-set
  28. default=false
  29. When running non-interactively, dump the specified theme to STDOUT
  30. instead of changing kitty.conf.
  31. --config-file-name
  32. default=kitty.conf
  33. The name or path to the config file to edit. Relative paths are interpreted
  34. with respect to the kitty config directory. By default the kitty config file,
  35. kitty.conf is edited. This is most useful if you add :code:`include themes.conf`
  36. to your kitty.conf and then have the kitten operate only on :file:`themes.conf`,
  37. allowing :code:`kitty.conf` to remain unchanged.
  38. '''.format
  39. def main(args: List[str]) -> None:
  40. raise SystemExit('This must be run as kitten themes')
  41. if __name__ == '__main__':
  42. main(sys.argv)
  43. elif __name__ == '__doc__':
  44. cd = sys.cli_docs # type: ignore
  45. cd['usage'] = usage
  46. cd['options'] = OPTIONS
  47. cd['help_text'] = help_text
  48. cd['short_desc'] = 'Manage kitty color schemes easily'
  49. cd['args_completion'] = CompletionSpec.from_string('type:special group:complete_themes')