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
8e32cf51d2
commit
6ce71f6450
1 changed files with 9 additions and 10 deletions
|
|
@ -100,19 +100,18 @@ in
|
|||
disabled = false;
|
||||
};
|
||||
|
||||
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.
|
||||
custom.flox_env_text = { # Yet another fresh name
|
||||
description = "Displays Flox environment";
|
||||
# This command will ONLY run if 'when' is true.
|
||||
# It includes a trailing space.
|
||||
command = ''echo -n "via ❄️ $FLOX_PROMPT_ENVIRONMENTS "'';
|
||||
# The 'when' clause is the primary controller.
|
||||
when = ''test -n "$FLOX_PROMPT_ENVIRONMENTS"'';
|
||||
format = "$output";
|
||||
shell = "bash";
|
||||
};
|
||||
|
||||
# Main format string, calling the custom module.
|
||||
format = ''$directory $git_branch $conda$custom.flox_status$nix_shell$cmd_duration$status$character'';
|
||||
format = ''$directory $git_branch $conda$custom.flox_env_text$nix_shell$cmd_duration$status$character'';
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue