Include toolbox name in status

Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
Matej Focko 2021-03-04 17:04:05 +01:00
parent c42953c551
commit f5a3e0a2ea
No known key found for this signature in database
GPG key ID: 8535F3BCF69B3D69
3 changed files with 18 additions and 0 deletions

View file

@ -30,3 +30,16 @@
template:
src: templates/starship.toml.j2
dest: ~/.config/starship.toml
- name: Create directories in `~/.local`
file:
path: "{{ item }}"
state: directory
loop:
- ~/.local/bin
- ~/.local/share
- name: Install script for toolbox name retrieval
template:
src: templates/scripts/toolbox_name.sh
dest: ~/.local/bin/toolbox_name.sh

View file

@ -0,0 +1,3 @@
#!/bin/bash
cat /run/.containerenv | grep -E '^name=' | sed -e 's/name=\"\(.*\)\"/\1/'

View file

@ -35,6 +35,8 @@ format = "[$path]($style)[$read_only]($read_only_style) "
[custom.toolbox]
when = "ls /run/.containerenv"
symbol = " "
command = "~/.local/bin/toolbox_name.sh"
format = "[$symbol($output )]($style)"
style = "bold purple"
[character]