updated git aliases in zshell.nix
This commit is contained in:
BIN
assets/sound/gitrebase.wav
Normal file
BIN
assets/sound/gitrebase.wav
Normal file
Binary file not shown.
@@ -41,7 +41,7 @@
|
|||||||
mv = "mv -v";
|
mv = "mv -v";
|
||||||
cp = "cp -vr";
|
cp = "cp -vr";
|
||||||
gt = "gtrash";
|
gt = "gtrash";
|
||||||
gtp = "scheck && runbg aplay ${self}/assets/sound/rm.wav; gtrash put";
|
gtp = "playshellsound ${self}/assets/sound/rm.wav; gtrash put";
|
||||||
grub-update = "sudo grub-mkconfig -o /boot/grub/grub.cfg";
|
grub-update = "sudo grub-mkconfig -o /boot/grub/grub.cfg";
|
||||||
sr = "source ~/.zshrc";
|
sr = "source ~/.zshrc";
|
||||||
".." = "cd ..";
|
".." = "cd ..";
|
||||||
@@ -55,20 +55,64 @@
|
|||||||
viflake = "nvim flake.nix";
|
viflake = "nvim flake.nix";
|
||||||
|
|
||||||
#git
|
#git
|
||||||
"ga." = "scheck && runbg aplay ${self}/assets/sound/gitadd.wav; git add .";
|
"ga" = "playshellsound ${self}/assets/sound/gitadd.wav; git add";
|
||||||
gcm = "gitcommit_sfx";
|
gcomm = "gitcommit_sfx";
|
||||||
gpush = " git push && scheck && runbg aplay ${self}/assets/sound/gitpush.wav;";
|
gpush = "gitpush_sfx";
|
||||||
gpull = " git pull && scheck && runbg aplay ${self}/assets/sound/gitpull.wav;";
|
gpull = "gitpull_sfx";
|
||||||
|
greb = "gitrebase_sfx";
|
||||||
};
|
};
|
||||||
initExtra = ''
|
initExtra = ''
|
||||||
|
playshellsound() {
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
echo "Usage: playshellsound <path/to/sound>"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if ! scheck; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
runbg aplay "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
gitrebase_sfx() {
|
||||||
|
if git rebase "$@"; then
|
||||||
|
playshellsound ${self}/assets/sound/gitrebase.wav
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
playshellsound ${self}/assets/sound/error.wav
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
gitcommit_sfx() {
|
gitcommit_sfx() {
|
||||||
git commit -m "$1"
|
if git commit "$@"; then
|
||||||
scheck && runbg aplay ${self}/assets/sound/gitcommit.wav
|
playshellsound ${self}/assets/sound/gitcommit.wav
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
playshellsound ${self}/assets/sound/error.wav
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
gitpush_sfx() {
|
||||||
|
if git push "$@"; then
|
||||||
|
playshellsound ${self}/assets/sound/gitpush.wav
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
playshellsound ${self}/assets/sound/error.wav
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
gitpull_sfx() {
|
||||||
|
if git pull "$@"; then
|
||||||
|
playshellsound ${self}/assets/sound/gitpull.wav
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
playshellsound ${self}/assets/sound/error.wav
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
unalias ls
|
unalias ls
|
||||||
ls() {
|
ls() {
|
||||||
eza -1 --group-directories-first --icons "$@"
|
eza -1 --group-directories-first --icons "$@"
|
||||||
scheck && runbg aplay ${self}/assets/sound/ls.wav
|
playshellsound ${self}/assets/sound/ls.wav
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,7 +131,7 @@
|
|||||||
eza -1 --group-directories-first --icons "$@"
|
eza -1 --group-directories-first --icons "$@"
|
||||||
SOUNDS_ENABLED=$prev_sounds_enabled
|
SOUNDS_ENABLED=$prev_sounds_enabled
|
||||||
builtin cd "$@"
|
builtin cd "$@"
|
||||||
scheck && runbg aplay /nix/store/7a9w7np3qrvmzxjbs7xj05qq2yccgfsj-source/assets/sound/cd.wav
|
playshellsound /nix/store/7a9w7np3qrvmzxjbs7xj05qq2yccgfsj-source/assets/sound/cd.wav
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
if [ ! -e $HOME/.zsh_history ]; then
|
if [ ! -e $HOME/.zsh_history ]; then
|
||||||
@@ -134,7 +178,7 @@
|
|||||||
unalias ls
|
unalias ls
|
||||||
clear
|
clear
|
||||||
splash
|
splash
|
||||||
scheck && runbg aplay ${self}/assets/sound/sh-source.wav
|
playshellsound ${self}/assets/sound/sh-source.wav
|
||||||
[ ! -f $FLAKEPATH/flake.nix ] && echo "WARNING: flake.nix not found at \$FLAKEPATH. Shell aliases for editing config files won't work correctly!" && echo "Edit the FLAKEPATH session variable in zshell.nix to point to the path where you saved the system configuration flake."
|
[ ! -f $FLAKEPATH/flake.nix ] && echo "WARNING: flake.nix not found at \$FLAKEPATH. Shell aliases for editing config files won't work correctly!" && echo "Edit the FLAKEPATH session variable in zshell.nix to point to the path where you saved the system configuration flake."
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user