Add zsh/oh my zsh/w10k
This commit is contained in:
1
zsh/.oh-my-zsh/plugins/chucknorris/.gitignore
vendored
Normal file
1
zsh/.oh-my-zsh/plugins/chucknorris/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
fortunes/chucknorris.dat
|
20
zsh/.oh-my-zsh/plugins/chucknorris/README.md
Normal file
20
zsh/.oh-my-zsh/plugins/chucknorris/README.md
Normal file
@ -0,0 +1,20 @@
|
||||
# chucknorris
|
||||
|
||||
Chuck Norris fortunes plugin for oh-my-zsh
|
||||
|
||||
**Maintainers**: [apjanke](https://github.com/apjanke) [maff](https://github.com/maff)
|
||||
|
||||
To use it add `chucknorris` to the plugins array in you zshrc file.
|
||||
|
||||
```zsh
|
||||
plugins=(... chucknorris)
|
||||
```
|
||||
|
||||
|
||||
Depends on fortune (and cowsay if using chuck_cow) being installed (available via homebrew, apt, ...). Perfectly suitable as MOTD.
|
||||
|
||||
|
||||
| Command | Description |
|
||||
| ----------- | ------------------------------- |
|
||||
| `chuck` | Print random Chuck Norris quote |
|
||||
| `chuck_cow` | Print quote in cowthink |
|
28
zsh/.oh-my-zsh/plugins/chucknorris/chucknorris.plugin.zsh
Normal file
28
zsh/.oh-my-zsh/plugins/chucknorris/chucknorris.plugin.zsh
Normal file
@ -0,0 +1,28 @@
|
||||
# chucknorris: Chuck Norris fortunes
|
||||
|
||||
# Automatically generate or update Chuck's compiled fortune data file
|
||||
# $0 must be used outside a local function. This variable name is unlikly to collide.
|
||||
CHUCKNORRIS_PLUGIN_DIR=${0:h}
|
||||
|
||||
() {
|
||||
local DIR=$CHUCKNORRIS_PLUGIN_DIR/fortunes
|
||||
if [[ ! -f $DIR/chucknorris.dat ]] || [[ $DIR/chucknorris.dat -ot $DIR/chucknorris ]]; then
|
||||
# For some reason, Cygwin puts strfile in /usr/sbin, which is not on the path by default
|
||||
local strfile=strfile
|
||||
if ! which strfile &>/dev/null && [[ -f /usr/sbin/strfile ]]; then
|
||||
strfile=/usr/sbin/strfile
|
||||
fi
|
||||
if which $strfile &> /dev/null; then
|
||||
$strfile $DIR/chucknorris $DIR/chucknorris.dat >/dev/null
|
||||
else
|
||||
echo "[oh-my-zsh] chucknorris depends on strfile, which is not installed" >&2
|
||||
echo "[oh-my-zsh] strfile is often provided as part of the 'fortune' package" >&2
|
||||
fi
|
||||
fi
|
||||
|
||||
# Aliases
|
||||
alias chuck="fortune -a $DIR"
|
||||
alias chuck_cow="chuck | cowthink"
|
||||
}
|
||||
|
||||
unset CHUCKNORRIS_PLUGIN_DIR
|
2544
zsh/.oh-my-zsh/plugins/chucknorris/fortunes/chucknorris
Normal file
2544
zsh/.oh-my-zsh/plugins/chucknorris/fortunes/chucknorris
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user