dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 9c0779e4fa817b7fb23d92de786157cc924f07d4
parent c2ecbf4d04c02ee172f4561b6d70738776ff3dd8
Author: Anders Damsgaard <andersd@riseup.net>
Date:   Tue, 30 Jan 2018 12:49:07 -0500

Use `open` or `xdg-open` depending on availability

Diffstat:
Mlinks/.zshrc | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/links/.zshrc b/links/.zshrc @@ -136,7 +136,13 @@ function forecast { curl --location \ 'http://f1.weather.gov/meteograms/Plotter.php?lat=40.3308&lon=-74.5647&wfo=PHI&zcode=NJZ012&gset=20&gdiff=10&unit=0&tinfo=EY5&ahour=0&pcmd=11011111111110100000000000000000000000000000000000000000000&lg=en&indu=3!1!1!&dd=&bw=&hrspan=48&pqpfhr=6&psnwhr=6'\ --output $tmpfile - open $tmpfile + if command -v open &>/dev/null; then + open $tmpfile + elif command -v xdg-open &>/dev/null; then + xdg-open $tmpfile + else + echo $tmpfile + fi } function define { curl --silent dict://dict.org/d:$1 } @@ -192,6 +198,7 @@ alias gs='git status | less' alias gl='git log --graph --oneline --decorate --all' alias ga='git add' alias gd='git diff --' +alias gch='git diff HEAD^..HEAD' alias gc='git commit --verbose --gpg-sign' alias gca='git commit --all --verbose --gpg-sign' alias gp='git push'