Skip to content

Commit

Permalink
wip maliit stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
vivlim committed Mar 13, 2024
1 parent e372fe0 commit 2d7800b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions configuration.nix
Expand Up @@ -3,6 +3,7 @@
(modulesPath + "/installer/scan/not-detected.nix")
./disk-config.nix
./deck.nix
./onscreen-keyboard.nix
];

# just kind of a grab bag of stuff
Expand Down
3 changes: 2 additions & 1 deletion deck.nix
Expand Up @@ -31,7 +31,8 @@
};

environment.systemPackages = with pkgs; [
maliit-keyboard # onscreen keyboard, integrates with plasma nicely
glib.bin

steamdeck-firmware # gives us `jupiter-biosupdate` and `jupiter-controller-update` https://jovian-experiments.github.io/Jovian-NixOS/devices/valve-steam-deck/index.html
jupiter-dock-updater-bin # `jupiter-dock-updater`
];
Expand Down
33 changes: 33 additions & 0 deletions onscreen-keyboard.nix
@@ -0,0 +1,33 @@
{ modulesPath, config, lib, pkgs, ... }: let

# Shell script which invokes gsettings with the schemas for maliit-keyboard set.
schema-path = "${pkgs.maliit-keyboard}/share/gsettings-schemas/maliit-keyboard-2.3.1/glib-2.0/schemas"; # todo: derivation that just gets the schema path inside of this. right now it hardcodes the kb version...
gsettings-maliit = pkgs.writeShellScriptBin "gsettings-maliit" ''
# usage suggestion: gsettings-maliit list-recursively
env GSETTINGS_SCHEMA_DIR=$GSETTINGS_SCHEMA_DIR:${schema-path} ${pkgs.glib.bin}/bin/gsettings "$@"
'';

dconf-editor-maliit = pkgs.writeShellScriptBin "dconf-editor-maliit" ''
env GSETTINGS_SCHEMA_DIR=$GSETTINGS_SCHEMA_DIR:${schema-path} ${pkgs.gnome.dconf-editor}/bin/dconf-editor ${schema-path} --I-understand-that-changing-options-can-break-applications "$@"
'';

maliit-apply-viv-settings = pkgs.writeShellScriptBin "maliit-apply-viv-settings" ''
# these don't seem to really work yet
${gsettings-maliit}/bin/gsettings-maliit set org.maliit.keyboard.maliit auto-capitalization false
${gsettings-maliit}/bin/gsettings-maliit set org.maliit.keyboard.maliit opacity 0.7
${gsettings-maliit}/bin/gsettings-maliit set org.maliit.keyboard.maliit plugin-paths ${maliit-keyboard}/lib/maliit/plugins # gsettings can only set an entire array at once, put in quotes and quare brackets and single quotes
'';

in {
environment.systemPackages = with pkgs; [
maliit-keyboard # onscreen keyboard, integrates with plasma nicely
gsettings-maliit
dconf-editor-maliit
];

system.activationScripts.configureMaliit = pkgs.lib.stringAfter [ "var" ] ''
# todo apply some settings here? if it makes sense to do it globally?
'';
}

0 comments on commit 2d7800b

Please sign in to comment.