refactor: moby: cleaner way to disable gestures

This commit is contained in:
Colin 2023-07-25 10:56:29 +00:00
parent 2df59f7c7d
commit 219bb02cb8
2 changed files with 9 additions and 4 deletions

View File

@ -29,6 +29,7 @@ in
};
sane.gui.sxmo = {
nogesture = true;
settings = {
### hardware: touch screen
SXMO_LISGD_INPUT_DEVICE = "/dev/input/by-path/platform-1c2ac00.i2c-event";
@ -168,10 +169,6 @@ in
};
package = pkgs.sxmo-utils.overrideAttrs (base: {
postPatch = (base.postPatch or "") + ''
# don't enable gestures at launch
# sed -i '/superctl start sxmo_hook_lisgd/d' ./configs/default_hooks/sxmo_hook_start.sh
sed -i '1 a touch ~/.cache/sxmo/sxmo.nogesture' ./configs/default_hooks/sxmo_hook_start.sh
cat <<EOF >> ./configs/default_hooks/sxmo_hook_start.sh
# rotate UI based on physical display angle by default
sxmo_daemons.sh start autorotate sxmo_autorotate.sh

View File

@ -126,6 +126,11 @@ in
default = false;
description = "inhibit lock-on-idle and screenoff-on-idle";
};
sane.gui.sxmo.nogesture = mkOption {
type = types.bool;
default = false;
description = "don't start lisgd gesture daemon by default";
};
};
config = lib.mkMerge [
@ -241,6 +246,9 @@ in
sane.user.fs.".cache/sxmo/sxmo.noidle" = lib.mkIf cfg.noidle {
symlink.text = "";
};
sane.user.fs.".cache/sxmo/sxmo.nogesture" = lib.mkIf cfg.nogesture {
symlink.text = "";
};
sane.user.fs.".config/sxmo/profile".symlink.text = let
mkKeyValue = key: value: ''export ${key}="${value}"'';
userConfig = lib.generators.toKeyValue { inherit mkKeyValue; } cfg.settings;