Skip to content

Instantly share code, notes, and snippets.

@sunny
Last active October 31, 2018 17:13
Show Gist options
  • Save sunny/cd7fba906845571fd5f46f1283197bc8 to your computer and use it in GitHub Desktop.
Save sunny/cd7fba906845571fd5f46f1283197bc8 to your computer and use it in GitHub Desktop.
#/bin/bash
#
# Requires:
# - figlet
# - a `:blank:` icon on Slack
#
# Install by calling:
# curl https://gist.githubusercontent.com/sunny/cd7fba906845571fd5f46f1283197bc8/raw/slack-banner.sh > ~/bin/slack-banner
#
# Usage:
# ~/bin/slack-banner <text> [icon1] [icon2]
#
# Will copy the given text written with icon1 (defaults to a black square)$
# and spaced by icon2 (default to blank space).
#
# Examples:
# ~/bin/slack-banner hi
# ~/bin/slack-banner hi :fire:
# ~/bin/slack-banner hi :sun: :cloud:
#
(echo && figlet -f banner "$1") |
sed -e"s/ /${3:-:blank:}/g" |
sed -e"s/#/${2:-:black_square:}/g" |
pbcopy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment