diff --git a/home/dot_config/starship.toml b/home/dot_config/starship.toml index 29443d8..1df17b5 100644 --- a/home/dot_config/starship.toml +++ b/home/dot_config/starship.toml @@ -1,6 +1,6 @@ "$schema" = 'https://starship.rs/config-schema.json' -format = '$time$line_break$all$line_break$character' +format = '$time$custom$line_break$all$line_break$character' [cmd_duration] show_milliseconds = true @@ -60,6 +60,13 @@ style = 'yellow' threshold = 66 style = 'dimmed green' +[custom.chezmoi_diff] +description = 'Size of the current "chezmoi diff" output' +command = 'cat ~/.cache/chezmoi-diff-count' +when = 'test -s ~/.cache/chezmoi-diff-count' +symbol = '  ' +disabled = false + # The symbols below were produced by `starship preset nerd-font-symbols`, then moved to sections above, as needed. [aws] symbol = " " diff --git a/home/dot_config/systemd/user/chezmoi-diff.service b/home/dot_config/systemd/user/chezmoi-diff.service new file mode 100644 index 0000000..1edd807 --- /dev/null +++ b/home/dot_config/systemd/user/chezmoi-diff.service @@ -0,0 +1,6 @@ +[Unit] +Description=Record size of 'chezmoi diff' output + +[Service] +Type=oneshot +ExecStart=/bin/sh -c 'chezmoi diff | wc -l > ~/.cache/chezmoi-diff-count' diff --git a/home/dot_config/systemd/user/chezmoi-diff.timer b/home/dot_config/systemd/user/chezmoi-diff.timer new file mode 100644 index 0000000..e66eed4 --- /dev/null +++ b/home/dot_config/systemd/user/chezmoi-diff.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Periodically count chezmoi differences + +[Timer] +OnBootSec=5m +OnUnitInactiveSec=5m + +[Install] +WantedBy=timers.target diff --git a/home/dot_config/systemd/user/timers.target.wants/symlink_chezmoi-diff.timer b/home/dot_config/systemd/user/timers.target.wants/symlink_chezmoi-diff.timer new file mode 100644 index 0000000..fa5a2e1 --- /dev/null +++ b/home/dot_config/systemd/user/timers.target.wants/symlink_chezmoi-diff.timer @@ -0,0 +1 @@ +../chezmoi-diff.timer