Add logger function to fish config
This commit is contained in:
parent
0ce999c076
commit
c41b346b6f
13
home.nix
13
home.nix
|
@ -24,12 +24,25 @@
|
||||||
# Setup our aliases
|
# Setup our aliases
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
ls = "exa --icons";
|
ls = "exa --icons";
|
||||||
|
cat = "bat";
|
||||||
};
|
};
|
||||||
# Custom configuration
|
# Custom configuration
|
||||||
interactiveShellInit = ''
|
interactiveShellInit = ''
|
||||||
# Setup any-nix-shell
|
# Setup any-nix-shell
|
||||||
any-nix-shell fish --info-right | source
|
any-nix-shell fish --info-right | source
|
||||||
|
# Load logger function
|
||||||
|
source ~/.config/fish/functions/cmdlogger.fish
|
||||||
'';
|
'';
|
||||||
|
functions = {
|
||||||
|
# Setup command logging to ~/.logs
|
||||||
|
cmdlogger = {
|
||||||
|
onEvent = "fish_preexec";
|
||||||
|
body = ''
|
||||||
|
mkdir -p ~/.logs
|
||||||
|
echo (date -u +"%Y-%m-%dT%H:%M:%SZ")" "(echo %self)" "(pwd)": "$argv >> ~/.logs/(hostname)-(date "+%Y-%m-%d").log
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
# Starship, for the prompt
|
# Starship, for the prompt
|
||||||
programs.starship = {
|
programs.starship = {
|
||||||
|
|
Loading…
Reference in New Issue