]> git.r.bdr.sh - rbdr/dotfiles/commitdiff
Add figlet sample
authorRuben Beltran del Rio <redacted>
Wed, 23 Sep 2020 08:34:22 +0000 (10:34 +0200)
committerRuben Beltran del Rio <redacted>
Wed, 23 Sep 2020 08:34:22 +0000 (10:34 +0200)
runcoms/zshrc
zsh/functions/figlet-sample.zsh [new file with mode: 0644]
zsh/functions/graphviz.zsh

index 2cd5ce2545d32784261bf5b2eafc5a88020dd9a5..af64bbe8f6e034e75f8f144ace86b8a278f6fece 100644 (file)
@@ -5,6 +5,7 @@ source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/git-info.zsh"
 source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/dotenv.zsh"
 source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/graphviz.zsh"
 source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/short-uptime.zsh"
 source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/dotenv.zsh"
 source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/graphviz.zsh"
 source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/short-uptime.zsh"
+source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/figlet-sample.zsh"
 
 ################################################################################
 # Load Modules
 
 ################################################################################
 # Load Modules
diff --git a/zsh/functions/figlet-sample.zsh b/zsh/functions/figlet-sample.zsh
new file mode 100644 (file)
index 0000000..70b7591
--- /dev/null
@@ -0,0 +1,9 @@
+# Print a string with all the figlet fonts
+figlet-sample () {
+    if [[ -n "${1+x}" ]]
+    then
+        ls -FG `figlet -I 2` | grep --color=auto 'flf' | xargs -I '{}' basename '{}' '.flf' | xargs -I '{}' figlet -f '{}' $1
+    else
+        echo 'Usage: figlet-sample <string>'
+    fi
+}
index d7b4e1283a4873804962f2fcf6563543240216a6..f62f9b25fcb6db9d661df854a9b7f85bc1883e31 100644 (file)
@@ -11,7 +11,7 @@ neat-to-png () {
   if [[ -n "${1+x}" ]]; then
     neato -Tpng $1 -o ${1%.*}.png
   else
   if [[ -n "${1+x}" ]]; then
     neato -Tpng $1 -o ${1%.*}.png
   else
-    echo 'Usage: dot-to-png <path_to_file>'
+    echo 'Usage: neat-to-png <path_to_file>'
   fi
 }
 
   fi
 }