mirror of
https://github.com/pjones/plasma-manager.git
synced 2024-08-17 03:30:22 +03:00
Correctly set shortcuts that have group names with dots (periods)
Some of the shortcut group names (i.e., krunner) have dots in their names. This change ensures that those settings are honored. Before this change the setting for krunner would have been: [org][kde][krunner][desktop] _launch=... And has been fixed so it's now: [org.kde.krunner.desktop] _launch=...
This commit is contained in:
parent
f51ba145fc
commit
2146ecadc4
@ -16,13 +16,10 @@ let
|
||||
options = {
|
||||
configGroupNesting = lib.mkOption {
|
||||
type = lib.types.nonEmptyListOf lib.types.str;
|
||||
default = (lib.splitString "." name);
|
||||
description = "Group name, and sub-group names.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
configGroupNesting = lib.mkDefault (lib.splitString "." name);
|
||||
};
|
||||
};
|
||||
|
||||
##############################################################################
|
||||
|
@ -5,7 +5,7 @@ let
|
||||
cfg = config.programs.plasma;
|
||||
|
||||
# Convert one shortcut into a settings attribute set.
|
||||
shortcutToNameValuePair = action: skey:
|
||||
shortcutToNameValuePair = _action: skey:
|
||||
let
|
||||
# Keys are expected to be a list:
|
||||
keys =
|
||||
@ -16,18 +16,21 @@ let
|
||||
# Don't allow un-escaped commas:
|
||||
escape = lib.escape [ "," ];
|
||||
in
|
||||
{
|
||||
name = action;
|
||||
value = lib.concatStringsSep "," [
|
||||
(lib.concatStringsSep "\t" (map escape keys))
|
||||
"" # List of default keys, not needed.
|
||||
"" # Display string, not needed.
|
||||
];
|
||||
};
|
||||
lib.concatStringsSep "," [
|
||||
(lib.concatStringsSep "\t" (map escape keys))
|
||||
"" # List of default keys, not needed.
|
||||
"" # Display string, not needed.
|
||||
];
|
||||
|
||||
shortcutsToSettings = groups:
|
||||
lib.mapAttrs (_group: lib.mapAttrs' shortcutToNameValuePair) groups;
|
||||
|
||||
lib.mapAttrs
|
||||
(group: attrs:
|
||||
(lib.mapAttrs shortcutToNameValuePair attrs) // {
|
||||
# Some shortcut groups have a dot in their name so we
|
||||
# explicitly set the group nesting to only one level deep:
|
||||
configGroupNesting = [ group ];
|
||||
})
|
||||
groups;
|
||||
in
|
||||
{
|
||||
options.programs.plasma.shortcuts = lib.mkOption {
|
||||
|
Loading…
Reference in New Issue
Block a user