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
|
||||
shellAliases = {
|
||||
ls = "exa --icons";
|
||||
cat = "bat";
|
||||
};
|
||||
# Custom configuration
|
||||
interactiveShellInit = ''
|
||||
# Setup any-nix-shell
|
||||
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
|
||||
programs.starship = {
|
||||
|
|
Loading…
Reference in New Issue