Skip to content

Commit 34a98ea

Browse files
committed
Add support for OCI containers (podman)
This is an rootless alternative to docker container tool. It has a bunch of benefits. For more information see: https://podman.io/ The main reason why to have this support is `toolbox` tool which is used as a primary tool for development on immutable system (not-only) such as Fedora SilverBlue. The immutability of the system is replaced by creating containers for projects and work inside these containers. For more info see: https://docs.fedoraproject.org/en-US/fedora-silverblue/toolbox/ It's really nice to have this feature here because toolbox will use configuration of the system in the container as it is in host so it's pretty reasonable to use fish inside the container but know that I'm in the container right now.
1 parent 57d1728 commit 34a98ea

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ set -g theme_git_worktree_support yes
8080
set -g theme_use_abbreviated_branch_name yes
8181
set -g theme_display_vagrant yes
8282
set -g theme_display_docker_machine no
83+
set -g theme_display_oci_container no
8384
set -g theme_display_k8s_context yes
8485
set -g theme_display_hg yes
8586
set -g theme_display_virtualenv no
@@ -126,6 +127,7 @@ set -g theme_newline_prompt '$ '
126127
- `theme_display_ruby`. Use `no` to completely hide all information about Ruby version. By default Ruby version displayed if there is the difference from default settings.
127128
- `theme_display_nvm`. If set to `yes`, will display current NVM node version.
128129
- `theme_display_vagrant`. This feature is disabled by default, use `yes` to display Vagrant status in your prompt. Please note that only the VirtualBox and VMWare providers are supported.
130+
- `theme_display_oci_container`. This feature is disabled by default, use `yes` to display container management tool (`podman`) when you are in the oci supported container.
129131
- `theme_display_vi`. By default the vi mode indicator will be shown if vi or hybrid key bindings are enabled. Use `no` to hide the indicator, or `yes` to show the indicator.
130132
- `theme_display_k8s_context`. This feature is disabled by default. Use `yes` to show the current kubernetes context (`> kubectl config current-context`).
131133
- `theme_display_k8s_namespace`. This feature is disabled by default. Use `yes` to show the current kubernetes namespace.

fish_prompt.fish

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
# set -g theme_git_worktree_support yes
2929
# set -g theme_display_vagrant yes
3030
# set -g theme_display_docker_machine no
31+
# set -g theme_display_oci_container no
3132
# set -g theme_display_k8s_context yes
3233
# set -g theme_display_k8s_namespace no
3334
# set -g theme_display_aws_vault_profile yes
@@ -599,6 +600,14 @@ function __bobthefish_prompt_docker -S -d 'Display Docker machine name'
599600
echo -ns $DOCKER_MACHINE_NAME ' '
600601
end
601602

603+
function __bobthefish_prompt_oci_container -S -d 'Display oci container tool (podman)'
604+
[ "$theme_display_oci_container" = 'no' -o -z "$containers" ]
605+
and return
606+
607+
__bobthefish_start_segment $color_vagrant
608+
echo -ns $containers ' '
609+
end
610+
602611
function __bobthefish_k8s_context -S -d 'Get the current k8s context'
603612
set -l config_paths "$HOME/.kube/config"
604613
[ -n "$KUBECONFIG" ]
@@ -1113,6 +1122,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome'
11131122
# Containers and VMs
11141123
__bobthefish_prompt_vagrant
11151124
__bobthefish_prompt_docker
1125+
__bobthefish_prompt_oci_container
11161126
__bobthefish_prompt_k8s_context
11171127

11181128
# Cloud Tools

0 commit comments

Comments
 (0)