xstatus

Version, currently 0.1.02 versions

github.com/restart-archive/xstatus

status bar for x11, written in Crystal

6 stars
0 dependents
License: MIT

Nothing has been indexed for 0.1.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.

Installation

# Add this to your shard.yml
dependencies:
  xstatus:
    github: restart-archive/xstatus
    version: ~> 0.1.0

Then run:

shards install

shard.yml

No shard.yml has been indexed for 0.1.0. You can read it on the repository.

Dependencies

Unknown: the shard.yml for this version has not been read yet.

README

This README is the one indexed from the repository at its latest ref, not from the tag for this version.

## Configuration
You may edit `src/config.cr` to configure xstatus as you see fit.
```crystal
module Config
    extend self
    def run(args : Array(String)) : String
        io = IO::Memory.new
        Process.run(args.join(" "), shell: true, output: io)
        io.to_s
    end
    
    def text(s : String, a : Array(String)) : String
        s
    end
    
    def date(s : String, a : Array(String)) : String
        outp = run(["date", a.join(" ")])
        s.gsub("%s", outp).rstrip
    end

    struct Field
        getter function : String, Array(String) -> String
        getter format : String
        getter arguments : Array(String)

        def initialize(@function, @format, @arguments); end
    end

    CONFIG = [
#                           FUNCTION                                 FORMAT                       ARGUMENTS        
        Field.new(->text(String, Array(String)),                     "Pr4gu3",                      [""]),
        Field.new(->date(String, Array(String)),                     "%s",                          ["+%r"]),
    ]
end
```
## Setup
To install this project, run:
```
$ git clone https://github.com/restartfu/xstatus
$ cd xstatus
$ sudo make install
```
Or one liner:
```
$ git clone https://github.com/restartfu/xstatus && cd xstatus && sudo make install
```