Windows Terminal Themes

repository·master·Indexed 23 days ago

https://github.com/atomcorp/themes

A monorepo containing a client and API for a web-based tool used to preview and copy color schemes for Windows Terminal. It aggregates themes from sources like iTerm2-Color-Schemes and provides them in a format compatible with Windows Terminal settings. The project includes a React application and an Express server.

Tokens
1.5K
Snippets
7
Records
12
Agent score
81%

What's inside windowsterminalthemes

  1. Run tests

    master

    The project includes several types of tests that can be run using yarn:

    • Development tests: Run all tests with yarn test:dev.
    • End-to-End (E2E) tests: Uses Cypress.
      • Open the Cypress Dashboard: yarn cy:open
      • Run the test suite: yarn cy:run
    • Unit tests: Uses Jest.
      • Run in watch mode: yarn unit:watch
    yarn test:dev
    yarn cy:open
    yarn cy:run
    yarn unit:watch
  2. Run the development environment

    master

    To run the project locally, including both the React application and the Express server, use yarn:

    yarn install
    yarn start
    yarn start
  3. Run the Windows Terminal Themes API

    master
    To run the API endpoint that serves the themes used by atomcorp.github.io/themes/, use the yarn start command. The server also includes a cron-job that automatically refreshes the theme list once per day.
    yarn start
  4. Apply Windows Terminal themes to your settings

    master

    To use a theme from this project in your Windows Terminal, follow these steps:

    1. Open your Windows Terminal settings.
    2. Add your chosen theme configuration to the schemes array in your settings JSON.
    3. Locate the specific profile you want to change (e.g., cmd, powershell, or ubuntu) within the profiles section.
    4. Replace the value of colorScheme with the exact name of the theme you added.

    For more detailed information on modifying settings, refer to the official Windows Terminal documentation.

  5. Contribute a new theme

    master

    You can contribute new themes to this project via Pull Request.

    1. Add the new theme to the list located in app/src/custom-colour-schemes.json.
    2. If you want to receive credit for the theme, or want to attribute it to someone else, update app/src/credits.json.

    Note: For broader ecosystem impact, it is recommended to propose new themes to iTerm2-Color-Schemes first, as many themes in this project are sourced from there.

  6. Reference background and text color keys

    master

    The system distinguishes between background keys and text keys for color mapping:

    Background Keys: 'black', 'red', 'green', 'yellow', 'blue', 'purple', 'cyan', 'white', 'background'

    Text Keys: 'black', 'brightBlack', 'red', 'brightRed', 'green', 'brightGreen', 'yellow', 'brightYellow', 'blue', 'brightBlue', 'purple', 'brightPurple', 'cyan', 'brightCyan', 'white', 'brightWhite'

  7. Available action types for state management

    master

    The application uses an action-based system (actionTypes) to manage state. The following action types are available:

    • LOAD: { type: 'LOAD', themes: themeType[], initialTheme?: string } - Loads a set of themes.
    • SET: { type: 'SET', theme: string } - Sets the active theme by name.
    • SIZE: { type: 'SIZE', isSmallScreenSize: boolean } - Updates screen size context.
    • SHADE: { type: 'SHADE', themeShade: themeShadeType } - Sets the shade filter ('LIGHT', 'DARK', or 'ANY').
    • PREVIEW: { type: 'PREVIEW', themeShade: previewType } - Changes the preview mode.
    • NEXT: { type: 'NEXT' } - Moves to the next theme.
    • PREV: { type: 'PREV' } - Moves to the previous theme.
    • show: { type: 'show', title: string, message: string } - Displays a notification.
    • hide: { type: 'hide' } - Hides a notification.
  8. Reference valid theme keys

    master

    The following keys are valid for a theme object:

    'name'
    | 'black'
    | 'red'
    | 'green'
    | 'yellow'
    | 'blue'
    | 'purple'
    | 'cyan'
    | 'white'
    | 'brightBlack'
    | 'brightRed'
    | 'brightGreen'
    | 'brightYellow'
    | 'brightBlue'
    | 'brightPurple'
    | 'brightCyan'
    | 'brightWhite'
    | 'background'
    | 'foreground'
    | 'cursorColor'
    | 'selectionBackground'
  9. Define a valid theme object

    master

    A theme object must conform to the validThemeType structure. It requires a name and a set of color keys representing the standard terminal color palette, plus background and foreground. The keys cursorColor and selectionBackground are optional.

    export type validThemeType = {
      name: string;
      black: string;
      red: string;
      green: string;
      yellow: string;
      blue: string;
      purple: string;
      cyan: string;
      white: string;
      brightBlack: string;
      brightRed: string;
      brightGreen: string;
      brightYellow: string;
      brightBlue: string;
      brightPurple: string;
      brightCyan: string;
      brightWhite: string;
      background: string;
      foreground: string;
      cursorColor?: string;
      selectionBackground?: string;
    };
  10. Structure a full theme with metadata

    master

    A complete theme (themeType) is a validThemeType extended with a meta object. The meta object contains isDark (boolean) and an optional credits array containing objects with name and link strings.

    export type themeType = validThemeType & {meta: metaType};