Add edgeBarrier and cornerBarrier options for kwin module (#282)

This commit is contained in:
magnouvean 2024-07-28 22:50:36 +02:00 committed by GitHub
parent 3f9a64bd90
commit d8a65f9200
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 34 additions and 5 deletions

View File

@ -224,6 +224,11 @@
};
};
kwin = {
edgeBarrier = 0; # Disables the edge-barriers introduced in plasma 6.1
cornerBarrier = false;
};
#
# Some mid-level settings:

View File

@ -57,11 +57,11 @@ let
(imap1 (i: v: (nameValuePair "Name_${builtins.toString i}" v)) names);
capitalizeWord = word:
let
let
firstLetter = builtins.substring 0 1 word;
rest = builtins.substring 1 (builtins.stringLength word - 1) word;
in
"${toUpper firstLetter}${rest}";
in
"${toUpper firstLetter}${rest}";
removeColon = string: builtins.replaceStrings [ ":" ] [ "" ] string;
in
@ -219,7 +219,7 @@ in
nightLight = {
enable = mkOption {
type = with types; nullOr bool;
default = null;
default = null;
example = true;
description = "Enable the night light effect.";
};
@ -242,7 +242,7 @@ in
default = null;
example = "-35.86466165413535";
description = "The longitude of your location.";
};
};
};
temperature = {
day = mkOption {
@ -281,6 +281,23 @@ in
description = "The time in minutes it takes to transition from day to night.";
};
};
edgeBarrier = mkOption {
type = with types; nullOr (ints.between 0 1000);
default = null;
example = 50;
description = ''
Additional distance the cursor needs to travel to cross screen edges. To
disable edge-barriers, set this to 0.
'';
};
cornerBarrier = mkOption {
type = with types; nullOr bool;
default = null;
example = false;
description = "When enabled, prevents the cursor from crossing at screen-corners.";
};
};
config.assertions = [
@ -431,5 +448,12 @@ in
TransitionTime = cfg.kwin.nightLight.transitionTime;
};
})
(mkIf (cfg.kwin.cornerBarrier != null) {
EdgeBarrier.CornerBarrier = cfg.kwin.cornerBarrier;
})
(mkIf (cfg.kwin.edgeBarrier != null) {
EdgeBarrier.EdgeBarrier = cfg.kwin.edgeBarrier;
})
]);
}