Coder Social home page Coder Social logo

terminal-parrot's Introduction

๐Ÿฆœ for your terminal

demo

Installing

Either grab a build on the releases page or clone and run...

$ go get -u github.com/jmhobbs/terminal-parrot
$ terminal-parrot

Nix

nix-env

nix-env -i terminal-parrot

nix-profile

nix profile install nixpkgs#terminal-parrot

Homebrew

There is a tap for this as well, it's jmhobbs/parrot

brew tap jmhobbs/parrot
brew install terminal-parrot

The command will be installed as parrot, rather than terminal-parrot.

Snap Install

$ sudo snap install terminal-parrot

Docker

The image is available on docker hub

docker pull jmhobbs/terminal-parrot
docker run -it --rm jmhobbs/terminal-parrot:latest

You can also build a docker image locally and run it in a container with...

docker build -t partyparrot ./
docker run -it --rm partyparrot (-args)

Quitting

Hit the escape or "q" key to quit.

-loops

You can limit your parrots enthusiasm with the -loops flag.

:fastparrot:

Set the frame delay with the -delay flag (defaults to 75, use 25 for :fastparrot:)

:aussieparrot:

Use -orientation aussie for our friends down under.

Adding Animations

You can add additional animations without re-compiling by adding a plain text file somewhere on the path (by default /etc/terminal-parrot or /opt/homebrew/etc/terminal-parrot).

This file should contain the frames, separated by lines containing !--FRAME--!. The filename must end with .animation.

The first segment of the file is reserved for metadata, which is key-value pairs separated by :.

For example, the following file, named test.animation would add a new animation called test:

description: A test animation!
!--FRAME--!
[ Frame One ]
!--FRAME--!
[ Frame Two ]
!--FRAME--!
[ Frame Three ]

Then you can run terminal-parrot test to see your new animation (assuming it's on the path).

Demo of custom animations

Thanks

Idea from seeing this tweet from @rachsmithtweets

Thanks to termbox-go for making it easy.

Thanks to jp2a for nice ASCII art conversion.

Thanks to erinking for fixing colors and animation frames

Thanks to pdevine for the Dockerfile (and robbyoconnor for reviving the PR I let go stale)

terminal-parrot's People

Contributors

dencold avatar dnkmmr69420 avatar erinking avatar geoffreyfrogeye avatar jmhobbs avatar kz6fittycent avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terminal-parrot's Issues

-delay and -orientation flags not working in terminal

Terminal V:2.5.3
Mac OS X 10.10.5
Installed via homebrew commands

parrot runs great
parrot -orientation aussie & parrot -delay [int] are kicking back errors

$ parrot -delay 25
flag provided but not defined: -delay
Usage of parrot:
  -loops int
    	number of times to loop (default: infinite)
$ parrot -orientation aussie
flag provided but not defined: -orientation
Usage of parrot:
  -loops int
    	number of times to loop (default: infinite)

Flexible Parrot

Right now the parrot is a fixed size. We should adjust display based on terminal size.

Colors

We could add more detailed colors (white edges, colored bodies)

panics if not run in a tty

I wanted to create a telnet service for terminal-parrot (whereby a user would be presented with the parrot when they telnet to a machine), and terminal-parrot will panic if it is not run in a tty.

A simple way to see this behavior is to use systemd-run:

derek@proton ~> sudo systemd-run parrot --loops 5                           
Running as unit: run-r4f979625766c483fa68dafa4269b052c.service
derek@proton ~> journalctl -u run-r4f979625766c483fa68dafa4269b052c.service --no-pager
-- Logs begin at Sat 2016-04-02 09:46:39 PDT, end at Fri 2016-06-17 11:16:28 PDT. --
Jun 17 11:16:28 proton systemd[1]: Started /home/derek/go/bin/parrot --loops 5.
Jun 17 11:16:28 proton parrot[3671]: panic: open /dev/tty: no such device or address
Jun 17 11:16:28 proton parrot[3671]: goroutine 1 [running]:
Jun 17 11:16:28 proton parrot[3671]: panic(0x53e5c0, 0xc82000a300)
Jun 17 11:16:28 proton parrot[3671]:         /nix/store/vf8zf1hr51bc6q3pqqgw74dniqxj63qi-go-1.6/share/go/src/runtime/panic.go:464 +0x3e6
Jun 17 11:16:28 proton parrot[3671]: main.main()
Jun 17 11:16:28 proton parrot[3671]:         /home/derek/go/src/github.com/jmhobbs/terminal-parrot/parrot.go:13 +0xab
Jun 17 11:16:28 proton systemd[1]: run-r4f979625766c483fa68dafa4269b052c.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jun 17 11:16:28 proton systemd[1]: run-r4f979625766c483fa68dafa4269b052c.service: Unit entered failed state.
Jun 17 11:16:28 proton systemd[1]: run-r4f979625766c483fa68dafa4269b052c.service: Failed with result 'exit-code'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.