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
|
@ -15,27 +15,11 @@ with lib;
|
||||||
};
|
};
|
||||||
|
|
||||||
color = mkOption {
|
color = mkOption {
|
||||||
type = types.nullOr (types.enum [
|
type = types.nullOr types.str;
|
||||||
"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"
|
|
||||||
]);
|
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
Color in which events in this calendar are displayed.
|
Color in which events in this calendar are displayed.
|
||||||
|
For instance 'light green' or an RGB color '#ff0000'
|
||||||
'';
|
'';
|
||||||
example = "light green";
|
example = "light green";
|
||||||
};
|
};
|
||||||
|
|
|
@ -45,10 +45,11 @@ let
|
||||||
+ (optionalString
|
+ (optionalString
|
||||||
(value.khal.type == "birthdays" && value.khal ? thisCollection)
|
(value.khal.type == "birthdays" && value.khal ? thisCollection)
|
||||||
value.khal.thisCollection)
|
value.khal.thisCollection)
|
||||||
}"
|
}\n "
|
||||||
] ++ optional (value.khal.readOnly) "readonly = True" ++ [
|
] ++ optional (value.khal.readOnly) "readonly = True"
|
||||||
(toKeyValueIfDefined (getAttrs [ "type" "color" "priority" ] value.khal))
|
++ optional (value.khal.color != null) "color = '${value.khal.color}'"
|
||||||
] ++ [ "\n" ]);
|
++ [ (toKeyValueIfDefined (getAttrs [ "type" "priority" ] value.khal)) ]
|
||||||
|
++ [ "\n" ]);
|
||||||
|
|
||||||
localeFormatOptions = let
|
localeFormatOptions = let
|
||||||
T = lib.types;
|
T = lib.types;
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
khal = {
|
khal = {
|
||||||
enable = true;
|
enable = true;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
|
color = "#ff0000";
|
||||||
type = "calendar";
|
type = "calendar";
|
||||||
};
|
};
|
||||||
local.type = "filesystem";
|
local.type = "filesystem";
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
[calendars]
|
[calendars]
|
||||||
[[test]]
|
[[test]]
|
||||||
path = /home/hm-user/$XDG_CONFIG_HOME/cal/test/
|
path = /home/hm-user/$XDG_CONFIG_HOME/cal/test/
|
||||||
|
|
||||||
readonly = True
|
readonly = True
|
||||||
|
color = '#ff0000'
|
||||||
priority=10
|
priority=10
|
||||||
type=calendar
|
type=calendar
|
||||||
|
|
||||||
|
@ -9,6 +11,7 @@ type=calendar
|
||||||
|
|
||||||
[[testcontacts-automaticallyCollected]]
|
[[testcontacts-automaticallyCollected]]
|
||||||
path = /home/hm-user/$XDG_CONFIG_HOME/card/testcontacts/automaticallyCollected
|
path = /home/hm-user/$XDG_CONFIG_HOME/card/testcontacts/automaticallyCollected
|
||||||
|
|
||||||
priority=10
|
priority=10
|
||||||
type=birthdays
|
type=birthdays
|
||||||
|
|
||||||
|
@ -16,6 +19,7 @@ type=birthdays
|
||||||
|
|
||||||
[[testcontacts-default]]
|
[[testcontacts-default]]
|
||||||
path = /home/hm-user/$XDG_CONFIG_HOME/card/testcontacts/default
|
path = /home/hm-user/$XDG_CONFIG_HOME/card/testcontacts/default
|
||||||
|
|
||||||
priority=10
|
priority=10
|
||||||
type=birthdays
|
type=birthdays
|
||||||
|
|
||||||
|
@ -23,6 +27,7 @@ type=birthdays
|
||||||
|
|
||||||
[[testcontactsNoCollections]]
|
[[testcontactsNoCollections]]
|
||||||
path = /home/hm-user/$XDG_CONFIG_HOME/card/testcontactsNoCollections/
|
path = /home/hm-user/$XDG_CONFIG_HOME/card/testcontactsNoCollections/
|
||||||
|
|
||||||
priority=10
|
priority=10
|
||||||
type=birthdays
|
type=birthdays
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue