xstatus

Version, currently 0.1.12 versions

github.com/restart-archive/xstatus

status bar for x11, written in Crystal

6 stars
0 dependents
License: MIT

Installation

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

Then run:

shards install

shard.yml

Crystal
no constraint declared
License
MIT
Author
RestartFU

Dependencies

Runtime Dependencies

  • x11*github: TamasSzekeres/x11-cr
  • toml*github: crystal-community/toml.cr, branch: master
  • logger*github: restartfu/logger.cr

README

## 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
```