mirror of
https://github.com/Xevion/dotfiles.git
synced 2026-01-31 10:24:12 -06:00
add chlg, chcode warning for --watch w/o file
This commit is contained in:
@@ -32,9 +32,23 @@ function gi() { curl -sL https://www.toptal.com/developers/gitignore/api/$@ ;}
|
|||||||
|
|
||||||
function chcode() {
|
function chcode() {
|
||||||
EDITOR="code --wait"
|
EDITOR="code --wait"
|
||||||
|
# If no arguments are provided, the chezmoi directory is opened
|
||||||
|
if [[ "$@" == *"--watch"* ]]; then
|
||||||
|
for arg in "$@"; do
|
||||||
|
if [[ ! $arg == -* ]]; then
|
||||||
|
chezmoi edit $@
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "--watch requires a file to be provided, directories aren't supported with watch mode"
|
||||||
|
fi
|
||||||
chezmoi edit $@
|
chezmoi edit $@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function chlg() {
|
||||||
|
lazygit --path ~/.local/share/chezmoi
|
||||||
|
}
|
||||||
|
|
||||||
# Add an "alert" alias for long running commands. Use like so:
|
# Add an "alert" alias for long running commands. Use like so:
|
||||||
# sleep 10; alert
|
# sleep 10; alert
|
||||||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
||||||
|
|||||||
Reference in New Issue
Block a user