├── .devcontainer ├── .dockerignore ├── Dockerfile ├── README.md ├── devcontainer.json └── docker-compose.yml ├── .dockerignore ├── .github ├── CODEOWNERS ├── CONTRIBUTING.md ├── FUNDING.yml ├── dependabot.yml ├── labels.yml └── workflows │ ├── alpine.yml │ ├── debian.yml │ ├── dockerhub-description.yml │ └── labels.yml ├── .gitignore ├── .ssh.sh ├── LICENSE ├── README.md ├── alpine.Dockerfile ├── debian.Dockerfile ├── shell ├── .p10k.zsh ├── .welcome.sh └── .zshrc └── title.svg /.devcontainer/.dockerignore: -------------------------------------------------------------------------------- 1 | .dockerignore 2 | devcontainer.json 3 | docker-compose.yml 4 | Dockerfile 5 | README.md 6 | -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM qmcgaw/basedevcontainer 2 | # FROM qmcgaw/basedevcontainer:alpine 3 | # FROM qmcgaw/basedevcontainer:debian 4 | -------------------------------------------------------------------------------- /.devcontainer/README.md: -------------------------------------------------------------------------------- 1 | # Development container 2 | 3 | Development container that can be used with VSCode. 4 | 5 | It works on Linux, Windows (WSL2) and OSX. 6 | 7 | ## Requirements 8 | 9 | - [VS code](https://code.visualstudio.com/download) installed 10 | - [VS code dev containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) installed 11 | - [Docker](https://www.docker.com/products/docker-desktop) installed and running 12 | - [Docker Compose](https://docs.docker.com/compose/install/) installed 13 | 14 | ## Setup 15 | 16 | 1. Create the following files and directory on your host if you don't have them: 17 | 18 | ```sh 19 | touch ~/.gitconfig ~/.zsh_history 20 | mkdir -p ~/.ssh 21 | ``` 22 | 23 | 1. **For OSX hosts**: ensure the project directory and your home directory `~` are accessible by Docker. 24 | 1. Open the command palette in Visual Studio Code (CTRL+SHIFT+P). 25 | 1. Select `Dev-Containers: Open Folder in Container...` and choose the project directory. 26 | 27 | ## Customization 28 | 29 | For any customization to take effect, you should "rebuild and reopen": 30 | 31 | 1. Open the command palette in Visual Studio Code (CTRL+SHIFT+P) 32 | 2. Select `Dev-Containers: Rebuild Container` 33 | 34 | Changes you can make are notably: 35 | 36 | - Changes to the Docker image in [Dockerfile](Dockerfile) 37 | - Changes to VSCode **settings** and **extensions** in [devcontainer.json](devcontainer.json). 38 | - Change the entrypoint script by adding a bind mount in [devcontainer.json](devcontainer.json) of a shell script to `/root/.welcome.sh` to replace the [current welcome script](https://github.com/qdm12/basedevcontainer/blob/master/shell/.welcome.sh). For example: 39 | 40 | ```json 41 | // Welcome script 42 | { 43 | "source": "/yourpath/.welcome.sh", 44 | "target": "/root/.welcome.sh", 45 | "type": "bind" 46 | }, 47 | ``` 48 | 49 | - Change the `vscode` service container configuration either in [docker-compose.yml](docker-compose.yml) or in [devcontainer.json](devcontainer.json). 50 | - Add other services in [docker-compose.yml](docker-compose.yml) to run together with the development VSCode service container. For example to add a test database: 51 | 52 | ```yml 53 | database: 54 | image: postgres 55 | restart: always 56 | environment: 57 | POSTGRES_PASSWORD: password 58 | ``` 59 | 60 | - More options are documented in the [devcontainer.json reference](https://containers.dev/implementors/json_reference/). 61 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://containers.dev/implementors/json_reference/ 3 | // User defined settings 4 | "containerEnv": { 5 | "TZ": "" 6 | }, 7 | // Fixed settings 8 | "name": "project-dev", 9 | "postCreateCommand": "~/.ssh.sh", 10 | "dockerComposeFile": "docker-compose.yml", 11 | "overrideCommand": true, 12 | "service": "vscode", 13 | "workspaceFolder": "/workspace", 14 | "mounts": [ 15 | // Source code 16 | { 17 | "source": "../", 18 | "target": "/workspace", 19 | "type": "bind" 20 | }, 21 | // Zsh commands history persistence 22 | { 23 | "source": "${localEnv:HOME}/.zsh_history", 24 | "target": "/root/.zsh_history", 25 | "type": "bind" 26 | }, 27 | // Git configuration file 28 | { 29 | "source": "${localEnv:HOME}/.gitconfig", 30 | "target": "/root/.gitconfig", 31 | "type": "bind" 32 | }, 33 | // SSH directory for Linux, OSX and WSL 34 | // On Linux and OSX, a symlink /mnt/ssh <-> ~/.ssh is 35 | // created in the container. On Windows, files are copied 36 | // from /mnt/ssh to ~/.ssh to fix permissions. 37 | { 38 | "source": "${localEnv:HOME}/.ssh", 39 | "target": "/mnt/ssh", 40 | "type": "bind" 41 | }, 42 | // Docker socket to access the host Docker server 43 | { 44 | "source": "/var/run/docker.sock", 45 | "target": "/var/run/docker.sock", 46 | "type": "bind" 47 | } 48 | ], 49 | "customizations": { 50 | "vscode": { 51 | "extensions": [ 52 | "IBM.output-colorizer", 53 | "eamodio.gitlens", 54 | "mhutchie.git-graph", 55 | "davidanson.vscode-markdownlint", 56 | "shardulm94.trailing-spaces", 57 | "alefragnani.Bookmarks", 58 | "Gruntfuggly.todo-tree", 59 | "mohsen1.prettify-json", 60 | "quicktype.quicktype", 61 | "spikespaz.vscode-smoothtype", 62 | "stkb.rewrap", 63 | "vscode-icons-team.vscode-icons", 64 | "ms-azuretools.vscode-docker", 65 | "github.copilot" 66 | ], 67 | "settings": { 68 | // General settings 69 | "files.eol": "\n", 70 | // Docker 71 | "remote.extensionKind": { 72 | "ms-azuretools.vscode-docker": "workspace" 73 | } 74 | } 75 | } 76 | } 77 | } -------------------------------------------------------------------------------- /.devcontainer/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | vscode: 3 | build: . 4 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .devcontainer 2 | .git 3 | .github 4 | .vscode 5 | .dockerignore 6 | .gitignore 7 | alpine.Dockerfile 8 | debian.Dockerfile 9 | LICENSE 10 | README.md 11 | title.svg 12 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | @qdm12 -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [open source license of this project](../LICENSE). 4 | 5 | ## Submitting a pull request 6 | 7 | 1. [Fork](https://github.com/qdm12/basedevcontainer/fork) and clone the repository 8 | 1. Create a new branch `git checkout -b my-branch-name` 9 | 1. Modify the code 10 | 1. Ensure the docker build succeeds `docker build .` 11 | 1. Commit your modifications 12 | 1. Push to your fork and [submit a pull request](https://github.com/qdm12/basedevcontainer/compare) 13 | 14 | ## Resources 15 | 16 | - [Using Pull Requests](https://help.github.com/articles/about-pull-requests/) 17 | - [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) 18 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [qdm12] 2 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | # Maintain dependencies for GitHub Actions 4 | - package-ecosystem: "github-actions" 5 | directory: "/" 6 | schedule: 7 | interval: "daily" 8 | - package-ecosystem: docker 9 | directory: / 10 | schedule: 11 | interval: "daily" 12 | - package-ecosystem: gomod 13 | directory: / 14 | schedule: 15 | interval: "daily" 16 | -------------------------------------------------------------------------------- /.github/labels.yml: -------------------------------------------------------------------------------- 1 | - name: ":robot: bot" 2 | color: "69cde9" 3 | description: "" 4 | - name: ":bug: bug" 5 | color: "b60205" 6 | description: "" 7 | - name: ":game_die: dependencies" 8 | color: "0366d6" 9 | description: "" 10 | - name: ":memo: documentation" 11 | color: "c5def5" 12 | description: "" 13 | - name: ":busts_in_silhouette: duplicate" 14 | color: "cccccc" 15 | description: "" 16 | - name: ":sparkles: enhancement" 17 | color: "0054ca" 18 | description: "" 19 | - name: ":bulb: feature request" 20 | color: "0e8a16" 21 | description: "" 22 | - name: ":mega: feedback" 23 | color: "03a9f4" 24 | description: "" 25 | - name: ":rocket: future maybe" 26 | color: "fef2c0" 27 | description: "" 28 | - name: ":hatching_chick: good first issue" 29 | color: "7057ff" 30 | description: "" 31 | - name: ":pray: help wanted" 32 | color: "4caf50" 33 | description: "" 34 | - name: ":hand: hold" 35 | color: "24292f" 36 | description: "" 37 | - name: ":no_entry_sign: invalid" 38 | color: "e6e6e6" 39 | description: "" 40 | - name: ":interrobang: maybe bug" 41 | color: "ff5722" 42 | description: "" 43 | - name: ":thinking: needs more info" 44 | color: "795548" 45 | description: "" 46 | - name: ":question: question" 47 | color: "3f51b5" 48 | description: "" 49 | - name: ":coffin: wontfix" 50 | color: "ffffff" 51 | description: "" 52 | -------------------------------------------------------------------------------- /.github/workflows/alpine.yml: -------------------------------------------------------------------------------- 1 | name: Alpine 2 | on: 3 | release: 4 | types: 5 | - published 6 | push: 7 | branches: 8 | - master 9 | paths: 10 | - .github/workflows/alpine.yml 11 | - shell/** 12 | - .dockerignore 13 | - .ssh.sh 14 | - alpine.Dockerfile 15 | pull_request: 16 | paths: 17 | - .github/workflows/alpine.yml 18 | - shell/** 19 | - .dockerignore 20 | - .ssh.sh 21 | - alpine.Dockerfile 22 | 23 | jobs: 24 | verify: 25 | runs-on: ubuntu-latest 26 | env: 27 | DOCKER_BUILDKIT: "1" 28 | steps: 29 | - uses: actions/checkout@v4 30 | 31 | - name: Build image 32 | run: docker build -f alpine.Dockerfile -t qmcgaw/basedevcontainer . 33 | 34 | publish: 35 | if: | 36 | github.repository == 'qdm12/basedevcontainer' && 37 | ( 38 | github.event_name == 'push' || 39 | github.event_name == 'release' || 40 | (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]') 41 | ) 42 | needs: [verify] 43 | runs-on: ubuntu-latest 44 | steps: 45 | - uses: actions/checkout@v4 46 | 47 | # extract metadata (tags, labels) for Docker 48 | # https://github.com/docker/metadata-action 49 | - name: Extract Docker metadata 50 | id: meta 51 | uses: docker/metadata-action@v5 52 | with: 53 | images: | 54 | qmcgaw/basedevcontainer 55 | tags: | 56 | type=ref,event=pr 57 | type=semver,pattern=v{{major}}.{{minor}}.{{patch}}-alpine 58 | type=semver,pattern=v{{major}}.{{minor}}-alpine 59 | type=raw,value=alpine,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} 60 | type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} 61 | 62 | - name: Short commit 63 | id: shortcommit 64 | run: echo "value=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" 65 | 66 | - uses: docker/setup-qemu-action@v3 67 | - uses: docker/setup-buildx-action@v3 68 | 69 | - uses: docker/login-action@v3 70 | with: 71 | username: qmcgaw 72 | password: ${{ secrets.DOCKERHUB_PASSWORD }} 73 | 74 | - name: Build and push final image 75 | uses: docker/build-push-action@v6 76 | with: 77 | file: alpine.Dockerfile 78 | platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6,linux/s390x,linux/ppc64le 79 | labels: ${{ steps.meta.outputs.labels }} 80 | build-args: | 81 | CREATED=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }} 82 | COMMIT=${{ steps.shortcommit.outputs.value }} 83 | VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} 84 | tags: ${{ steps.meta.outputs.tags }} 85 | push: true 86 | -------------------------------------------------------------------------------- /.github/workflows/debian.yml: -------------------------------------------------------------------------------- 1 | name: Debian 2 | on: 3 | release: 4 | types: 5 | - published 6 | push: 7 | branches: 8 | - master 9 | paths: 10 | - .github/workflows/debian.yml 11 | - shell/** 12 | - .dockerignore 13 | - .ssh.sh 14 | - debian.Dockerfile 15 | pull_request: 16 | paths: 17 | - .github/workflows/debian.yml 18 | - shell/** 19 | - .dockerignore 20 | - .ssh.sh 21 | - debian.Dockerfile 22 | 23 | jobs: 24 | verify: 25 | runs-on: ubuntu-latest 26 | env: 27 | DOCKER_BUILDKIT: "1" 28 | steps: 29 | - uses: actions/checkout@v4 30 | 31 | - name: Build image 32 | run: docker build -f debian.Dockerfile -t qmcgaw/basedevcontainer . 33 | 34 | publish: 35 | if: | 36 | github.repository == 'qdm12/basedevcontainer' && 37 | ( 38 | github.event_name == 'push' || 39 | github.event_name == 'release' || 40 | (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]') 41 | ) 42 | needs: [verify] 43 | runs-on: ubuntu-latest 44 | steps: 45 | - uses: actions/checkout@v4 46 | 47 | # extract metadata (tags, labels) for Docker 48 | # https://github.com/docker/metadata-action 49 | - name: Extract Docker metadata 50 | id: meta 51 | uses: docker/metadata-action@v5 52 | with: 53 | images: | 54 | qmcgaw/basedevcontainer 55 | tags: | 56 | type=ref,event=pr 57 | type=semver,pattern=v{{major}}.{{minor}}.{{patch}}-debian 58 | type=semver,pattern=v{{major}}.{{minor}}-debian 59 | type=raw,value=debian,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} 60 | 61 | - name: Short commit 62 | id: shortcommit 63 | run: echo "value=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" 64 | 65 | - uses: docker/setup-qemu-action@v3 66 | - uses: docker/setup-buildx-action@v3 67 | 68 | - uses: docker/login-action@v3 69 | with: 70 | username: qmcgaw 71 | password: ${{ secrets.DOCKERHUB_PASSWORD }} 72 | 73 | - name: Build and push final image 74 | uses: docker/build-push-action@v6 75 | with: 76 | file: debian.Dockerfile 77 | platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6,linux/s390x,linux/ppc64le 78 | labels: ${{ steps.meta.outputs.labels }} 79 | build-args: | 80 | CREATED=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }} 81 | COMMIT=${{ steps.shortcommit.outputs.value }} 82 | VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} 83 | tags: ${{ steps.meta.outputs.tags }} 84 | push: true 85 | -------------------------------------------------------------------------------- /.github/workflows/dockerhub-description.yml: -------------------------------------------------------------------------------- 1 | name: Docker Hub description 2 | on: 3 | push: 4 | branches: [master] 5 | paths: 6 | - README.md 7 | - .github/workflows/dockerhub-description.yml 8 | jobs: 9 | dockerHubDescription: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v4 14 | - name: Docker Hub Description 15 | uses: peter-evans/dockerhub-description@v4 16 | with: 17 | username: qmcgaw 18 | password: ${{ secrets.DOCKERHUB_PASSWORD }} 19 | repository: qmcgaw/basedevcontainer 20 | short-description: Base development container for Visual Studio Code, used as base image by other images 21 | readme-filepath: README.md 22 | -------------------------------------------------------------------------------- /.github/workflows/labels.yml: -------------------------------------------------------------------------------- 1 | name: labels 2 | on: 3 | push: 4 | branches: ["master"] 5 | paths: 6 | - ".github/labels.yml" 7 | - ".github/workflows/labels.yml" 8 | jobs: 9 | labeler: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v4 14 | - name: Labeler 15 | if: success() 16 | uses: crazy-max/ghaction-github-labeler@v5 17 | env: 18 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qdm12/basedevcontainer/1ce12e9164d12ef63feb5d1b360eefbe19e37070/.gitignore -------------------------------------------------------------------------------- /.ssh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -d ~/.ssh ]; then 4 | if echo "$(mountpoint ~/.ssh 2>&1)" | grep -q "is a mountpoint"; then 5 | # ~/.ssh is a bind mount from the host 6 | return 0; 7 | fi 8 | echo "$(/bin/ls -a /mnt/ssh 2>/dev/null)" > /tmp/ls_mnt_ssh 9 | echo "$(/bin/ls -a ~/.ssh 2>/dev/null)" > /tmp/ls_ssh 10 | echo "$(/bin/ls -a /tmp/.ssh 2>/dev/null)" > /tmp/ls_tmp_ssh 11 | if [ -d /mnt/ssh ] && [ -z "$(comm -3 /tmp/ls_mnt_ssh /tmp/ls_ssh)" ]; then 12 | # /mnt/ssh and ~/.ssh are the same in terms of file names. 13 | rm /tmp/ls_mnt_ssh 14 | rm /tmp/ls_ssh 15 | rm /tmp/ls_tmp_ssh 16 | return 0; 17 | fi 18 | if [ -d /tmp/.ssh ] && [ -z "$(comm -3 /tmp/ls_tmp_ssh /tmp/ls_ssh)" ]; then 19 | # Retro-compatibility: /tmp/.ssh and ~/.ssh are the same in terms of file names. 20 | rm /tmp/ls_mnt_ssh 21 | rm /tmp/ls_ssh 22 | rm /tmp/ls_tmp_ssh 23 | return 0; 24 | fi 25 | rm /tmp/ls_mnt_ssh 26 | rm /tmp/ls_ssh 27 | rm /tmp/ls_tmp_ssh 28 | fi 29 | 30 | if [ -d /tmp/.ssh ]; then 31 | # Retro-compatibility 32 | echo "Copying content of /tmp/.ssh to ~/.ssh" 33 | mkdir -p ~/.ssh 34 | cp -r /tmp/.ssh/* ~/.ssh/ 35 | chmod 600 ~/.ssh/* 36 | chmod 644 ~/.ssh/*.pub &> /dev/null 37 | return 0 38 | fi 39 | 40 | if [ ! -d /mnt/ssh ]; then 41 | echo "No bind mounted ssh directory found (~/.ssh, /tmp/.ssh, /mnt/ssh), exiting" 42 | return 0 43 | fi 44 | 45 | if [ "$(stat -c '%U' /mnt/ssh)" != "UNKNOWN" ]; then 46 | echo "Unix host detected, symlinking /mnt/ssh to ~/.ssh" 47 | rm -r ~/.ssh 48 | ln -s /mnt/ssh ~/.ssh 49 | return 0 50 | fi 51 | 52 | echo "Windows host detected, copying content of /mnt/ssh to ~/.ssh" 53 | mkdir -p ~/.ssh 54 | cp -rf /mnt/ssh/* ~/.ssh/ 55 | chmod 600 ~/.ssh/* 56 | chmod 644 ~/.ssh/*.pub &> /dev/null 57 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Quentin McGaw 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Base Dev Container 2 | 3 | Base Alpine development container for Visual Studio Code, used as base image by other images 4 | 5 | 6 | 7 | [![Alpine](https://github.com/qdm12/basedevcontainer/actions/workflows/alpine.yml/badge.svg)](https://github.com/qdm12/basedevcontainer/actions/workflows/alpine.yml) 8 | [![Debian](https://github.com/qdm12/basedevcontainer/actions/workflows/debian.yml/badge.svg)](https://github.com/qdm12/basedevcontainer/actions/workflows/debian.yml) 9 | 10 | [![dockeri.co](https://dockeri.co/image/qmcgaw/basedevcontainer)](https://hub.docker.com/r/qmcgaw/basedevcontainer) 11 | 12 | ![Last release](https://img.shields.io/github/release/qdm12/basedevcontainer?label=Last%20release) 13 | ![Last Docker tag](https://img.shields.io/docker/v/qmcgaw/basedevcontainer?sort=semver&label=Last%20Docker%20tag) 14 | [![Last release size](https://img.shields.io/docker/image-size/qmcgaw/basedevcontainer?sort=semver&label=Last%20released%20image)](https://hub.docker.com/r/qmcgaw/basedevcontainer/tags?page=1&ordering=last_updated) 15 | ![GitHub last release date](https://img.shields.io/github/release-date/qdm12/basedevcontainer?label=Last%20release%20date) 16 | ![Commits since release](https://img.shields.io/github/commits-since/qdm12/basedevcontainer/latest?sort=semver) 17 | 18 | [![Latest size](https://img.shields.io/docker/image-size/qmcgaw/basedevcontainer/latest?label=Latest%20image)](https://hub.docker.com/r/qmcgaw/basedevcontainer/tags) 19 | 20 | [![GitHub last commit](https://img.shields.io/github/last-commit/qdm12/basedevcontainer.svg)](https://github.com/qdm12/basedevcontainer/commits/master) 21 | [![GitHub commit activity](https://img.shields.io/github/commit-activity/y/qdm12/basedevcontainer.svg)](https://github.com/qdm12/basedevcontainer/graphs/contributors) 22 | [![GitHub closed PRs](https://img.shields.io/github/issues-pr-closed/qdm12/basedevcontainer.svg)](https://github.com/qdm12/basedevcontainer/pulls?q=is%3Apr+is%3Aclosed) 23 | [![GitHub issues](https://img.shields.io/github/issues/qdm12/basedevcontainer.svg)](https://github.com/qdm12/basedevcontainer/issues) 24 | [![GitHub closed issues](https://img.shields.io/github/issues-closed/qdm12/basedevcontainer.svg)](https://github.com/qdm12/basedevcontainer/issues?q=is%3Aissue+is%3Aclosed) 25 | 26 | [![Lines of code](https://img.shields.io/tokei/lines/github/qdm12/basedevcontainer)](https://github.com/qdm12/basedevcontainer) 27 | ![Code size](https://img.shields.io/github/languages/code-size/qdm12/basedevcontainer) 28 | ![GitHub repo size](https://img.shields.io/github/repo-size/qdm12/basedevcontainer) 29 | 30 | [![MIT](https://img.shields.io/github/license/qdm12/basedevcontainer)](https://github.com/qdm12/basedevcontainer/master/LICENSE) 31 | ![Visitors count](https://visitor-badge.laobi.icu/badge?page_id=basedevcontainer.readme) 32 | 33 | ## Features 34 | 35 | - `qmcgaw/basedevcontainer:alpine` (or `:latest`) based on Alpine 3.20 in **230MB** 36 | - `qmcgaw/basedevcontainer:debian` based on Debian Buster Slim in **376MB** 37 | - All images are compatible with `amd64`, `386`, `arm64`, `armv7`, `armv6` and `ppc64le` CPU architectures 38 | - Contains the packages: 39 | - `libstdc++`: needed by the VS code server 40 | - `zsh`: main shell instead of `/bin/sh` 41 | - `git`: interact with Git repositories 42 | - `openssh-client`: use SSH keys 43 | - `nano`: edit files from the terminal 44 | - Contains the binaries: 45 | - [`gh`](https://github.com/cli/cli): interact with Github with the terminal 46 | - `docker` 47 | - `docker-compose` and `docker compose` docker plugin 48 | - [`docker buildx`](https://github.com/docker/buildx) docker plugin 49 | - [`bit`](https://github.com/chriswalz/bit) 50 | - [`devtainr`](https://github.com/qdm12/devtainr) 51 | - Custom integrated terminal 52 | - Based on zsh and [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) 53 | - Uses the [Powerlevel10k](https://github.com/romkatv/powerlevel10k) theme 54 | - With [Logo LS](https://github.com/Yash-Handa/logo-ls) as a replacement for `ls` 55 | - Shows information on login; easily extensible 56 | - Cross platform 57 | - Easily bind mount your SSH keys to use with **git** 58 | - Manage your host Docker from within the dev container on Linux, MacOS and Windows 59 | - Docker uses buildkit by default, with the latest Docker client binary. 60 | - Extensible with docker-compose.yml 61 | - Supports SSH keys with Linux, OSX and Windows 62 | 63 | ## Requirements 64 | 65 | - [Docker](https://www.docker.com/products/docker-desktop) installed and running 66 | - If you use OSX, share the directory `~/.ssh` and the directory of your project with Docker Desktop 67 | - [Docker Compose](https://docs.docker.com/compose/install/) installed 68 | - [VS code](https://code.visualstudio.com/download) installed 69 | - [VS code dev containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) installed 70 | 71 | ## Setup for a project 72 | 73 | 1. Download this repository and put the `.devcontainer` directory in your project. 74 | Alternatively, use this shell script from your project path 75 | 76 | ```sh 77 | # we assume you are in /yourpath/myproject 78 | mkdir .devcontainer 79 | cd .devcontainer 80 | wget -q https://raw.githubusercontent.com/qdm12/basedevcontainer/master/.devcontainer/devcontainer.json 81 | wget -q https://raw.githubusercontent.com/qdm12/basedevcontainer/master/.devcontainer/docker-compose.yml 82 | ``` 83 | 84 | 1. If you have a *.vscode/settings.json*, eventually move the settings to *.devcontainer/devcontainer.json* in the `"settings"` section as *.vscode/settings.json* take precedence over the settings defined in *.devcontainer/devcontainer.json*. 85 | 1. Open the command palette in Visual Studio Code (CTRL+SHIFT+P) and select `Dev Containers: Open Folder in Container...` and choose your project directory 86 | 87 | ## More 88 | 89 | ### devcontainer.json 90 | 91 | - You can change the `"postCreateCommand"` to be relevant to your situation. In example it could be `echo "downloading" && npm i` to combine two commands 92 | - You can change the extensions installed in the Docker image within the `"extensions"` array 93 | - VScode settings can be changed or added in the `"settings"` object. 94 | 95 | ### docker-compose.yml 96 | 97 | - Add containers to be launched with your development container. In example, let's add a postgres database. 98 | 1. Add this block to `.devcontainer/docker-compose.yml` 99 | 100 | ```yml 101 | database: 102 | image: postgres 103 | restart: always 104 | environment: 105 | POSTGRES_PASSWORD: password 106 | ``` 107 | 108 | 1. Open the command palette in Visual Studio Code (CTRL+SHIFT+P) 109 | 1. Select `Dev-Containers: Rebuild Container` 110 | 111 | ### Development image 112 | 113 | You can build and extend the Docker development image to suit your needs. 114 | 115 | - You can build the development image yourself: 116 | 117 | ```sh 118 | docker build -t qmcgaw/basedevcontainer -f alpine.Dockerfile https://github.com/qdm12/basedevcontainer.git 119 | ``` 120 | 121 | - You can extend the Docker image `qmcgaw/basedevcontainer` with your own instructions. 122 | 123 | 1. Create a file `.devcontainer/Dockerfile` with `FROM qmcgaw/basedevcontainer` 124 | 1. Append instructions to the Dockerfile created. For example: 125 | - Add more Go packages and add an alias 126 | 127 | ```Dockerfile 128 | FROM qmcgaw/basedevcontainer 129 | COPY . . 130 | RUN echo "alias ls='ls -al'" >> ~/.zshrc 131 | ``` 132 | 133 | - Add some Alpine packages: 134 | 135 | ```Dockerfile 136 | FROM qmcgaw/basedevcontainer 137 | RUN apk add bind-tools 138 | ``` 139 | 140 | 1. Modify `.devcontainer/docker-compose.yml` and add `build: .` in the vscode service. 141 | 1. Open the command palette in Visual Studio Code (CTRL+SHIFT+P) 142 | 1. Select `Dev-Containers: Rebuild Container` 143 | 144 | - You can bind mount a file at `/root/.welcome.sh` to modify the welcome message. 145 | 146 | ## TODO 147 | 148 | - [ ] `bit complete` yes flag 149 | - [ ] Firewall, see [this](https://code.visualstudio.com/docs/remote/containers#_what-are-the-connectivity-requirements-for-the-vs-code-server-when-it-is-running-in-a-container) 150 | - [ ] Extend another docker-compose.yml 151 | - [ ] Fonts for host OS for the VS code shell 152 | - [ ] Gifs and images 153 | - [ ] Install VS code server and extensions in image, waiting for [this issue](https://github.com/microsoft/vscode-remote-release/issues/1718) 154 | -------------------------------------------------------------------------------- /alpine.Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ALPINE_VERSION=3.20 2 | 3 | ARG DOCKER_VERSION=v27.3.1 4 | ARG COMPOSE_VERSION=v2.29.7 5 | ARG BUILDX_VERSION=v0.17.1 6 | ARG LOGOLS_VERSION=v1.3.7 7 | ARG BIT_VERSION=v1.1.2 8 | ARG GH_VERSION=v2.58.0 9 | ARG DEVTAINR_VERSION=v0.6.0 10 | 11 | FROM qmcgaw/binpot:docker-${DOCKER_VERSION} AS docker 12 | FROM qmcgaw/binpot:compose-${COMPOSE_VERSION} AS compose 13 | FROM qmcgaw/binpot:buildx-${BUILDX_VERSION} AS buildx 14 | FROM qmcgaw/binpot:logo-ls-${LOGOLS_VERSION} AS logo-ls 15 | FROM qmcgaw/binpot:bit-${BIT_VERSION} AS bit 16 | FROM qmcgaw/binpot:gh-${GH_VERSION} AS gh 17 | FROM qmcgaw/devtainr:${DEVTAINR_VERSION} AS devtainr 18 | 19 | FROM alpine:${ALPINE_VERSION} 20 | ARG CREATED 21 | ARG COMMIT 22 | ARG VERSION=local 23 | LABEL \ 24 | org.opencontainers.image.authors="quentin.mcgaw@gmail.com" \ 25 | org.opencontainers.image.created=$CREATED \ 26 | org.opencontainers.image.version=$VERSION \ 27 | org.opencontainers.image.revision=$COMMIT \ 28 | org.opencontainers.image.url="https://github.com/qdm12/basedevcontainer" \ 29 | org.opencontainers.image.documentation="https://github.com/qdm12/basedevcontainer" \ 30 | org.opencontainers.image.source="https://github.com/qdm12/basedevcontainer" \ 31 | org.opencontainers.image.title="Base Dev container" \ 32 | org.opencontainers.image.description="Base Alpine development container for Visual Studio Code Dev Containers development" 33 | ENV BASE_VERSION="${VERSION}-${CREATED}-${COMMIT}" 34 | 35 | # CA certificates 36 | RUN apk add -q --update --progress --no-cache ca-certificates 37 | 38 | # Timezone 39 | RUN apk add -q --update --progress --no-cache tzdata 40 | ENV TZ= 41 | 42 | # Setup Git and SSH 43 | RUN apk add -q --update --progress --no-cache git mandoc git-doc openssh-client 44 | COPY .ssh.sh /root/ 45 | RUN chmod +x /root/.ssh.sh 46 | # Retro-compatibility symlink 47 | RUN ln -s /root/.ssh.sh /root/.windows.sh 48 | 49 | WORKDIR /root 50 | 51 | # Setup shell for root and ${USERNAME} 52 | ENTRYPOINT [ "/bin/zsh" ] 53 | RUN apk add -q --update --progress --no-cache zsh nano zsh-vcs 54 | ENV EDITOR=nano \ 55 | LANG=en_US.UTF-8 \ 56 | # MacOS compatibility 57 | TERM=xterm 58 | RUN apk add -q --update --progress --no-cache shadow && \ 59 | usermod --shell /bin/zsh root && \ 60 | apk del shadow 61 | 62 | COPY shell/.zshrc shell/.welcome.sh /root/ 63 | RUN git clone --single-branch --depth 1 https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh 64 | 65 | COPY shell/.p10k.zsh /root/ 66 | RUN apk add -q --update --progress --no-cache zsh-theme-powerlevel10k gitstatus && \ 67 | ln -s /usr/share/zsh/plugins/powerlevel10k ~/.oh-my-zsh/custom/themes/powerlevel10k 68 | 69 | # Docker CLI 70 | COPY --from=docker /bin /usr/local/bin/docker 71 | ENV DOCKER_BUILDKIT=1 72 | 73 | # Docker compose 74 | COPY --from=compose /bin /usr/libexec/docker/cli-plugins/docker-compose 75 | ENV COMPOSE_DOCKER_CLI_BUILD=1 76 | RUN echo "alias docker-compose='docker compose'" >> /root/.zshrc 77 | 78 | # Buildx plugin 79 | COPY --from=buildx /bin /usr/libexec/docker/cli-plugins/docker-buildx 80 | 81 | # Logo ls 82 | COPY --from=logo-ls /bin /usr/local/bin/logo-ls 83 | RUN echo "alias ls='logo-ls'" >> /root/.zshrc 84 | 85 | # Bit 86 | COPY --from=bit /bin /usr/local/bin/bit 87 | ARG TARGETPLATFORM 88 | RUN if [ "${TARGETPLATFORM}" != "linux/s390x" ]; then echo "y" | bit complete; fi 89 | 90 | COPY --from=gh /bin /usr/local/bin/gh 91 | 92 | COPY --from=devtainr /devtainr /usr/local/bin/devtainr 93 | 94 | # VSCode specific (speed up setup) 95 | RUN apk add -q --update --progress --no-cache libstdc++ 96 | -------------------------------------------------------------------------------- /debian.Dockerfile: -------------------------------------------------------------------------------- 1 | ARG DEBIAN_VERSION=12-slim 2 | 3 | ARG DOCKER_VERSION=v27.3.1 4 | ARG COMPOSE_VERSION=v2.29.7 5 | ARG BUILDX_VERSION=v0.17.1 6 | ARG LOGOLS_VERSION=v1.3.7 7 | ARG BIT_VERSION=v1.1.2 8 | ARG GH_VERSION=v2.58.0 9 | ARG DEVTAINR_VERSION=v0.6.0 10 | 11 | FROM qmcgaw/binpot:docker-${DOCKER_VERSION} AS docker 12 | FROM qmcgaw/binpot:compose-${COMPOSE_VERSION} AS compose 13 | FROM qmcgaw/binpot:buildx-${BUILDX_VERSION} AS buildx 14 | FROM qmcgaw/binpot:logo-ls-${LOGOLS_VERSION} AS logo-ls 15 | FROM qmcgaw/binpot:bit-${BIT_VERSION} AS bit 16 | FROM qmcgaw/binpot:gh-${GH_VERSION} AS gh 17 | FROM qmcgaw/devtainr:${DEVTAINR_VERSION} AS devtainr 18 | 19 | FROM debian:${DEBIAN_VERSION} 20 | ARG CREATED 21 | ARG COMMIT 22 | ARG VERSION=local 23 | LABEL \ 24 | org.opencontainers.image.authors="quentin.mcgaw@gmail.com" \ 25 | org.opencontainers.image.created=$CREATED \ 26 | org.opencontainers.image.version=$VERSION \ 27 | org.opencontainers.image.revision=$COMMIT \ 28 | org.opencontainers.image.url="https://github.com/qdm12/basedevcontainer" \ 29 | org.opencontainers.image.documentation="https://github.com/qdm12/basedevcontainer" \ 30 | org.opencontainers.image.source="https://github.com/qdm12/basedevcontainer" \ 31 | org.opencontainers.image.title="Base Dev container Debian" \ 32 | org.opencontainers.image.description="Base Debian development container for Visual Studio Code Dev Containers development" 33 | ENV BASE_VERSION="${VERSION}-${CREATED}-${COMMIT}" 34 | 35 | # CA certificates 36 | RUN apt-get update -y && \ 37 | apt-get install -y --no-install-recommends ca-certificates && \ 38 | rm -r /var/cache/* /var/lib/apt/lists/* 39 | 40 | # Timezone 41 | RUN apt-get update -y && \ 42 | apt-get install -y --no-install-recommends tzdata && \ 43 | rm -r /var/cache/* /var/lib/apt/lists/* 44 | ENV TZ= 45 | 46 | # Setup Git and SSH 47 | # Workaround for older Debian in order to be able to sign commits 48 | RUN echo "deb https://deb.debian.org/debian bookworm main" >> /etc/apt/sources.list && \ 49 | apt-get update && \ 50 | apt-get install -y --no-install-recommends -t bookworm git git-man && \ 51 | rm -r /var/cache/* /var/lib/apt/lists/* 52 | RUN apt-get update -y && \ 53 | apt-get install -y --no-install-recommends man openssh-client less && \ 54 | rm -r /var/cache/* /var/lib/apt/lists/* 55 | COPY .ssh.sh /root/ 56 | RUN chmod +x /root/.ssh.sh 57 | # Retro-compatibility symlink 58 | RUN ln -s /root/.ssh.sh /root/.windows.sh 59 | 60 | # Setup shell 61 | ENTRYPOINT [ "/bin/zsh" ] 62 | RUN apt-get update -y && \ 63 | apt-get install -y --no-install-recommends zsh nano locales wget && \ 64 | apt-get autoremove -y && \ 65 | apt-get clean -y && \ 66 | rm -r /var/cache/* /var/lib/apt/lists/* 67 | ENV EDITOR=nano \ 68 | LANG=en_US.UTF-8 \ 69 | # MacOS compatibility 70 | TERM=xterm 71 | RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment && \ 72 | echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \ 73 | echo "LANG=en_US.UTF-8" > /etc/locale.conf && \ 74 | locale-gen en_US.UTF-8 75 | RUN usermod --shell /bin/zsh root 76 | 77 | COPY shell/.zshrc shell/.welcome.sh /root/ 78 | RUN git clone --single-branch --depth 1 https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh 79 | 80 | ARG POWERLEVEL10K_VERSION=v1.16.1 81 | COPY shell/.p10k.zsh /root/ 82 | RUN git clone --branch ${POWERLEVEL10K_VERSION} --single-branch --depth 1 https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/custom/themes/powerlevel10k && \ 83 | rm -rf ~/.oh-my-zsh/custom/themes/powerlevel10k/.git 84 | 85 | # Docker CLI 86 | COPY --from=docker /bin /usr/local/bin/docker 87 | ENV DOCKER_BUILDKIT=1 88 | 89 | # Docker compose 90 | COPY --from=compose /bin /usr/libexec/docker/cli-plugins/docker-compose 91 | ENV COMPOSE_DOCKER_CLI_BUILD=1 92 | RUN echo "alias docker-compose='docker compose'" >> /root/.zshrc 93 | 94 | # Buildx plugin 95 | COPY --from=buildx /bin /usr/libexec/docker/cli-plugins/docker-buildx 96 | 97 | # Logo ls 98 | COPY --from=logo-ls /bin /usr/local/bin/logo-ls 99 | RUN echo "alias ls='logo-ls'" >> /root/.zshrc 100 | 101 | # Bit 102 | COPY --from=bit /bin /usr/local/bin/bit 103 | ARG TARGETPLATFORM 104 | RUN if [ "${TARGETPLATFORM}" != "linux/s390x" ]; then echo "y" | bit complete; fi 105 | 106 | COPY --from=gh /bin /usr/local/bin/gh 107 | 108 | COPY --from=devtainr /devtainr /usr/local/bin/devtainr 109 | -------------------------------------------------------------------------------- /shell/.p10k.zsh: -------------------------------------------------------------------------------- 1 | # Generated by Powerlevel10k configuration wizard on 2021-07-27 at 05:46 UTC. 2 | # Based on romkatv/powerlevel10k/config/p10k-lean-8colors.zsh, checksum 51222. 3 | # Wizard options: nerdfont-complete + powerline, small icons, lean_8colors, unicode, 4 | # 1 line, compact, few icons, concise, instant_prompt=verbose. 5 | # Type `p10k configure` to generate another config. 6 | # 7 | # Config for Powerlevel10k with 8-color lean prompt style. Type `p10k configure` to generate 8 | # your own config based on it. 9 | # 10 | # Tip: Looking for a nice color? Here's a one-liner to print colormap. 11 | # 12 | # for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done 13 | 14 | # Temporarily change options. 15 | 'builtin' 'local' '-a' 'p10k_config_opts' 16 | [[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') 17 | [[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') 18 | [[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') 19 | 'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' 20 | 21 | () { 22 | emulate -L zsh -o extended_glob 23 | 24 | # Unset all configuration options. This allows you to apply configuration changes without 25 | # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. 26 | unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' 27 | 28 | # Zsh >= 5.1 is required. 29 | autoload -Uz is-at-least && is-at-least 5.1 || return 30 | 31 | # The list of segments shown on the left. Fill it with the most important segments. 32 | typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( 33 | # os_icon # os identifier 34 | dir # current directory 35 | vcs # git status 36 | prompt_char # prompt symbol 37 | ) 38 | 39 | # The list of segments shown on the right. Fill it with less important segments. 40 | # Right prompt on the last prompt line (where you are typing your commands) gets 41 | # automatically hidden when the input line reaches it. Right prompt above the 42 | # last prompt line gets hidden if it would overlap with left prompt. 43 | typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( 44 | status # exit code of the last command 45 | command_execution_time # duration of the last command 46 | background_jobs # presence of background jobs 47 | direnv # direnv status (https://direnv.net/) 48 | asdf # asdf version manager (https://github.com/asdf-vm/asdf) 49 | virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) 50 | anaconda # conda environment (https://conda.io/) 51 | pyenv # python environment (https://github.com/pyenv/pyenv) 52 | goenv # go environment (https://github.com/syndbg/goenv) 53 | nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) 54 | nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) 55 | nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) 56 | # node_version # node.js version 57 | # go_version # go version (https://golang.org) 58 | # rust_version # rustc version (https://www.rust-lang.org) 59 | # dotnet_version # .NET version (https://dotnet.microsoft.com) 60 | # php_version # php version (https://www.php.net/) 61 | # laravel_version # laravel php framework version (https://laravel.com/) 62 | # java_version # java version (https://www.java.com/) 63 | # package # name@version from package.json (https://docs.npmjs.com/files/package.json) 64 | rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv) 65 | rvm # ruby version from rvm (https://rvm.io) 66 | fvm # flutter version management (https://github.com/leoafarias/fvm) 67 | luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) 68 | jenv # java version from jenv (https://github.com/jenv/jenv) 69 | plenv # perl version from plenv (https://github.com/tokuhirom/plenv) 70 | phpenv # php version from phpenv (https://github.com/phpenv/phpenv) 71 | scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) 72 | haskell_stack # haskell version from stack (https://haskellstack.org/) 73 | kubecontext # current kubernetes context (https://kubernetes.io/) 74 | terraform # terraform workspace (https://www.terraform.io) 75 | aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) 76 | aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) 77 | azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) 78 | gcloud # google cloud cli account and project (https://cloud.google.com/) 79 | google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) 80 | context # user@hostname 81 | nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) 82 | ranger # ranger shell (https://github.com/ranger/ranger) 83 | nnn # nnn shell (https://github.com/jarun/nnn) 84 | xplr # xplr shell (https://github.com/sayanarijit/xplr) 85 | vim_shell # vim shell indicator (:sh) 86 | midnight_commander # midnight commander shell (https://midnight-commander.org/) 87 | nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) 88 | # vpn_ip # virtual private network indicator 89 | # load # CPU load 90 | # disk_usage # disk usage 91 | # ram # free RAM 92 | # swap # used swap 93 | todo # todo items (https://github.com/todotxt/todo.txt-cli) 94 | timewarrior # timewarrior tracking status (https://timewarrior.net/) 95 | taskwarrior # taskwarrior task count (https://taskwarrior.org/) 96 | # time # current time 97 | # ip # ip address and bandwidth usage for a specified network interface 98 | # public_ip # public IP address 99 | # proxy # system-wide http/https/ftp proxy 100 | # battery # internal battery 101 | # wifi # wifi speed 102 | # example # example user-defined segment (see prompt_example function below) 103 | ) 104 | 105 | # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you. 106 | typeset -g POWERLEVEL9K_MODE=nerdfont-complete 107 | # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid 108 | # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. 109 | typeset -g POWERLEVEL9K_ICON_PADDING=none 110 | 111 | # Basic style options that define the overall look of your prompt. You probably don't want to 112 | # change them. 113 | typeset -g POWERLEVEL9K_BACKGROUND= # transparent background 114 | typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace 115 | typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space 116 | typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol 117 | 118 | # When set to true, icons appear before content on both sides of the prompt. When set 119 | # to false, icons go after content. If empty or not set, icons go before content in the left 120 | # prompt and after content in the right prompt. 121 | # 122 | # You can also override it for a specific segment: 123 | # 124 | # POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false 125 | # 126 | # Or for a specific segment in specific state: 127 | # 128 | # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false 129 | typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=true 130 | 131 | # Add an empty line before each prompt. 132 | typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false 133 | 134 | # Connect left prompt lines with these symbols. 135 | typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX= 136 | typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX= 137 | typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX= 138 | # Connect right prompt lines with these symbols. 139 | typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX= 140 | typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX= 141 | typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX= 142 | 143 | # The left end of left prompt. 144 | typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= 145 | # The right end of right prompt. 146 | typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL= 147 | 148 | # Ruler, a.k.a. the horizontal line before each prompt. If you set it to true, you'll 149 | # probably want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false above and 150 | # POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' below. 151 | typeset -g POWERLEVEL9K_SHOW_RULER=false 152 | typeset -g POWERLEVEL9K_RULER_CHAR='─' # reasonable alternative: '·' 153 | typeset -g POWERLEVEL9K_RULER_FOREGROUND=7 154 | 155 | # Filler between left and right prompt on the first prompt line. You can set it to '·' or '─' 156 | # to make it easier to see the alignment between left and right prompt and to separate prompt 157 | # from command output. It serves the same purpose as ruler (see above) without increasing 158 | # the number of prompt lines. You'll probably want to set POWERLEVEL9K_SHOW_RULER=false 159 | # if using this. You might also like POWERLEVEL9K_PROMPT_ADD_NEWLINE=false for more compact 160 | # prompt. 161 | typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' 162 | if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then 163 | # The color of the filler. 164 | typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=7 165 | # Add a space between the end of left prompt and the filler. 166 | typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=' ' 167 | # Add a space between the filler and the start of right prompt. 168 | typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL=' ' 169 | # Start filler from the edge of the screen if there are no left segments on the first line. 170 | typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' 171 | # End filler on the edge of the screen if there are no right segments on the first line. 172 | typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' 173 | fi 174 | 175 | #################################[ os_icon: os identifier ]################################## 176 | # OS identifier color. 177 | typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND= 178 | # Custom icon. 179 | # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' 180 | 181 | ################################[ prompt_char: prompt symbol ]################################ 182 | # Green prompt symbol if the last command succeeded. 183 | typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=2 184 | # Red prompt symbol if the last command failed. 185 | typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=1 186 | # Default prompt symbol. 187 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' 188 | # Prompt symbol in command vi mode. 189 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' 190 | # Prompt symbol in visual vi mode. 191 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' 192 | # Prompt symbol in overwrite vi mode. 193 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' 194 | typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true 195 | # No line terminator if prompt_char is the last segment. 196 | typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='' 197 | # No line introducer if prompt_char is the first segment. 198 | typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= 199 | 200 | ##################################[ dir: current directory ]################################## 201 | # Default current directory color. 202 | typeset -g POWERLEVEL9K_DIR_FOREGROUND=4 203 | # If directory is too long, shorten some of its segments to the shortest possible unique 204 | # prefix. The shortened directory can be tab-completed to the original. 205 | typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique 206 | # Replace removed segment suffixes with this symbol. 207 | typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= 208 | # Color of the shortened directory segments. 209 | typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=4 210 | # Color of the anchor directory segments. Anchor segments are never shortened. The first 211 | # segment is always an anchor. 212 | typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=4 213 | # Set to true to display anchor directory segments in bold. 214 | typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=false 215 | # Don't shorten directories that contain any of these files. They are anchors. 216 | local anchor_files=( 217 | .bzr 218 | .citc 219 | .git 220 | .hg 221 | .node-version 222 | .python-version 223 | .go-version 224 | .ruby-version 225 | .lua-version 226 | .java-version 227 | .perl-version 228 | .php-version 229 | .tool-version 230 | .shorten_folder_marker 231 | .svn 232 | .terraform 233 | CVS 234 | Cargo.toml 235 | composer.json 236 | go.mod 237 | package.json 238 | stack.yaml 239 | ) 240 | typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" 241 | # If set to "first" ("last"), remove everything before the first (last) subdirectory that contains 242 | # files matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is 243 | # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) 244 | # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers 245 | # and other directories don't. 246 | # 247 | # Optionally, "first" and "last" can be followed by ":" where is an integer. 248 | # This moves the truncation point to the right (positive offset) or to the left (negative offset) 249 | # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" 250 | # respectively. 251 | typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false 252 | # Don't shorten this many last directory segments. They are anchors. 253 | typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 254 | # Shorten directory if it's longer than this even if there is space for it. The value can 255 | # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty, 256 | # directory will be shortened only when prompt doesn't fit or when other parameters demand it 257 | # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). 258 | # If set to `0`, directory will always be shortened to its minimum length. 259 | typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 260 | # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this 261 | # many columns for typing commands. 262 | typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 263 | # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least 264 | # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands. 265 | typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 266 | # If set to true, embed a hyperlink into the directory. Useful for quickly 267 | # opening a directory in the file manager simply by clicking the link. 268 | # Can also be handy when the directory is shortened, as it allows you to see 269 | # the full directory that was used in previous commands. 270 | typeset -g POWERLEVEL9K_DIR_HYPERLINK=false 271 | 272 | # Enable special styling for non-writable directories. See POWERLEVEL9K_LOCK_ICON and 273 | # POWERLEVEL9K_DIR_CLASSES below. 274 | typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v2 275 | 276 | # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON 277 | # and POWERLEVEL9K_DIR_CLASSES below. 278 | typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3 279 | 280 | # The default icon shown next to non-writable and non-existent directories when 281 | # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. 282 | # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' 283 | 284 | # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different 285 | # directories. It must be an array with 3 * N elements. Each triplet consists of: 286 | # 287 | # 1. A pattern against which the current directory ($PWD) is matched. Matching is done with 288 | # extended_glob option enabled. 289 | # 2. Directory class for the purpose of styling. 290 | # 3. An empty string. 291 | # 292 | # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. 293 | # 294 | # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories 295 | # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. 296 | # 297 | # For example, given these settings: 298 | # 299 | # typeset -g POWERLEVEL9K_DIR_CLASSES=( 300 | # '~/work(|/*)' WORK '' 301 | # '~(|/*)' HOME '' 302 | # '*' DEFAULT '') 303 | # 304 | # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one 305 | # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or 306 | # WORK_NON_EXISTENT. 307 | # 308 | # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an 309 | # option to define custom colors and icons for different directory classes. 310 | # 311 | # # Styling for WORK. 312 | # typeset -g POWERLEVEL9K_DIR_WORK_VISUAL_IDENTIFIER_EXPANSION='⭐' 313 | # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=4 314 | # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=4 315 | # typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=4 316 | # 317 | # # Styling for WORK_NOT_WRITABLE. 318 | # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐' 319 | # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=4 320 | # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=4 321 | # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=4# 322 | # 323 | # Styling for WORK_NON_EXISTENT. 324 | # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' 325 | # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=4 326 | # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=4 327 | # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=4 328 | # 329 | # If a styling parameter isn't explicitly defined for some class, it falls back to the classless 330 | # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls 331 | # back to POWERLEVEL9K_DIR_FOREGROUND. 332 | # 333 | typeset -g POWERLEVEL9K_DIR_CLASSES=() 334 | 335 | # Custom prefix. 336 | # typeset -g POWERLEVEL9K_DIR_PREFIX='%fin ' 337 | 338 | #####################################[ vcs: git status ]###################################### 339 | # Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon. 340 | typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= 341 | 342 | # Untracked files icon. It's really a question mark, your font isn't broken. 343 | # Change the value of this parameter to show a different icon. 344 | typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' 345 | 346 | # Formatter for Git status. 347 | # 348 | # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42. 349 | # 350 | # You can edit the function to customize how Git status looks. 351 | # 352 | # VCS_STATUS_* parameters are set by gitstatus plugin. See reference: 353 | # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. 354 | function my_git_formatter() { 355 | emulate -L zsh 356 | 357 | if [[ -n $P9K_CONTENT ]]; then 358 | # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from 359 | # gitstatus plugin). VCS_STATUS_* parameters are not available in this case. 360 | typeset -g my_git_format=$P9K_CONTENT 361 | return 362 | fi 363 | 364 | if (( $1 )); then 365 | # Styling for up-to-date Git status. 366 | local meta='%f' # default foreground 367 | local clean='%2F' # green foreground 368 | local modified='%3F' # yellow foreground 369 | local untracked='%4F' # blue foreground 370 | local conflicted='%1F' # red foreground 371 | else 372 | # Styling for incomplete and stale Git status. 373 | local meta='%f' # default foreground 374 | local clean='%f' # default foreground 375 | local modified='%f' # default foreground 376 | local untracked='%f' # default foreground 377 | local conflicted='%f' # default foreground 378 | fi 379 | 380 | local res 381 | 382 | if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then 383 | local branch=${(V)VCS_STATUS_LOCAL_BRANCH} 384 | # If local branch name is at most 32 characters long, show it in full. 385 | # Otherwise show the first 12 … the last 12. 386 | # Tip: To always show local branch name in full without truncation, delete the next line. 387 | (( $#branch > 32 )) && branch[13,-13]="…" # <-- this line 388 | res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" 389 | fi 390 | 391 | if [[ -n $VCS_STATUS_TAG 392 | # Show tag only if not on a branch. 393 | # Tip: To always show tag, delete the next line. 394 | && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line 395 | ]]; then 396 | local tag=${(V)VCS_STATUS_TAG} 397 | # If tag name is at most 32 characters long, show it in full. 398 | # Otherwise show the first 12 … the last 12. 399 | # Tip: To always show tag name in full without truncation, delete the next line. 400 | (( $#tag > 32 )) && tag[13,-13]="…" # <-- this line 401 | res+="${meta}#${clean}${tag//\%/%%}" 402 | fi 403 | 404 | # Display the current Git commit if there is no branch and no tag. 405 | # Tip: To always display the current Git commit, delete the next line. 406 | [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line 407 | res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" 408 | 409 | # Show tracking branch name if it differs from local branch. 410 | if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then 411 | res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" 412 | fi 413 | 414 | # Display "wip" if the latest commit's summary contains "wip" or "WIP". 415 | if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then 416 | res+=" ${modified}wip" 417 | fi 418 | 419 | # ⇣42 if behind the remote. 420 | (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" 421 | # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. 422 | (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " 423 | (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" 424 | # ⇠42 if behind the push remote. 425 | (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" 426 | (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " 427 | # ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42. 428 | (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}" 429 | # *42 if have stashes. 430 | (( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}" 431 | # 'merge' if the repo is in an unusual state. 432 | [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}" 433 | # ~42 if have merge conflicts. 434 | (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}" 435 | # +42 if have staged changes. 436 | (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}" 437 | # !42 if have unstaged changes. 438 | (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}" 439 | # ?42 if have untracked files. It's really a question mark, your font isn't broken. 440 | # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon. 441 | # Remove the next line if you don't want to see untracked files at all. 442 | (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" 443 | # "─" if the number of unstaged files is unknown. This can happen due to 444 | # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower 445 | # than the number of files in the Git index, or due to bash.showDirtyState being set to false 446 | # in the repository config. The number of staged and untracked files may also be unknown 447 | # in this case. 448 | (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}─" 449 | 450 | typeset -g my_git_format=$res 451 | } 452 | functions -M my_git_formatter 2>/dev/null 453 | 454 | # Don't count the number of unstaged, untracked and conflicted files in Git repositories with 455 | # more than this many files in the index. Negative value means infinity. 456 | # 457 | # If you are working in Git repositories with tens of millions of files and seeing performance 458 | # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output 459 | # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's 460 | # config: `git config bash.showDirtyState false`. 461 | typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 462 | 463 | # Don't show Git status in prompt for repositories whose workdir matches this pattern. 464 | # For example, if set to '~', the Git repository at $HOME/.git will be ignored. 465 | # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. 466 | typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' 467 | 468 | # Disable the default Git status formatting. 469 | typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true 470 | # Install our own Git status formatter. 471 | typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter(1)))+${my_git_format}}' 472 | typeset -g POWERLEVEL9K_VCS_LOADING_CONTENT_EXPANSION='${$((my_git_formatter(0)))+${my_git_format}}' 473 | # Enable counters for staged, unstaged, etc. 474 | typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 475 | 476 | # Icon color. 477 | typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_COLOR=2 478 | typeset -g POWERLEVEL9K_VCS_LOADING_VISUAL_IDENTIFIER_COLOR= 479 | # Custom icon. 480 | typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION= 481 | # Custom prefix. 482 | # typeset -g POWERLEVEL9K_VCS_PREFIX='%fon ' 483 | 484 | # Show status of repositories of these types. You can add svn and/or hg if you are 485 | # using them. If you do, your prompt may become slow even when your current directory 486 | # isn't in an svn or hg reposotiry. 487 | typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) 488 | 489 | # These settings are used for repositories other than Git or when gitstatusd fails and 490 | # Powerlevel10k has to fall back to using vcs_info. 491 | typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=2 492 | typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=2 493 | typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=3 494 | 495 | ##########################[ status: exit code of the last command ]########################### 496 | # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and 497 | # style them independently from the regular OK and ERROR state. 498 | typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true 499 | 500 | # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as 501 | # it will signify success by turning green. 502 | typeset -g POWERLEVEL9K_STATUS_OK=false 503 | typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=2 504 | typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔' 505 | 506 | # Status when some part of a pipe command fails but the overall exit status is zero. It may look 507 | # like this: 1|0. 508 | typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true 509 | typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=2 510 | typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔' 511 | 512 | # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as 513 | # it will signify error by turning red. 514 | typeset -g POWERLEVEL9K_STATUS_ERROR=false 515 | typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=1 516 | typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘' 517 | 518 | # Status when the last command was terminated by a signal. 519 | typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true 520 | typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=1 521 | # Use terse signal names: "INT" instead of "SIGINT(2)". 522 | typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false 523 | typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘' 524 | 525 | # Status when some part of a pipe command fails and the overall exit status is also non-zero. 526 | # It may look like this: 1|0. 527 | typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true 528 | typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=1 529 | typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' 530 | 531 | ###################[ command_execution_time: duration of the last command ]################### 532 | # Show duration of the last command if takes at least this many seconds. 533 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 534 | # Show this many fractional digits. Zero means round to seconds. 535 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 536 | # Execution time color. 537 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=3 538 | # Duration format: 1d 2h 3m 4s. 539 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' 540 | # Custom icon. 541 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION= 542 | # Custom prefix. 543 | # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%ftook ' 544 | 545 | #######################[ background_jobs: presence of background jobs ]####################### 546 | # Don't show the number of background jobs. 547 | typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false 548 | # Background jobs color. 549 | typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=1 550 | # Custom icon. 551 | # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐' 552 | 553 | #######################[ direnv: direnv status (https://direnv.net/) ]######################## 554 | # Direnv color. 555 | typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=3 556 | # Custom icon. 557 | # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 558 | 559 | ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### 560 | # Default asdf color. Only used to display tools for which there is no color override (see below). 561 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND. 562 | typeset -g POWERLEVEL9K_ASDF_FOREGROUND=6 563 | 564 | # There are four parameters that can be used to hide asdf tools. Each parameter describes 565 | # conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at 566 | # least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to 567 | # hide a tool, it gets shown. 568 | # 569 | # Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and 570 | # POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands: 571 | # 572 | # asdf local python 3.8.1 573 | # asdf global python 3.8.1 574 | # 575 | # After running both commands the current python version is 3.8.1 and its source is "local" as 576 | # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, 577 | # it'll hide python version in this case because 3.8.1 is the same as the global version. 578 | # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't 579 | # contain "local". 580 | 581 | # Hide tool versions that don't come from one of these sources. 582 | # 583 | # Available sources: 584 | # 585 | # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" 586 | # - local `asdf current` says "set by /some/not/home/directory/file" 587 | # - global `asdf current` says "set by /home/username/file" 588 | # 589 | # Note: If this parameter is set to (shell local global), it won't hide tools. 590 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. 591 | typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) 592 | 593 | # If set to false, hide tool versions that are the same as global. 594 | # 595 | # Note: The name of this parameter doesn't reflect its meaning at all. 596 | # Note: If this parameter is set to true, it won't hide tools. 597 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. 598 | typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false 599 | 600 | # If set to false, hide tool versions that are equal to "system". 601 | # 602 | # Note: If this parameter is set to true, it won't hide tools. 603 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. 604 | typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true 605 | 606 | # If set to non-empty value, hide tools unless there is a file matching the specified file pattern 607 | # in the current directory, or its parent directory, or its grandparent directory, and so on. 608 | # 609 | # Note: If this parameter is set to empty value, it won't hide tools. 610 | # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. 611 | # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB. 612 | # 613 | # Example: Hide nodejs version when there is no package.json and no *.js files in the current 614 | # directory, in `..`, in `../..` and so on. 615 | # 616 | # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json' 617 | typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB= 618 | 619 | # Ruby version from asdf. 620 | typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=1 621 | # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' 622 | # typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar' 623 | 624 | # Python version from asdf. 625 | typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=6 626 | # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' 627 | # typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar' 628 | 629 | # Go version from asdf. 630 | typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=6 631 | # typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' 632 | # typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar' 633 | 634 | # Node.js version from asdf. 635 | typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=2 636 | # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' 637 | # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar' 638 | 639 | # Rust version from asdf. 640 | typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=4 641 | # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' 642 | # typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar' 643 | 644 | # .NET Core version from asdf. 645 | typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=5 646 | # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' 647 | # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_SHOW_ON_UPGLOB='*.foo|*.bar' 648 | 649 | # Flutter version from asdf. 650 | typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=4 651 | # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' 652 | # typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar' 653 | 654 | # Lua version from asdf. 655 | typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=4 656 | # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' 657 | # typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar' 658 | 659 | # Java version from asdf. 660 | typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=4 661 | # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' 662 | # typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar' 663 | 664 | # Perl version from asdf. 665 | typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=6 666 | # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' 667 | # typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar' 668 | 669 | # Erlang version from asdf. 670 | typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=1 671 | # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' 672 | # typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar' 673 | 674 | # Elixir version from asdf. 675 | typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=5 676 | # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' 677 | # typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar' 678 | 679 | # Postgres version from asdf. 680 | typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=6 681 | # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' 682 | # typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar' 683 | 684 | # PHP version from asdf. 685 | typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=5 686 | # typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐' 687 | # typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar' 688 | 689 | # Haskell version from asdf. 690 | typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=3 691 | # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' 692 | # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' 693 | 694 | # Julia version from asdf. 695 | typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=2 696 | # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' 697 | # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' 698 | 699 | ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### 700 | # NordVPN connection indicator color. 701 | typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=6 702 | # Hide NordVPN connection indicator when not connected. 703 | typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= 704 | typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= 705 | # Custom icon. 706 | # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐' 707 | 708 | #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## 709 | # Ranger shell color. 710 | typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3 711 | # Custom icon. 712 | # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' 713 | 714 | ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### 715 | # Nnn shell color. 716 | typeset -g POWERLEVEL9K_NNN_FOREGROUND=3 717 | # Custom icon. 718 | # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' 719 | 720 | ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## 721 | # xplr shell color. 722 | typeset -g POWERLEVEL9K_XPLR_FOREGROUND=3 723 | # Custom icon. 724 | # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' 725 | 726 | ###########################[ vim_shell: vim shell indicator (:sh) ]########################### 727 | # Vim shell indicator color. 728 | typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=3 729 | # Custom icon. 730 | # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' 731 | 732 | ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### 733 | # Midnight Commander shell color. 734 | typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=3 735 | # Custom icon. 736 | # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' 737 | 738 | #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## 739 | # Nix shell color. 740 | typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=4 741 | 742 | # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. 743 | # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= 744 | 745 | # Custom icon. 746 | # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' 747 | 748 | ##################################[ disk_usage: disk usage ]################################## 749 | # Colors for different levels of disk usage. 750 | typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=2 751 | typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=3 752 | typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=1 753 | # Thresholds for different levels of disk usage (percentage points). 754 | typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 755 | typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 756 | # If set to true, hide disk usage when below $POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL percent. 757 | typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false 758 | # Custom icon. 759 | # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' 760 | 761 | ######################################[ ram: free RAM ]####################################### 762 | # RAM color. 763 | typeset -g POWERLEVEL9K_RAM_FOREGROUND=2 764 | # Custom icon. 765 | # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐' 766 | 767 | #####################################[ swap: used swap ]###################################### 768 | # Swap color. 769 | typeset -g POWERLEVEL9K_SWAP_FOREGROUND=3 770 | # Custom icon. 771 | # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐' 772 | 773 | ######################################[ load: CPU load ]###################################### 774 | # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15. 775 | typeset -g POWERLEVEL9K_LOAD_WHICH=5 776 | # Load color when load is under 50%. 777 | typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=2 778 | # Load color when load is between 50% and 70%. 779 | typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=3 780 | # Load color when load is over 70%. 781 | typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=1 782 | # Custom icon. 783 | # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐' 784 | 785 | ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################ 786 | # Todo color. 787 | typeset -g POWERLEVEL9K_TODO_FOREGROUND=4 788 | # Hide todo when the total number of tasks is zero. 789 | typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true 790 | # Hide todo when the number of tasks after filtering is zero. 791 | typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false 792 | 793 | # Todo format. The following parameters are available within the expansion. 794 | # 795 | # - P9K_TODO_TOTAL_TASK_COUNT The total number of tasks. 796 | # - P9K_TODO_FILTERED_TASK_COUNT The number of tasks after filtering. 797 | # 798 | # These variables correspond to the last line of the output of `todo.sh -p ls`: 799 | # 800 | # TODO: 24 of 42 tasks shown 801 | # 802 | # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT. 803 | # 804 | # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT' 805 | 806 | # Custom icon. 807 | # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐' 808 | 809 | ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############ 810 | # Timewarrior color. 811 | typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=4 812 | # If the tracked task is longer than 24 characters, truncate and append "…". 813 | # Tip: To always display tasks without truncation, delete the following parameter. 814 | # Tip: To hide task names and display just the icon when time tracking is enabled, set the 815 | # value of the following parameter to "". 816 | typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+…}' 817 | 818 | # Custom icon. 819 | # typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' 820 | 821 | ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## 822 | # Taskwarrior color. 823 | typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=6 824 | 825 | # Taskwarrior segment format. The following parameters are available within the expansion. 826 | # 827 | # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. 828 | # - P9K_TASKWARRIOR_OVERDUE_COUNT The number of overdue tasks: `task +OVERDUE count`. 829 | # 830 | # Zero values are represented as empty parameters. 831 | # 832 | # The default format: 833 | # 834 | # '${P9K_TASKWARRIOR_OVERDUE_COUNT:+"!$P9K_TASKWARRIOR_OVERDUE_COUNT/"}$P9K_TASKWARRIOR_PENDING_COUNT' 835 | # 836 | # typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT' 837 | 838 | # Custom icon. 839 | # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' 840 | 841 | ##################################[ context: user@hostname ]################################## 842 | # Context color when running with privileges. 843 | typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1 844 | # Context color in SSH without privileges. 845 | typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=7 846 | # Default context color (no privileges, no SSH). 847 | typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=7 848 | 849 | # Context format when running with privileges: bold user@hostname. 850 | typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%B%n@%m' 851 | # Context format when in SSH without privileges: user@hostname. 852 | typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m' 853 | # Default context format (no privileges, no SSH): user@hostname. 854 | typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m' 855 | 856 | # Don't show context unless running with privileges or in SSH. 857 | # Tip: Remove the next line to always show context. 858 | typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= 859 | 860 | # Custom icon. 861 | # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' 862 | # Custom prefix. 863 | # typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%fwith ' 864 | 865 | ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### 866 | # Python virtual environment color. 867 | typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=6 868 | # Don't show Python version next to the virtual environment name. 869 | typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false 870 | # If set to "false", won't show virtualenv if pyenv is already shown. 871 | # If set to "if-different", won't show virtualenv if it's the same as pyenv. 872 | typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false 873 | # Separate environment name from Python version only with a space. 874 | typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= 875 | # Custom icon. 876 | # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 877 | 878 | #####################[ anaconda: conda environment (https://conda.io/) ]###################### 879 | # Anaconda environment color. 880 | typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=6 881 | 882 | # Anaconda segment format. The following parameters are available within the expansion. 883 | # 884 | # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. 885 | # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. 886 | # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). 887 | # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). 888 | # 889 | # CONDA_PROMPT_MODIFIER can be configured with the following command: 890 | # 891 | # conda config --set env_prompt '({default_env}) ' 892 | # 893 | # The last argument is a Python format string that can use the following variables: 894 | # 895 | # - prefix The same as CONDA_PREFIX. 896 | # - default_env The same as CONDA_DEFAULT_ENV. 897 | # - name The last segment of CONDA_PREFIX. 898 | # - stacked_env Comma-separated list of names in the environment stack. The first element is 899 | # always the same as default_env. 900 | # 901 | # Note: '({default_env}) ' is the default value of env_prompt. 902 | # 903 | # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER 904 | # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former 905 | # is empty. 906 | typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' 907 | 908 | # Custom icon. 909 | # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' 910 | 911 | ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ 912 | # Pyenv color. 913 | typeset -g POWERLEVEL9K_PYENV_FOREGROUND=6 914 | # Hide python version if it doesn't come from one of these sources. 915 | typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) 916 | # If set to false, hide python version if it's the same as global: 917 | # $(pyenv version-name) == $(pyenv global). 918 | typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false 919 | # If set to false, hide python version if it's equal to "system". 920 | typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true 921 | 922 | # Pyenv segment format. The following parameters are available within the expansion. 923 | # 924 | # - P9K_CONTENT Current pyenv environment (pyenv version-name). 925 | # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). 926 | # 927 | # The default format has the following logic: 928 | # 929 | # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or 930 | # starts with "$P9K_PYENV_PYTHON_VERSION/". 931 | # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". 932 | typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' 933 | 934 | # Custom icon. 935 | # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 936 | 937 | ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################ 938 | # Goenv color. 939 | typeset -g POWERLEVEL9K_GOENV_FOREGROUND=6 940 | # Hide go version if it doesn't come from one of these sources. 941 | typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) 942 | # If set to false, hide go version if it's the same as global: 943 | # $(goenv version-name) == $(goenv global). 944 | typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false 945 | # If set to false, hide go version if it's equal to "system". 946 | typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true 947 | # Custom icon. 948 | # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 949 | 950 | ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## 951 | # Nodenv color. 952 | typeset -g POWERLEVEL9K_NODENV_FOREGROUND=2 953 | # Hide node version if it doesn't come from one of these sources. 954 | typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) 955 | # If set to false, hide node version if it's the same as global: 956 | # $(nodenv version-name) == $(nodenv global). 957 | typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false 958 | # If set to false, hide node version if it's equal to "system". 959 | typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true 960 | # Custom icon. 961 | # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 962 | 963 | ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### 964 | # Nvm color. 965 | typeset -g POWERLEVEL9K_NVM_FOREGROUND=2 966 | # Custom icon. 967 | # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' 968 | 969 | ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ 970 | # Nodeenv color. 971 | typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=2 972 | # Don't show Node version next to the environment name. 973 | typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false 974 | # Separate environment name from Node version only with a space. 975 | typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= 976 | # Custom icon. 977 | # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 978 | 979 | ##############################[ node_version: node.js version ]############################### 980 | # Node version color. 981 | typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=2 982 | # Show node version only when in a directory tree containing package.json. 983 | typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true 984 | # Custom icon. 985 | # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 986 | 987 | #######################[ go_version: go version (https://golang.org) ]######################## 988 | # Go version color. 989 | typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=6 990 | # Show go version only when in a go project subdirectory. 991 | typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true 992 | # Custom icon. 993 | # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 994 | 995 | #################[ rust_version: rustc version (https://www.rust-lang.org) ]################## 996 | # Rust version color. 997 | typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=4 998 | # Show rust version only when in a rust project subdirectory. 999 | typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true 1000 | # Custom icon. 1001 | # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 1002 | 1003 | ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################ 1004 | # .NET version color. 1005 | typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=5 1006 | # Show .NET version only when in a .NET project subdirectory. 1007 | typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true 1008 | # Custom icon. 1009 | # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 1010 | 1011 | #####################[ php_version: php version (https://www.php.net/) ]###################### 1012 | # PHP version color. 1013 | typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=5 1014 | # Show PHP version only when in a PHP project subdirectory. 1015 | typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true 1016 | # Custom icon. 1017 | # typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 1018 | 1019 | ##########[ laravel_version: laravel php framework version (https://laravel.com/) ]########### 1020 | # Laravel version color. 1021 | typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=1 1022 | # Custom icon. 1023 | # typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 1024 | 1025 | ####################[ java_version: java version (https://www.java.com/) ]#################### 1026 | # Java version color. 1027 | typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=4 1028 | # Show java version only when in a java project subdirectory. 1029 | typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true 1030 | # Show brief version. 1031 | typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false 1032 | # Custom icon. 1033 | # typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' 1034 | 1035 | ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]#### 1036 | # Package color. 1037 | typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=6 1038 | # Package format. The following parameters are available within the expansion. 1039 | # 1040 | # - P9K_PACKAGE_NAME The value of `name` field in package.json. 1041 | # - P9K_PACKAGE_VERSION The value of `version` field in package.json. 1042 | # 1043 | # typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}' 1044 | # Custom icon. 1045 | # typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' 1046 | 1047 | #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]############## 1048 | # Rbenv color. 1049 | typeset -g POWERLEVEL9K_RBENV_FOREGROUND=1 1050 | # Hide ruby version if it doesn't come from one of these sources. 1051 | typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) 1052 | # If set to false, hide ruby version if it's the same as global: 1053 | # $(rbenv version-name) == $(rbenv global). 1054 | typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false 1055 | # If set to false, hide ruby version if it's equal to "system". 1056 | typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true 1057 | # Custom icon. 1058 | # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1059 | 1060 | #######################[ rvm: ruby version from rvm (https://rvm.io) ]######################## 1061 | # Rvm color. 1062 | typeset -g POWERLEVEL9K_RVM_FOREGROUND=1 1063 | # Don't show @gemset at the end. 1064 | typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false 1065 | # Don't show ruby- at the front. 1066 | typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false 1067 | # Custom icon. 1068 | # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐' 1069 | 1070 | ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############ 1071 | # Fvm color. 1072 | typeset -g POWERLEVEL9K_FVM_FOREGROUND=4 1073 | # Custom icon. 1074 | # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐' 1075 | 1076 | ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]########### 1077 | # Lua color. 1078 | typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=4 1079 | # Hide lua version if it doesn't come from one of these sources. 1080 | typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) 1081 | # If set to false, hide lua version if it's the same as global: 1082 | # $(luaenv version-name) == $(luaenv global). 1083 | typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false 1084 | # If set to false, hide lua version if it's equal to "system". 1085 | typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true 1086 | # Custom icon. 1087 | # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1088 | 1089 | ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################ 1090 | # Java color. 1091 | typeset -g POWERLEVEL9K_JENV_FOREGROUND=4 1092 | # Hide java version if it doesn't come from one of these sources. 1093 | typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) 1094 | # If set to false, hide java version if it's the same as global: 1095 | # $(jenv version-name) == $(jenv global). 1096 | typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false 1097 | # If set to false, hide java version if it's equal to "system". 1098 | typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true 1099 | # Custom icon. 1100 | # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1101 | 1102 | ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############ 1103 | # Perl color. 1104 | typeset -g POWERLEVEL9K_PLENV_FOREGROUND=6 1105 | # Hide perl version if it doesn't come from one of these sources. 1106 | typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) 1107 | # If set to false, hide perl version if it's the same as global: 1108 | # $(plenv version-name) == $(plenv global). 1109 | typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false 1110 | # If set to false, hide perl version if it's equal to "system". 1111 | typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true 1112 | # Custom icon. 1113 | # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1114 | 1115 | ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ 1116 | # PHP color. 1117 | typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=5 1118 | # Hide php version if it doesn't come from one of these sources. 1119 | typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) 1120 | # If set to false, hide php version if it's the same as global: 1121 | # $(phpenv version-name) == $(phpenv global). 1122 | typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false 1123 | # If set to false, hide php version if it's equal to "system". 1124 | typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true 1125 | # Custom icon. 1126 | # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1127 | 1128 | #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### 1129 | # Scala color. 1130 | typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=1 1131 | # Hide scala version if it doesn't come from one of these sources. 1132 | typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) 1133 | # If set to false, hide scala version if it's the same as global: 1134 | # $(scalaenv version-name) == $(scalaenv global). 1135 | typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false 1136 | # If set to false, hide scala version if it's equal to "system". 1137 | typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true 1138 | # Custom icon. 1139 | # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1140 | 1141 | ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### 1142 | # Haskell color. 1143 | typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=3 1144 | # Hide haskell version if it doesn't come from one of these sources. 1145 | # 1146 | # shell: version is set by STACK_YAML 1147 | # local: version is set by stack.yaml up the directory tree 1148 | # global: version is set by the implicit global project (~/.stack/global-project/stack.yaml) 1149 | typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local) 1150 | # If set to false, hide haskell version if it's the same as in the implicit global project. 1151 | typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true 1152 | # Custom icon. 1153 | # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' 1154 | 1155 | #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# 1156 | # Show kubecontext only when the the command you are typing invokes one of these tools. 1157 | # Tip: Remove the next line to always show kubecontext. 1158 | typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|fluxctl|stern' 1159 | 1160 | # Kubernetes context classes for the purpose of using different colors, icons and expansions with 1161 | # different contexts. 1162 | # 1163 | # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element 1164 | # in each pair defines a pattern against which the current kubernetes context gets matched. 1165 | # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) 1166 | # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters, 1167 | # you'll see this value in your prompt. The second element of each pair in 1168 | # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The 1169 | # first match wins. 1170 | # 1171 | # For example, given these settings: 1172 | # 1173 | # typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( 1174 | # '*prod*' PROD 1175 | # '*test*' TEST 1176 | # '*' DEFAULT) 1177 | # 1178 | # If your current kubernetes context is "deathray-testing/default", its class is TEST 1179 | # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'. 1180 | # 1181 | # You can define different colors, icons and content expansions for different classes: 1182 | # 1183 | # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=3 1184 | # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' 1185 | # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' 1186 | typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( 1187 | # '*prod*' PROD # These values are examples that are unlikely 1188 | # '*test*' TEST # to match your needs. Customize them as needed. 1189 | '*' DEFAULT) 1190 | typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=5 1191 | # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' 1192 | 1193 | # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext 1194 | # segment. Parameter expansions are very flexible and fast, too. See reference: 1195 | # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. 1196 | # 1197 | # Within the expansion the following parameters are always available: 1198 | # 1199 | # - P9K_CONTENT The content that would've been displayed if there was no content 1200 | # expansion defined. 1201 | # - P9K_KUBECONTEXT_NAME The current context's name. Corresponds to column NAME in the 1202 | # output of `kubectl config get-contexts`. 1203 | # - P9K_KUBECONTEXT_CLUSTER The current context's cluster. Corresponds to column CLUSTER in the 1204 | # output of `kubectl config get-contexts`. 1205 | # - P9K_KUBECONTEXT_NAMESPACE The current context's namespace. Corresponds to column NAMESPACE 1206 | # in the output of `kubectl config get-contexts`. If there is no 1207 | # namespace, the parameter is set to "default". 1208 | # - P9K_KUBECONTEXT_USER The current context's user. Corresponds to column AUTHINFO in the 1209 | # output of `kubectl config get-contexts`. 1210 | # 1211 | # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS), 1212 | # the following extra parameters are available: 1213 | # 1214 | # - P9K_KUBECONTEXT_CLOUD_NAME Either "gke" or "eks". 1215 | # - P9K_KUBECONTEXT_CLOUD_ACCOUNT Account/project ID. 1216 | # - P9K_KUBECONTEXT_CLOUD_ZONE Availability zone. 1217 | # - P9K_KUBECONTEXT_CLOUD_CLUSTER Cluster. 1218 | # 1219 | # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example, 1220 | # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01": 1221 | # 1222 | # - P9K_KUBECONTEXT_CLOUD_NAME=gke 1223 | # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account 1224 | # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a 1225 | # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 1226 | # 1227 | # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01": 1228 | # 1229 | # - P9K_KUBECONTEXT_CLOUD_NAME=eks 1230 | # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012 1231 | # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1 1232 | # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 1233 | typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION= 1234 | # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME. 1235 | POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' 1236 | # Append the current context's namespace if it's not "default". 1237 | POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' 1238 | 1239 | # Custom prefix. 1240 | # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%fat ' 1241 | 1242 | ################[ terraform: terraform workspace (https://www.terraform.io) ]################# 1243 | # Don't show terraform workspace if it's literally "default". 1244 | typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false 1245 | # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element 1246 | # in each pair defines a pattern against which the current terraform workspace gets matched. 1247 | # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) 1248 | # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters, 1249 | # you'll see this value in your prompt. The second element of each pair in 1250 | # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The 1251 | # first match wins. 1252 | # 1253 | # For example, given these settings: 1254 | # 1255 | # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( 1256 | # '*prod*' PROD 1257 | # '*test*' TEST 1258 | # '*' OTHER) 1259 | # 1260 | # If your current terraform workspace is "project_test", its class is TEST because "project_test" 1261 | # doesn't match the pattern '*prod*' but does match '*test*'. 1262 | # 1263 | # You can define different colors, icons and content expansions for different classes: 1264 | # 1265 | # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=2 1266 | # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' 1267 | # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' 1268 | typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( 1269 | # '*prod*' PROD # These values are examples that are unlikely 1270 | # '*test*' TEST # to match your needs. Customize them as needed. 1271 | '*' OTHER) 1272 | typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=4 1273 | # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' 1274 | 1275 | #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# 1276 | # Show aws only when the the command you are typing invokes one of these tools. 1277 | # Tip: Remove the next line to always show aws. 1278 | typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' 1279 | 1280 | # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element 1281 | # in each pair defines a pattern against which the current AWS profile gets matched. 1282 | # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) 1283 | # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, 1284 | # you'll see this value in your prompt. The second element of each pair in 1285 | # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The 1286 | # first match wins. 1287 | # 1288 | # For example, given these settings: 1289 | # 1290 | # typeset -g POWERLEVEL9K_AWS_CLASSES=( 1291 | # '*prod*' PROD 1292 | # '*test*' TEST 1293 | # '*' DEFAULT) 1294 | # 1295 | # If your current AWS profile is "company_test", its class is TEST 1296 | # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. 1297 | # 1298 | # You can define different colors, icons and content expansions for different classes: 1299 | # 1300 | # typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=2 1301 | # typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' 1302 | # typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' 1303 | typeset -g POWERLEVEL9K_AWS_CLASSES=( 1304 | # '*prod*' PROD # These values are examples that are unlikely 1305 | # '*test*' TEST # to match your needs. Customize them as needed. 1306 | '*' DEFAULT) 1307 | typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=3 1308 | # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' 1309 | 1310 | # AWS segment format. The following parameters are available within the expansion. 1311 | # 1312 | # - P9K_AWS_PROFILE The name of the current AWS profile. 1313 | # - P9K_AWS_REGION The region associated with the current AWS profile. 1314 | typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' 1315 | 1316 | #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# 1317 | # AWS Elastic Beanstalk environment color. 1318 | typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2 1319 | # Custom icon. 1320 | # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' 1321 | 1322 | ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## 1323 | # Show azure only when the the command you are typing invokes one of these tools. 1324 | # Tip: Remove the next line to always show azure. 1325 | typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' 1326 | # Azure account name color. 1327 | typeset -g POWERLEVEL9K_AZURE_FOREGROUND=4 1328 | # Custom icon. 1329 | # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' 1330 | 1331 | ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### 1332 | # Show gcloud only when the the command you are typing invokes one of these tools. 1333 | # Tip: Remove the next line to always show gcloud. 1334 | typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs' 1335 | # Google cloud color. 1336 | typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=4 1337 | 1338 | # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or 1339 | # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative 1340 | # enough. You can use the following parameters in the expansions. Each of them corresponds to the 1341 | # output of `gcloud` tool. 1342 | # 1343 | # Parameter | Source 1344 | # -------------------------|-------------------------------------------------------------------- 1345 | # P9K_GCLOUD_CONFIGURATION | gcloud config configurations list --format='value(name)' 1346 | # P9K_GCLOUD_ACCOUNT | gcloud config get-value account 1347 | # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project 1348 | # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' 1349 | # 1350 | # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. 1351 | # 1352 | # Obtaining project name requires sending a request to Google servers. This can take a long time 1353 | # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud 1354 | # prompt segment is in state PARTIAL. When project name gets known, P9K_GCLOUD_PROJECT_NAME gets 1355 | # set and gcloud prompt segment transitions to state COMPLETE. 1356 | # 1357 | # You can customize the format, icon and colors of gcloud segment separately for states PARTIAL 1358 | # and COMPLETE. You can also hide gcloud in state PARTIAL by setting 1359 | # POWERLEVEL9K_GCLOUD_PARTIAL_VISUAL_IDENTIFIER_EXPANSION and 1360 | # POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION to empty. 1361 | typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}' 1362 | typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}' 1363 | 1364 | # Send a request to Google (by means of `gcloud projects describe ...`) to obtain project name 1365 | # this often. Negative value disables periodic polling. In this mode project name is retrieved 1366 | # only when the current configuration, account or project id changes. 1367 | typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60 1368 | 1369 | # Custom icon. 1370 | # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' 1371 | 1372 | #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# 1373 | # Show google_app_cred only when the the command you are typing invokes one of these tools. 1374 | # Tip: Remove the next line to always show google_app_cred. 1375 | typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' 1376 | 1377 | # Google application credentials classes for the purpose of using different colors, icons and 1378 | # expansions with different credentials. 1379 | # 1380 | # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first 1381 | # element in each pair defines a pattern against which the current kubernetes context gets 1382 | # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion 1383 | # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION 1384 | # parameters, you'll see this value in your prompt. The second element of each pair in 1385 | # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order. 1386 | # The first match wins. 1387 | # 1388 | # For example, given these settings: 1389 | # 1390 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( 1391 | # '*:*prod*:*' PROD 1392 | # '*:*test*:*' TEST 1393 | # '*' DEFAULT) 1394 | # 1395 | # If your current Google application credentials is "service_account deathray-testing x@y.com", 1396 | # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'. 1397 | # 1398 | # You can define different colors, icons and content expansions for different classes: 1399 | # 1400 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=3 1401 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' 1402 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID' 1403 | typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( 1404 | # '*:*prod*:*' PROD # These values are examples that are unlikely 1405 | # '*:*test*:*' TEST # to match your needs. Customize them as needed. 1406 | '*' DEFAULT) 1407 | typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=5 1408 | # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' 1409 | 1410 | # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by 1411 | # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference: 1412 | # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. 1413 | # 1414 | # You can use the following parameters in the expansion. Each of them corresponds to one of the 1415 | # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS. 1416 | # 1417 | # Parameter | JSON key file field 1418 | # ---------------------------------+--------------- 1419 | # P9K_GOOGLE_APP_CRED_TYPE | type 1420 | # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id 1421 | # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email 1422 | # 1423 | # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. 1424 | typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' 1425 | 1426 | ###############################[ public_ip: public IP address ]############################### 1427 | # Public IP color. 1428 | typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=6 1429 | # Custom icon. 1430 | # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' 1431 | 1432 | ########################[ vpn_ip: virtual private network indicator ]######################### 1433 | # VPN IP color. 1434 | typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=3 1435 | # When on VPN, show just an icon without the IP address. 1436 | # Tip: To display the private IP address when on VPN, remove the next line. 1437 | typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= 1438 | # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN 1439 | # to see the name of the interface. 1440 | typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*' 1441 | # If set to true, show one segment per matching network interface. If set to false, show only 1442 | # one segment corresponding to the first matching network interface. 1443 | # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. 1444 | typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false 1445 | # Custom icon. 1446 | # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' 1447 | 1448 | ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### 1449 | # IP color. 1450 | typeset -g POWERLEVEL9K_IP_FOREGROUND=4 1451 | # The following parameters are accessible within the expansion: 1452 | # 1453 | # Parameter | Meaning 1454 | # ----------------------+------------------------------------------- 1455 | # P9K_IP_IP | IP address 1456 | # P9K_IP_INTERFACE | network interface 1457 | # P9K_IP_RX_BYTES | total number of bytes received 1458 | # P9K_IP_TX_BYTES | total number of bytes sent 1459 | # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt 1460 | # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt 1461 | # P9K_IP_RX_RATE | receive rate (since last prompt) 1462 | # P9K_IP_TX_RATE | send rate (since last prompt) 1463 | typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='$P9K_IP_IP${P9K_IP_RX_RATE:+ %2F⇣$P9K_IP_RX_RATE}${P9K_IP_TX_RATE:+ %3F⇡$P9K_IP_TX_RATE}' 1464 | # Show information for the first network interface whose name matches this regular expression. 1465 | # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. 1466 | typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' 1467 | # Custom icon. 1468 | # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' 1469 | 1470 | #########################[ proxy: system-wide http/https/ftp proxy ]########################## 1471 | # Proxy color. 1472 | typeset -g POWERLEVEL9K_PROXY_FOREGROUND=2 1473 | # Custom icon. 1474 | # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐' 1475 | 1476 | ################################[ battery: internal battery ]################################# 1477 | # Show battery in red when it's below this level and not connected to power supply. 1478 | typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 1479 | typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=1 1480 | # Show battery in green when it's charging or fully charged. 1481 | typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=2 1482 | # Show battery in yellow when it's discharging. 1483 | typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=3 1484 | # Battery pictograms going from low to high level of charge. 1485 | typeset -g POWERLEVEL9K_BATTERY_STAGES='\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578' 1486 | # Don't show the remaining time to charge/discharge. 1487 | typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false 1488 | 1489 | #####################################[ wifi: wifi speed ]##################################### 1490 | # WiFi color. 1491 | typeset -g POWERLEVEL9K_WIFI_FOREGROUND=4 1492 | # Custom icon. 1493 | # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' 1494 | 1495 | # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). 1496 | # 1497 | # # Wifi colors and icons for different signal strength levels (low to high). 1498 | # typeset -g my_wifi_fg=(4 4 4 4 4) # <-- change these values 1499 | # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values 1500 | # 1501 | # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' 1502 | # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' 1503 | # 1504 | # The following parameters are accessible within the expansions: 1505 | # 1506 | # Parameter | Meaning 1507 | # ----------------------+--------------- 1508 | # P9K_WIFI_SSID | service set identifier, a.k.a. network name 1509 | # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown 1510 | # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second 1511 | # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 1512 | # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 1513 | # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) 1514 | 1515 | ####################################[ time: current time ]#################################### 1516 | # Current time color. 1517 | typeset -g POWERLEVEL9K_TIME_FOREGROUND=6 1518 | # Format for the current time: 09:51:02. See `man 3 strftime`. 1519 | typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' 1520 | # If set to true, time will update when you hit enter. This way prompts for the past 1521 | # commands will contain the start times of their commands as opposed to the default 1522 | # behavior where they contain the end times of their preceding commands. 1523 | typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false 1524 | # Custom icon. 1525 | typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION= 1526 | # Custom prefix. 1527 | # typeset -g POWERLEVEL9K_TIME_PREFIX='%fat ' 1528 | 1529 | # Example of a user-defined prompt segment. Function prompt_example will be called on every 1530 | # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or 1531 | # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and green text greeting the user. 1532 | # 1533 | # Type `p10k help segment` for documentation and a more sophisticated example. 1534 | function prompt_example() { 1535 | p10k segment -f 2 -i '⭐' -t 'hello, %n' 1536 | } 1537 | 1538 | # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job 1539 | # is to generate the prompt segment for display in instant prompt. See 1540 | # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. 1541 | # 1542 | # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function 1543 | # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k 1544 | # will replay these calls without actually calling instant_prompt_*. It is imperative that 1545 | # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this 1546 | # rule is not observed, the content of instant prompt will be incorrect. 1547 | # 1548 | # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If 1549 | # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt. 1550 | function instant_prompt_example() { 1551 | # Since prompt_example always makes the same `p10k segment` calls, we can call it from 1552 | # instant_prompt_example. This will give us the same `example` prompt segment in the instant 1553 | # and regular prompts. 1554 | prompt_example 1555 | } 1556 | 1557 | # User-defined prompt segments can be customized the same way as built-in segments. 1558 | # typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=208 1559 | # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐' 1560 | 1561 | # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt 1562 | # when accepting a command line. Supported values: 1563 | # 1564 | # - off: Don't change prompt when accepting a command line. 1565 | # - always: Trim down prompt when accepting a command line. 1566 | # - same-dir: Trim down prompt when accepting a command line unless this is the first command 1567 | # typed after changing current working directory. 1568 | typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off 1569 | 1570 | # Instant prompt mode. 1571 | # 1572 | # - off: Disable instant prompt. Choose this if you've tried instant prompt and found 1573 | # it incompatible with your zsh configuration files. 1574 | # - quiet: Enable instant prompt and don't print warnings when detecting console output 1575 | # during zsh initialization. Choose this if you've read and understood 1576 | # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. 1577 | # - verbose: Enable instant prompt and print a warning when detecting console output during 1578 | # zsh initialization. Choose this if you've never tried instant prompt, haven't 1579 | # seen the warning, or if you are unsure what this all means. 1580 | typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose 1581 | 1582 | # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. 1583 | # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload 1584 | # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you 1585 | # really need it. 1586 | typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true 1587 | 1588 | # If p10k is already loaded, reload configuration. 1589 | # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. 1590 | (( ! $+functions[p10k] )) || p10k reload 1591 | } 1592 | 1593 | # Tell `p10k configure` which file it should overwrite. 1594 | typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} 1595 | 1596 | (( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} 1597 | 'builtin' 'unset' 'p10k_config_opts' 1598 | -------------------------------------------------------------------------------- /shell/.welcome.sh: -------------------------------------------------------------------------------- 1 | echo "Terminal Docker tools aliases:" 2 | echo " * alpine: launch an interactive alpine 3.20 container" 3 | -------------------------------------------------------------------------------- /shell/.zshrc: -------------------------------------------------------------------------------- 1 | ZSH=/root/.oh-my-zsh 2 | ZSH_CUSTOM=$ZSH/custom 3 | POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true 4 | ZSH_THEME="powerlevel10k/powerlevel10k" 5 | ENABLE_CORRECTION="false" 6 | COMPLETION_WAITING_DOTS="true" 7 | plugins=(vscode git colorize docker docker-compose) 8 | 9 | # TODO Ascii art 10 | 11 | [ -f ~/.ssh.sh ] && source ~/.ssh.sh 12 | 13 | # SSH directory check 14 | [ -d ~/.ssh ] || >&2 echo "[WARNING] No SSH directory found, SSH functionalities might not work" 15 | 16 | # Timezone check 17 | [ -z $TZ ] && >&2 echo "[WARNING] TZ environment variable not set, time might be wrong!" 18 | 19 | # Docker check 20 | test -S /var/run/docker.sock 21 | [ "$?" = 0 ] && DOCKERSOCK_OK=yes 22 | [ -z $DOCKERSOCK_OK ] && >&2 echo "[WARNING] Docker socket not found, docker will not be available" 23 | 24 | echo 25 | echo "Base version: $BASE_VERSION" 26 | where code &> /dev/null && echo "VS code server `code -v | head -n 1`" 27 | if [ ! -z $DOCKERSOCK_OK ]; then 28 | echo "Docker server `docker version --format {{.Server.Version}}` | client `docker version --format {{.Client.Version}}`" 29 | echo "Docker-Compose `docker compose version | cut -d' ' -f 4`" 30 | alias alpine='docker run -it --rm alpine:3.20' 31 | fi 32 | echo 33 | 34 | [ -f ~/.welcome.sh ] && source ~/.welcome.sh 35 | 36 | # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. 37 | # Initialization code that may require console input (password prompts, [y/n] 38 | # confirmations, etc.) must go above this block; everything else may go below. 39 | if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then 40 | source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" 41 | fi 42 | 43 | source $ZSH/oh-my-zsh.sh 44 | source ~/.p10k.zsh 45 | 46 | [ -f ~/.zshrc-specific.sh ] && source ~/.zshrc-specific 47 | -------------------------------------------------------------------------------- /title.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | --------------------------------------------------------------------------------