main.py 1.9 KB

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