diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2018-05-29 16:03:52 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2018-05-29 16:03:52 +0200 |
| commit | 670e0564dab62f5d6e9540162d55b63c907ce8de (patch) | |
| tree | 7de98b227997e9b66171ac6622b939353db98eac /config/fish/functions/alert.fish | |
| parent | bcce6c6c728488fcc97591ea4ee458dfef1d33fd (diff) | |
| download | dotfiles-670e0564dab62f5d6e9540162d55b63c907ce8de.tar.gz dotfiles-670e0564dab62f5d6e9540162d55b63c907ce8de.zip | |
[fish] Add loop option to alert and use alert in timer
Diffstat (limited to 'config/fish/functions/alert.fish')
| -rw-r--r-- | config/fish/functions/alert.fish | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/config/fish/functions/alert.fish b/config/fish/functions/alert.fish index 900dbd4..773877e 100644 --- a/config/fish/functions/alert.fish +++ b/config/fish/functions/alert.fish @@ -1,3 +1,20 @@ -function alert --description 'print and ring bell' - xkbbell; and echo -e \a +function alert --description 'print and ring bell' --argument loop + set usage "Usage: alert [-l | --loop]" + set cmd "xkbbell ^/dev/null; echo -n -e \a" + + if test -n "$loop"; and test "$loop" != "-l" -a "$loop" != "--loop"; or test (count $argv) -gt 1 + echo $usage >&2 + return 1 + else + eval $cmd + if test -n "$loop" + while true + for i in (seq 1 20) + alert + sleep 1 + end + sleep 1m + end + end + end end |
