From 9d0ec25753e74cf56fbc0a7b831fc506a2bb3147 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 19 Jul 2012 04:06:56 +0200 Subject: updating readme with ponyquotes --- README | 17 ++++++++++++++++- README.md | 10 ++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/README b/README index 24b11b3..efd6721 100644 --- a/README +++ b/README @@ -35,7 +35,9 @@ Required runtime dependencies Optional runtime dependencies ============================= - (none) + ponyquotes4ponysay : for support of My Little Pony quotes with associated pony + -- Available for Arch:ers in AUR (https://aur.archlinux.org/packages.php?ID=60988) + -- and on github at https://github.com/maandree/ponyquotes4ponysay Package building dependencies @@ -110,6 +112,19 @@ Pony fortune on terminal startup https://aur.archlinux.org/packages.php?ID=60229 +Pony quotes +=========== + +Installing ponyquotes4ponysay will enable My Little Pony quotes with associated pony. +It is available at: https://github.com/maandree/ponyquotes4ponysay + https://aur.archlinux.org/packages.php?ID=60988 + +Run `ponysay -q` will give you a random pony saying one it its quote from MLP:FiM. +Add one or more argument after `-q` to sepcify a set of ponies from which one will be selected randomly. + +When running `ponysay -l` or `ponysay -L` the ponies which have quotes will be printed bold or bright (depending on terminal + + Ponies in TTY (Linux VT) ======================== diff --git a/README.md b/README.md index 6cf3e0a..bc9bf7a 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,16 @@ Edit your `~/.bashrc` and add this to the end of the file Now every time you open a terminal a pony should give your fortune +### Pony quotes + +Installing [ponyquotes4ponysay](https://github.com/maandree/ponyquotes4ponysay) will enable My Little Pony quotes with associated pony. + +Run `ponysay -q` will give you a random pony saying one it its quote from MLP:FiM. Add one or more argument after `-q` to sepcify a +set of ponies from which one will be selected randomly. + +When running `ponysay -l` or `ponysay -L` the ponies which have quotes will be printed bold or bright (depending on terminal). + + ### Ponies in TTY (Linux VT) If you have a custom colour palette edit your `~/.bashrc` and add -- cgit From f6c9058590d1ce018f37e5f63bcf5d66b093250f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 19 Jul 2012 04:32:35 +0200 Subject: bash completion dependency reduction and update --- completion/bash-completion.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/completion/bash-completion.sh b/completion/bash-completion.sh index 82eb608..e119834 100644 --- a/completion/bash-completion.sh +++ b/completion/bash-completion.sh @@ -5,7 +5,13 @@ _ponysay() local cur prev words cword _init_completion -n = || return - COMPREPLY=( $( compgen -W '-v -h -l -f -W' -- "$cur" ) ) + quotes=$(pq4ps --list 2>/dev/null) + quotesexit=$? + options='-v -h -l -f -W' + if [[ $quotesexit = 0 ]]; then + options="$options -q" + fi + COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) if [[ $prev = "-f" ]]; then COMPREPLY=() @@ -24,8 +30,10 @@ _ponysay() COMPREPLY+=( $( compgen -W "$(ls --color=no $usrponies | sed -e 's/.pony//g')" -- "$cur" ) ) fi elif [[ $prev = "-W" ]]; then - cols=$( echo `tput cols` - 10 | bc ) - COMPREPLY=( $cols $( echo $cols / 2 | bc ) 100 60 ) + cols=$(( `stty size | cut -d ' ' -f 2` - 10 )) + COMPREPLY=( $cols $(( $cols / 2 )) 100 60 ) + elif [[ $quotesexit = 0 ]] && [[ $prev = "-q" ]]; then + COMPREPLY=( $( compgen -W "$quotes" -- "$cur" ) ) fi } -- cgit From 9f4d6caa242bde287db756818475f0eecac70cee Mon Sep 17 00:00:00 2001 From: Elis Axelsson Date: Thu, 19 Jul 2012 13:41:05 +0200 Subject: Move homeponies to .config/ponysay/ --- ponysay | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ponysay b/ponysay index 8c85356..72ce73a 100755 --- a/ponysay +++ b/ponysay @@ -2,13 +2,13 @@ version=1.0 SYSTEMPONIES="/usr/share/ponysay/ponies" -HOMEPONIES="${HOME}/.ponysay/ponies" +HOMEPONIES="${HOME}/.config/ponysay/ponies" pony="*" wrap="" if [ "$TERM" = "linux" ]; then SYSTEMPONIES="/usr/share/ponysay/ttyponies" - HOMEPONIES="${HOME}/.ponysay/ttyponies" + HOMEPONIES="${HOME}/.config/ponysay/ttyponies" fi cmd=cowsay -- cgit From 9bf70d36d15bc013c3f49df9ab36cb69f05e043c Mon Sep 17 00:00:00 2001 From: Elis Axelsson Date: Thu, 19 Jul 2012 13:42:09 +0200 Subject: Don't use $0 as base for ponysaylist, if you use ponythink it would result in ponythinklist which doesn't exist --- ponysay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ponysay b/ponysay index 72ce73a..62036ae 100755 --- a/ponysay +++ b/ponysay @@ -19,7 +19,7 @@ version() { } scrw=`(stty size <&2 || echo 0 0) | cut -d ' ' -f 2` -listcmd="$0list.pl" +listcmd="ponysaylist.pl" haspq=1 if [[ -f './pq4ps-list' ]]; then -- cgit From 84d2a44352f7bd84d2467c2d3ee2e667c0558437 Mon Sep 17 00:00:00 2001 From: Elis Axelsson Date: Thu, 19 Jul 2012 13:42:46 +0200 Subject: I also got a lastname :) --- CREDITS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CREDITS b/CREDITS index 1b13a7e..4134678 100644 --- a/CREDITS +++ b/CREDITS @@ -7,10 +7,10 @@ Sven-Hendrik Haase Jan Alexander Steffens # Patchers and other contributors +Elis Axelsson Duane Bekaert Pablo Lezaeta Kyah Rindlisbacher James Ross-Gowan Louis Taylor -Elis Jannis -- cgit From d6c360277f04fce578447ca73437a30640dfe98e Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 19 Jul 2012 13:53:21 +0200 Subject: .local/share instead of .config --- ponysay | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ponysay b/ponysay index 62036ae..1bb76c1 100755 --- a/ponysay +++ b/ponysay @@ -2,13 +2,13 @@ version=1.0 SYSTEMPONIES="/usr/share/ponysay/ponies" -HOMEPONIES="${HOME}/.config/ponysay/ponies" +HOMEPONIES="${HOME}/.local/share/ponysay/ponies" pony="*" wrap="" if [ "$TERM" = "linux" ]; then SYSTEMPONIES="/usr/share/ponysay/ttyponies" - HOMEPONIES="${HOME}/.config/ponysay/ttyponies" + HOMEPONIES="${HOME}/.local/share/ponysay/ttyponies" fi cmd=cowsay -- cgit From bae75d95b6ce3af5ac16284a6079ba0feb65cf0b Mon Sep 17 00:00:00 2001 From: Elis Axelsson Date: Thu, 19 Jul 2012 14:56:43 +0200 Subject: Added completions for the fish and fishfish(a fork of fish) shell --- Makefile | 4 ++++ completion/fish_ponysay.fish | 24 ++++++++++++++++++++++++ completion/fish_ponythink.fish | 24 ++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 completion/fish_ponysay.fish create mode 100644 completion/fish_ponythink.fish diff --git a/Makefile b/Makefile index 8e8c52b..860d132 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,10 @@ install: all install "ponysaylist.pl" "$(DESTDIR)/usr/bin/ponysaylist.pl" ln -sf "ponysay" "$(DESTDIR)/usr/bin/ponythink" + mkdir -p "$(DESTDIR)/usr/share/fish/completions/" + install -m "644" "completion/fish_ponysay.fish" "$(DESTDIR)/usr/share/fish/completions/ponysay.fish" + install -m "644" "completion/fish_ponythink.fish" "$(DESTDIR)/usr/share/fish/completions/ponythink.fish" + mkdir -p "$(DESTDIR)/usr/share/zsh/site-functions/" install "completion/zsh-completion.zsh" "$(DESTDIR)/usr/share/zsh/site-functions/_ponysay" diff --git a/completion/fish_ponysay.fish b/completion/fish_ponysay.fish new file mode 100644 index 0000000..f0c73a2 --- /dev/null +++ b/completion/fish_ponysay.fish @@ -0,0 +1,24 @@ + +# Completions for ponysay & ponythink +# https://github.com/erkin/ponysay/ +# +# Author: Elis Axelsson + + +if test -d /usr/share/ponysay/ponies/ + set -g systemponies (ls /usr/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from \/usr\/share\/ponysay\/ponies\//') +end + +if test -d ~/.local/share/ponysay/ponies/ + set -g homeponies (ls ~/.local/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from ~\/.local\/share\/ponysay\/ponies\//') +end + +complete -c ponysay -s h --description "Help of ponysay" +complete -c ponysay -s v --description "Version of ponysay" +complete -c ponysay -s l --description "List pony files" +complete -c ponysay -s f -a "$systemponies $homeponies" --description "Select a pony, either a filename or pony name" +complete -c ponysay -s W -a "Integer" --description "The screen column where the message should be wrapped" + +set -e systemponies +set -e homeponies + diff --git a/completion/fish_ponythink.fish b/completion/fish_ponythink.fish new file mode 100644 index 0000000..928b72e --- /dev/null +++ b/completion/fish_ponythink.fish @@ -0,0 +1,24 @@ + +# Completions for ponysay & ponythink +# https://github.com/erkin/ponysay/ +# +# Author: Elis Axelsson + + +if test -d /usr/share/ponysay/ponies/ + set -g systemponies (ls /usr/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from \/usr\/share\/ponysay\/ponies\//') +end + +if test -d ~/.local/share/ponysay/ponies/ + set -g homeponies (ls ~/.local/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from ~\/.local\/share\/ponysay\/ponies\//') +end + +complete -c ponythink -s h --description "Help of ponythink" +complete -c ponythink -s v --description "Version of ponythink" +complete -c ponythink -s l --description "List pony files" +complete -c ponythink -s f -a "$systemponies $homeponies" --description "Select a pony, either a filename or pony name" +complete -c ponythink -s W -a "Integer" --description "The screen column where the message should be wrapped" + +set -e systemponies +set -e homeponies + -- cgit From 5f672bb9f76f0c37563202cfd9ed9755633a7050 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 19 Jul 2012 18:26:19 +0200 Subject: m manuals --- completion/bash-completion.sh | 4 ++-- completion/fish_ponysay.fish | 4 ++-- completion/fish_ponythink.fish | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/completion/bash-completion.sh b/completion/bash-completion.sh index e119834..53c53ef 100644 --- a/completion/bash-completion.sh +++ b/completion/bash-completion.sh @@ -17,10 +17,10 @@ _ponysay() COMPREPLY=() sysponies=/usr/share/ponysay/ponies/ - usrponies=~/.ponies/ + usrponies=~/.local/share/ponysay/ponies/ if [[ $TERM = "linux" ]]; then sysponies=/usr/share/ponysay/ttyponies/ - usrponies=~/.ttyponies/ + usrponies=~/.local/share/ponysay/ttyponies/ fi if [[ -d $sysponies ]]; then diff --git a/completion/fish_ponysay.fish b/completion/fish_ponysay.fish index f0c73a2..ea98382 100644 --- a/completion/fish_ponysay.fish +++ b/completion/fish_ponysay.fish @@ -6,11 +6,11 @@ if test -d /usr/share/ponysay/ponies/ - set -g systemponies (ls /usr/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from \/usr\/share\/ponysay\/ponies\//') + set -g systemponies (ls --color=no /usr/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from \/usr\/share\/ponysay\/ponies\//') end if test -d ~/.local/share/ponysay/ponies/ - set -g homeponies (ls ~/.local/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from ~\/.local\/share\/ponysay\/ponies\//') + set -g homeponies (ls --color=no ~/.local/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from ~\/.local\/share\/ponysay\/ponies\//') end complete -c ponysay -s h --description "Help of ponysay" diff --git a/completion/fish_ponythink.fish b/completion/fish_ponythink.fish index 928b72e..24391ce 100644 --- a/completion/fish_ponythink.fish +++ b/completion/fish_ponythink.fish @@ -6,11 +6,11 @@ if test -d /usr/share/ponysay/ponies/ - set -g systemponies (ls /usr/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from \/usr\/share\/ponysay\/ponies\//') + set -g systemponies (ls --color=no /usr/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from \/usr\/share\/ponysay\/ponies\//') end if test -d ~/.local/share/ponysay/ponies/ - set -g homeponies (ls ~/.local/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from ~\/.local\/share\/ponysay\/ponies\//') + set -g homeponies (ls --color=no ~/.local/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from ~\/.local\/share\/ponysay\/ponies\//') end complete -c ponythink -s h --description "Help of ponythink" -- cgit From 839f0b20e8e4982da6a152bd6d702b699d352324 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 19 Jul 2012 18:43:33 +0200 Subject: autogeneration of ponythink shell completions from ponysay completions --- Makefile | 33 ++++++++++++++++++++++++--------- completion/fish-completion.fish | 24 ++++++++++++++++++++++++ completion/fish_ponysay.fish | 24 ------------------------ completion/fish_ponythink.fish | 24 ------------------------ 4 files changed, 48 insertions(+), 57 deletions(-) create mode 100644 completion/fish-completion.fish delete mode 100644 completion/fish_ponysay.fish delete mode 100644 completion/fish_ponythink.fish diff --git a/Makefile b/Makefile index 860d132..37883a6 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -all: ponysaytruncater manpages +all: ponysaytruncater manpages ponythinkcompletion ponysaytruncater: @@ -10,6 +10,12 @@ manpages: gzip -9 < manuals/manpage.es.6 > manuals/manpage.es.6.gz +ponythinkcompletion: + sed -e 's/ponysay/ponythink/g' <"completion/bash-completion.sh" | sed -e 's/\/ponythink\//\/ponysay\//g' -e 's/\\\/ponythink\\\//\\\/ponysay\\\//g' >"completion/bash-completion-think.sh" + sed -e 's/ponysay/ponythink/g' <"completion/fish-completion.fish" | sed -e 's/\/ponythink\//\/ponysay\//g' -e 's/\\\/ponythink\\\//\\\/ponysay\\\//g' >"completion/fish-completion-think.fish" + sed -e 's/ponysay/ponythink/g' <"completion/zsh-completion.zsh" | sed -e 's/\/ponythink\//\/ponysay\//g' -e 's/\\\/ponythink\\\//\\\/ponysay\\\//g' >"completion/zsh-completion-think.zsh" + + ttyponies: mkdir -p ttyponies for pony in $$(ls --color=no ponies/); do \ @@ -35,15 +41,17 @@ install: all install "ponysaylist.pl" "$(DESTDIR)/usr/bin/ponysaylist.pl" ln -sf "ponysay" "$(DESTDIR)/usr/bin/ponythink" + mkdir -p "$(DESTDIR)/usr/share/bash-completion/completions/" + install "completion/bash-completion.sh" "$(DESTDIR)/usr/share/bash-completion/completions/ponysay" + install "completion/bash-completion-think.sh" "$(DESTDIR)/usr/share/bash-completion/completions/ponythink" + mkdir -p "$(DESTDIR)/usr/share/fish/completions/" - install -m "644" "completion/fish_ponysay.fish" "$(DESTDIR)/usr/share/fish/completions/ponysay.fish" - install -m "644" "completion/fish_ponythink.fish" "$(DESTDIR)/usr/share/fish/completions/ponythink.fish" + install "completion/fish-completion.fish" "$(DESTDIR)/usr/share/fish/completions/ponysay.fish" + install "completion/fish-completion-think.fish" "$(DESTDIR)/usr/share/fish/completions/ponythink.fish" mkdir -p "$(DESTDIR)/usr/share/zsh/site-functions/" install "completion/zsh-completion.zsh" "$(DESTDIR)/usr/share/zsh/site-functions/_ponysay" - - mkdir -p "$(DESTDIR)/usr/share/bash-completion/completions/" - install "completion/bash-completion.sh" "$(DESTDIR)/usr/share/bash-completion/completions/ponysay" + install "completion/zsh-completion-think.zsh" "$(DESTDIR)/usr/share/zsh/site-functions/_ponythink" mkdir -p "$(DESTDIR)/usr/share/licenses/ponysay/" install "COPYING" "$(DESTDIR)/usr/share/licenses/ponysay/COPYING" @@ -82,9 +90,13 @@ uninstall: unlink "$(DESTDIR)/usr/bin/ponysaylist.pl" unlink "$(DESTDIR)/usr/bin/ponysaytruncater" unlink "$(DESTDIR)/usr/bin/ponythink" - unlink "$(DESTDIR)/usr/share/zsh/site-functions/_ponysay"; unlink "$(DESTDIR)/usr/share/licenses/ponysay/COPYING" unlink "$(DESTDIR)/usr/share/bash-completion/completions/ponysay" + unlink "$(DESTDIR)/usr/share/bash-completion/completions/ponythink" + unlink "$(DESTDIR)/usr/share/fish/completions/ponysay.fish" + unlink "$(DESTDIR)/usr/share/fish/completions/ponythink.fish" + unlink "$(DESTDIR)/usr/share/zsh/site-functions/_ponysay"; + unlink "$(DESTDIR)/usr/share/zsh/site-functions/_ponythink"; unlink "$(DESTDIR)/usr/share/man/man6/ponysay.6.gz" unlink "$(DESTDIR)/usr/share/man/man6/ponythink.6.gz" unlink "$(DESTDIR)/usr/share/man/es/man6/ponysay.6.gz" @@ -93,6 +105,9 @@ uninstall: clean: rm -f "ponysaytruncater" - rm manuals/manpage.6.gz - rm manuals/manpage.es.6.gz + rm "completion/bash-completion-think.sh" + rm "completion/fish-completion-think.fish" + rm "completion/zsh-completion-think.zsh" + rm "manuals/manpage.6.gz" + rm "manuals/manpage.es.6.gz" diff --git a/completion/fish-completion.fish b/completion/fish-completion.fish new file mode 100644 index 0000000..ea98382 --- /dev/null +++ b/completion/fish-completion.fish @@ -0,0 +1,24 @@ + +# Completions for ponysay & ponythink +# https://github.com/erkin/ponysay/ +# +# Author: Elis Axelsson + + +if test -d /usr/share/ponysay/ponies/ + set -g systemponies (ls --color=no /usr/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from \/usr\/share\/ponysay\/ponies\//') +end + +if test -d ~/.local/share/ponysay/ponies/ + set -g homeponies (ls --color=no ~/.local/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from ~\/.local\/share\/ponysay\/ponies\//') +end + +complete -c ponysay -s h --description "Help of ponysay" +complete -c ponysay -s v --description "Version of ponysay" +complete -c ponysay -s l --description "List pony files" +complete -c ponysay -s f -a "$systemponies $homeponies" --description "Select a pony, either a filename or pony name" +complete -c ponysay -s W -a "Integer" --description "The screen column where the message should be wrapped" + +set -e systemponies +set -e homeponies + diff --git a/completion/fish_ponysay.fish b/completion/fish_ponysay.fish deleted file mode 100644 index ea98382..0000000 --- a/completion/fish_ponysay.fish +++ /dev/null @@ -1,24 +0,0 @@ - -# Completions for ponysay & ponythink -# https://github.com/erkin/ponysay/ -# -# Author: Elis Axelsson - - -if test -d /usr/share/ponysay/ponies/ - set -g systemponies (ls --color=no /usr/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from \/usr\/share\/ponysay\/ponies\//') -end - -if test -d ~/.local/share/ponysay/ponies/ - set -g homeponies (ls --color=no ~/.local/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from ~\/.local\/share\/ponysay\/ponies\//') -end - -complete -c ponysay -s h --description "Help of ponysay" -complete -c ponysay -s v --description "Version of ponysay" -complete -c ponysay -s l --description "List pony files" -complete -c ponysay -s f -a "$systemponies $homeponies" --description "Select a pony, either a filename or pony name" -complete -c ponysay -s W -a "Integer" --description "The screen column where the message should be wrapped" - -set -e systemponies -set -e homeponies - diff --git a/completion/fish_ponythink.fish b/completion/fish_ponythink.fish deleted file mode 100644 index 24391ce..0000000 --- a/completion/fish_ponythink.fish +++ /dev/null @@ -1,24 +0,0 @@ - -# Completions for ponysay & ponythink -# https://github.com/erkin/ponysay/ -# -# Author: Elis Axelsson - - -if test -d /usr/share/ponysay/ponies/ - set -g systemponies (ls --color=no /usr/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from \/usr\/share\/ponysay\/ponies\//') -end - -if test -d ~/.local/share/ponysay/ponies/ - set -g homeponies (ls --color=no ~/.local/share/ponysay/ponies/ | sed 's/\.pony/\t Pony from ~\/.local\/share\/ponysay\/ponies\//') -end - -complete -c ponythink -s h --description "Help of ponythink" -complete -c ponythink -s v --description "Version of ponythink" -complete -c ponythink -s l --description "List pony files" -complete -c ponythink -s f -a "$systemponies $homeponies" --description "Select a pony, either a filename or pony name" -complete -c ponythink -s W -a "Integer" --description "The screen column where the message should be wrapped" - -set -e systemponies -set -e homeponies - -- cgit