xstatus v0.1.0

status bar for x11, written in Crystal

Configuration

You may edit src/config.cr to configure xstatus as you see fit.

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
Repository

xstatus

Owner
Statistic
  • 4
  • 0
  • 0
  • 0
  • 1
  • 25 days ago
  • March 7, 2023
License

MIT License

Links
Synced at

Thu, 16 May 2024 14:14:43 GMT

Languages