programs.khal: ability to set RGB color (#5192)
The current module constrains to values in enum but khal supports RGB colors as well khal.readthedocs.io/en/latest/configure.html#the-calendars-section ! (be careful when setting an RGB value, it has to be quoted else it is ignored, got bitten by it with a manual config ) NB: It's also not possible to set addresses khal.readthedocs.io/en/latest/configure.html#the-calendars-section
This commit is contained in:
parent
30f2ec3951
commit
820be197cc
4 changed files with 13 additions and 22 deletions
|
|
@ -15,27 +15,11 @@ with lib;
|
|||
};
|
||||
|
||||
color = mkOption {
|
||||
type = types.nullOr (types.enum [
|
||||
"black"
|
||||
"white"
|
||||
"brown"
|
||||
"yellow"
|
||||
"dark gray"
|
||||
"dark green"
|
||||
"dark blue"
|
||||
"light gray"
|
||||
"light green"
|
||||
"light blue"
|
||||
"dark magenta"
|
||||
"dark cyan"
|
||||
"dark red"
|
||||
"light magenta"
|
||||
"light cyan"
|
||||
"light red"
|
||||
]);
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
Color in which events in this calendar are displayed.
|
||||
For instance 'light green' or an RGB color '#ff0000'
|
||||
'';
|
||||
example = "light green";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -45,10 +45,11 @@ let
|
|||
+ (optionalString
|
||||
(value.khal.type == "birthdays" && value.khal ? thisCollection)
|
||||
value.khal.thisCollection)
|
||||
}"
|
||||
] ++ optional (value.khal.readOnly) "readonly = True" ++ [
|
||||
(toKeyValueIfDefined (getAttrs [ "type" "color" "priority" ] value.khal))
|
||||
] ++ [ "\n" ]);
|
||||
}\n "
|
||||
] ++ optional (value.khal.readOnly) "readonly = True"
|
||||
++ optional (value.khal.color != null) "color = '${value.khal.color}'"
|
||||
++ [ (toKeyValueIfDefined (getAttrs [ "type" "priority" ] value.khal)) ]
|
||||
++ [ "\n" ]);
|
||||
|
||||
localeFormatOptions = let
|
||||
T = lib.types;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue