commit outputs can now be colored with a new script color-commit

This commit is contained in:
2024-11-17 13:03:49 -05:00
parent 76be210ec3
commit beedfd1be2
8 changed files with 66 additions and 14 deletions

View File

@@ -37,6 +37,7 @@ let
myScripts.switchmon
myScripts.git-compose
myScripts.playshellsound
myScripts.color-commit
];
in {
options = {

View File

@@ -6,7 +6,6 @@
shellAliases = {
grep = "grep --color=auto";
yazi = "y";
vi = "nvim";
mv = "mv -v";
cp = "cp -vr";
gt = "gtrash";

View File

@@ -2,6 +2,7 @@
let
shellsound = "${pkgs.myScripts.playshellsound}/bin/playshellsound";
color-commit = "${pkgs.myScripts.color-commit}/bin/color-commit";
sndpath = "${self}/assets/sound";
in
{
@@ -59,11 +60,14 @@ in
fi
}
gitcommit_sfx() {
if git commit "$@"; then
output=$(git commit "$@")
if [ -n "$output" ]; then
${shellsound} ${sndpath}/gitcommit.wav
echo "$output" | ${color-commit}
return 0
else
${shellsound} ${sndpath}/error.wav
echo "$output"
return 1
fi
}

View File

@@ -18,16 +18,16 @@
markEmptyLines = false;
stripLeadingSymbols = false;
};
extraConfig = {
color.diff = {
# meta = "black yellow bold";
# frag = "white blue bold";
old = "#A9B1D6 #301A1F";
new = "#A9B1D6 #12261E";
# plain = "normal";
# whitespace = "reverse red";
};
};
extraConfig = {
color.diff = {
# meta = "black yellow bold";
# frag = "white blue bold";
old = "#A9B1D6 #301A1F";
new = "#A9B1D6 #12261E";
# plain = "normal";
# whitespace = "reverse red";
};
};
};
};
}