Commit Graph

9 Commits

Author SHA1 Message Date
Karel Zak 7a4704d826 lib/colors: support schemes customization
* parse terminal-colors.d/*.scheme files, expected format is

    <name> <color-sequence>

 * supported color sequences:

     - color name (e.g. "red")
     - dir_colors compatible xx;yy (e.g. 01;31) where the sequence may
       contains control chars like \e \a  ..etc.

 * scheme is parsed on demand

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-13 12:09:03 +02:00
Karel Zak e66a662726 lib/colors: allow to temporary disable colors
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-13 12:09:02 +02:00
Ondrej Oprala d0c9ddc3cc lib/colors: check for /etc/terminal-colors.d/[util].disable
[kzak@redhat.com: - move paths to pathnames.h,
                  - use static path buffer]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 09:38:09 +01:00
Karel Zak 68f7b572ba lib/color: add colorscheme parser 2014-02-10 14:50:12 +01:00
Karel Zak 80a1712f54 fdisk: add -L to colorize output
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:47:09 +02:00
Karel Zak b7faf99128 lib/colors: add colormode_or_err()
... to make the code easy to use in utils.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-07 09:09:35 +02:00
Karel Zak a10c043493 lib/colors: add support for auto, always and never modes
... to implement --color[=<when>]

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-06 19:07:23 +02:00
Karel Zak 5aaee63cdf dmesg: more colors, more fun
* colorize subsystem prefix
 * colorize time
 * colorize by keywords (now "segfault" only)

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-18 12:28:32 +01:00
Ondrej Oprala dfa68ad183 lib/color: add module for work with terminal colors
[kzak@redhat.com: - split from dmesg patch
                  - add more colors]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-10-16 16:39:00 +02:00