Skip to content

m4sc2/m4sc2_awesomewm_helper

Repository files navigation

m4sc2_awesomewm_helper

Is a collection of helper for ricing/creation of AwesomeWM widgets/configs.

log - logging


by rxi

simple but very useful logging lib

Usage:

log = require ("log.log")

--- define logging 
-- file path
log.outfile = os.getenv("HOME") .."/lua-log.log"
--possible log level - "trace" "debug" "info" "warn" "error" "fatal"
log.level = "debug"

Modes:
    log.trace(...)
    log.debug(...)
    log.info(...)
    log.warn(...)
    log.error(...)
    log.fatal(...)

inspect - human-readable representations of tables


by kikito

amazing lib for creation debug output for lua tables

Usage:

inspect = require("inspect.inspect")

log.trace(inspect(stdout))

icon_customizer


by intrntbrn

Features:

  • Define your own icons for applications
  • Set custom icons for terminal applications based on client title

Usage:

example-configuration

dkjson - JSON Module for Lua


by dkolf

easy encode/decode lua tables in json and vice versa

Usage:

The same example below and more can also be found at the wiki of the author

Encoding


local json = require ("dkjson")

local tbl = {
  animals = { "dog", "cat", "aardvark" },
  instruments = { "violin", "trombone", "theremin" },
  bugs = json.null,
  trees = nil
}

local str = json.encode (tbl, { indent = true })

print (str)

Output

{
  "bugs":null,
  "instruments":["violin","trombone","theremin"],
  "animals":["dog","cat","aardvark"]
}

Decoding


local json = require ("dkjson")

local str = [[
{
  "numbers": [ 2, 3, -20.23e+2, -4 ],
  "currency": "\u20AC"
}
]]

local obj, pos, err = json.decode (str, 1, nil)
if err then
  print ("Error:", err)
else
  print ("currency", obj.currency)
  for i = 1,#obj.numbers do
    print (i, obj.numbers[i])
  end
end

Output

currency1	2
2	3
3	-2023
4	-4

About

collection of helper for ricing of AwesomeWM configs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages