nix/home-manager/config/shell/starship.nix

214 lines
No EOL
7.3 KiB
Nix

{ ... }: {
# Shell prompt
programs.starship = {
enable = true;
enableZshIntegration = true;
settings = {
add_newline = true;
format = ""
# Left powerline
+ "[](fg:242)[](fg:238)"
+ "$os"
+ "[ ](fg:007 bg:prev_bg)"
+ "[$username@$hostname](bg:prev_bg)"
+ "[ ](fg:007 bg:prev_bg)"
+ "$shell$shlvl"
+ "[ ](fg:007 bg:prev_bg)"
+ "$directory"
+ "[ ](bg:prev_bg)[](fg:prev_bg bg:none)"
# Middle filling
+ "$fill"
# Right powerline
+ "[](fg:238 bg:none)[ ](bg:prev_fg)"
+ "\${custom.status}"
+ "\${custom.time}"
+ "[ ](fg:007 bg:prev_bg)"
+ "\${custom.date}"
+ "[ ](fg:007 bg:prev_bg)"
+ "$battery"
+ "[](fg:prev_bg)[ ](fg:242)"
# Left prompter
+ "\n[ ](fg:242)";
# Right prompter
right_format = "[ ](fg:242)";
os = {
disabled = false;
style = "bg:238 fg:007";
symbols = {
Arch = "󰣇";
Ubuntu = "󰕈";
NixOS = "󱄅";
};
};
username = {
disabled = false;
format = "[$user]($style)";
style_user = "bg:prev_bg fg:#63D0EE bold";
style_root = "bg:prev_bg fg:#EFA9B1 bold";
show_always = true;
};
hostname = {
disabled = false;
ssh_only = false;
trim_at = "";
style = "bg:prev_bg fg:prev_fg";
format = "[$hostname]($style)";
};
shell = {
disabled = false;
format = "[$indicator]($style)";
style = "fg:#FFFFFF bg:prev_bg";
};
shlvl = {
disabled = false;
threshold = 2;
symbol = "";
repeat = false;
format = "[ \\(](bg:prev_bg fg:#FFFFFF)[$symbol$shlvl]($style)[\\)](bg:prev_bg fg:#FFFFFF)";
style = "bg:prev_bg fg:#F5F543";
};
directory = {
disabled = false;
home_symbol = "~";
read_only = " ";
truncate_to_repo = true;
use_logical_path = true;
fish_style_pwd_dir_length = 1;
truncation_length = 3;
style = "bold fg:#63D0EE bg:prev_bg";
read_only_style = "bold fg:#63D0EE bg:prev_bg";
format = "[$read_only]($read_only_style)[$path]($style)";
repo_root_format = "[$read_only]($read_only_style)[$before_root_path]($before_repo_root_style)[$repo_root]($repo_root_style)[$path]($style)";
};
# [status]
# disabled = false
# recognize_signal_code = false
# map_symbol = false
# success_symbol = "✔"
# symbol = "✘"
# # TODO Figure out status-dependent styling
# style = "bold fg:#26FF05 bg:prev_bg"
# format = "[$status $symbol]($style)"
custom.status = {
disabled = false;
when = ''test "$?" -ne 0'';
command = ''echo "$?"'';
style = "bg:238 fg:#EFA9B1";
symbol = "";
format = "[$output $symbol]($style)";
};
custom.time = {
disabled = false;
when = true;
command = ''date +"%I:%M:%S"'';
description = "The current local time";
style = "bg:238 fg:#63D0EE bold";
format = "[$output]($style)";
};
custom.date = {
disabled = false;
when = true;
command = ''date +"%b %-d %Y"'';
description = "The current local date";
style = "bg:238 fg:#E5B9E9 bold";
format = "[$output]($style)";
};
battery = {
disabled = false;
format = "[$symbol$percentage ]($style)";
display = [
{
threshold = 10;
discharging_symbol = "󰂃 ";
charging_symbol = "󰂄 ";
style = "bold fg:#EFA9B1 bg:prev_bg";
}
{
threshold = 20;
discharging_symbol = "󰁻 ";
charging_symbol = "󰂄 ";
style = "bold fg:#FF9933 bg:prev_bg";
}
{
threshold = 30;
discharging_symbol = "󰁼 ";
charging_symbol = "󰂄 ";
style = "bold fg:#FF9933 bg:prev_bg";
}
{
threshold = 40;
discharging_symbol = "󰁽 ";
charging_symbol = "󰂄 ";
style = "bold fg:#F8E45C bg:prev_bg";
}
{
threshold = 50;
discharging_symbol = "󰁾 ";
charging_symbol = "󰂄 ";
style = "bold fg:#F8E45C bg:prev_bg";
}
{
threshold = 60;
discharging_symbol = "󰁿 ";
charging_symbol = "󰂄 ";
style = "bold fg:#FFFFFF bg:prev_bg";
}
{
threshold = 70;
discharging_symbol = "󰂀 ";
charging_symbol = "󰂄 ";
style = "bold fg:#FFFFFF bg:prev_bg";
}
{
threshold = 75;
discharging_symbol = "󰂀 ";
charging_symbol = "󰂄 ";
style = "bold fg:green bg:prev_bg";
}
{
threshold = 80;
discharging_symbol = "󰂁 ";
charging_symbol = "󰂄 ";
style = "bold fg:green bg:prev_bg";
}
{
threshold = 97;
discharging_symbol = "󰁹 ";
charging_symbol = "󰂄 ";
style = "bold fg:green bg:prev_bg";
}
{
threshold = 100;
discharging_symbol = "󰁹 ";
charging_symbol = "󰂄 ";
style = "bold fg:green bg:prev_bg";
}
];
};
fill = {
disabled = false;
style = "fg:242";
symbol = "";
};
};
};
}