mirror of
https://github.com/Death916/nixconfig.git
synced 2026-04-10 02:54:39 -07:00
flox format
This commit is contained in:
parent
e6b055c6d9
commit
8e32cf51d2
1 changed files with 10 additions and 8 deletions
|
|
@ -100,17 +100,19 @@ in
|
|||
disabled = false;
|
||||
};
|
||||
|
||||
custom.flox_indicator = { # Renamed for a fresh attempt, just in case
|
||||
description = "Flox environment indicator";
|
||||
# Command: Only output if var exists. echo -n for no newline. Include trailing space.
|
||||
command = ''echo -n "via ❄️ $FLOX_PROMPT_ENVIRONMENTS "'';
|
||||
# When: Only run command if var exists and is non-empty.
|
||||
when = ''test -n "$FLOX_PROMPT_ENVIRONMENTS"'';
|
||||
format = "$output";
|
||||
custom.flox_status = { # Using a slightly different name again for a clean test
|
||||
description = "Shows current Flox environment status";
|
||||
# Command logic: if variable is set, echo "via text"; otherwise, echo an empty string.
|
||||
# echo -n prevents trailing newlines.
|
||||
# Ensure a trailing space in the "via..." string if desired.
|
||||
command = ''if [ -n "$FLOX_PROMPT_ENVIRONMENTS" ]; then echo -n "via ❄️ $FLOX_PROMPT_ENVIRONMENTS "; else echo -n ""; fi'';
|
||||
# NO 'when' CLAUSE HERE. The command itself handles the logic.
|
||||
format = "$output"; # Take the output of the command as is.
|
||||
shell = "bash";
|
||||
};
|
||||
|
||||
format = ''$directory $git_branch $conda$custom.flox_indicator$nix_shell$cmd_duration$status$character'';
|
||||
# Main format string, calling the custom module.
|
||||
format = ''$directory $git_branch $conda$custom.flox_status$nix_shell$cmd_duration$status$character'';
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue