layer-terminal
A command-line tool to change the GNOME terminal background from Jade templates and JSON data.
Last updated 5 years ago by dp28 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install layer-terminal -g
SYNC missed versions from official npm registry.

Layer

A command-line tool to change the GNOME terminal background from Jade templates and JSON data.

Simple example

With the Jade template:

html
  head
    style.
      body {
        background: black;
        color: white;
      }

      h1 {
        float: right;
      }
  body
    h1 Hello, #{test}

and JSON:

{
  "test": "layer"
}

renders the output:

layer-render

Why

Layer makes it possible to programmatically change the terminal background as a way of providing information without disrupting your workflow. For example, it can be used:

  • To notify you that a long-running script has finished (see the provided 'notifications' template)
  • As an in-your-face todo list (see the provided 'todo' template)
  • As a reference for keyboard shortcuts that you do not yet know

Installation

Using npm:

npm install -g layer-terminal

If you don't have phantomjs installed, this is also required:

sudo apt-get install phantomjs

To enable tab completion, then do:

layer completion >> ~/.bashrc

Usage

layer <command> [options]

Commands

new

Arguments: -t/--template

Stores a named reference to the Jade and JSON files specifed. The created template reference can be set as the default template using the config command.

render

Arguments: -t/--template --profile, --allow-scroll, --image-file, --column-width, --row-height

Render a template to the terminal background. The exact Jade and JSON files can be specified, as can the location for the background image to be saved.

In addition, some terminal properties can be specifed or set: the GNOME profile whose background to change, whether the image scrolls when the terminal scrolls and the mapping between row/column sizes and pixels (to ensure the image is scaled to fit the terminal correctly).

write

Arguments: -k /--key, -v/--value, -t/--template

Write some JSON or a string to a particular key within an object in the data for a template, then render that template. For example, with the template data:

{
    "test": {}
}

layer write -k test.child -v success updates the template to:

{
    "test": {
        "child": "success"
    }
}

append

Arguments: -k /--key, -v/--value, -t/--template

Similar to write, but appends values rather than replacing them.

read

Arguments: -k /--key, -t/--template

Print a value from within a template to the console. For example, with the template data:

{
    "test": [1, 2, 3]
}

layer read -k test[0] prints 1 to the console.

remove

Arguments: -k /--key, -t/--template

Delete the value of a key within a template's data. If the key is an index into an array, the array is reduced in size.

list

List the names of all saved templates.

show

Arguments: -t/--template

Print a template and its data to the console.

delete

Arguments: -t/--template

Deletes a reference to a named Jade template and JSON data file. This does not remove the files themselves.

config

Arguments: The same as render

Shows the stored default settings for layer, or updates them if a setting name and value are passed.

completion

Prints a bash completion script to enable tab completion of layer commands and options. Append this to ~/.bashrc when layer is installed so that completions are automatically available.

License

MIT

Current Tags

  • 1.1.3                                ...           latest (5 years ago)

11 Versions

  • 1.1.3                                ...           5 years ago
  • 1.1.2                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 0.2.2                                ...           5 years ago
  • 0.2.1                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.3                                ...           5 years ago
  • 0.1.2                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (10)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |