fix: Repair OSK implementation
This commit is contained in:
committed by
Hunter Halloran
parent
cc5b7b04d6
commit
6ea6185d7c
121
sw-kiosk.nix
121
sw-kiosk.nix
@@ -10,44 +10,91 @@
|
||||
'')}/bin/chromium-kiosk";
|
||||
};
|
||||
|
||||
services.xserver.desktopManager.phosh = {
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
user = "engr-ugaif";
|
||||
group = "users";
|
||||
desktopManager.phosh = {
|
||||
enable = true;
|
||||
user = "engr-ugaif";
|
||||
group = "users";
|
||||
};
|
||||
};
|
||||
|
||||
environment.etc."xdg/autostart/kiosk-chromium.desktop".text = ''
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Factory Kiosk
|
||||
Exec=${pkgs.chromium}/bin/chromium \
|
||||
--enable-features=UseOzonePlatform \
|
||||
--ozone-platform=wayland \
|
||||
--kiosk \
|
||||
--start-fullscreen \
|
||||
--noerrdialogs \
|
||||
--disable-session-crashed-bubble \
|
||||
https://ha.factory.uga.edu
|
||||
X-GNOME-Autostart-enabled=true
|
||||
X-GNOME-Autostart-Phase=Applications
|
||||
'';
|
||||
|
||||
environment.sessionVariables = {
|
||||
GDK_SCALE = "2";
|
||||
GDK_DPI_SCALE = "0.5";
|
||||
services.displayManager = {
|
||||
gdm.enable = true;
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = "engr-ugaif";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services."phosh-enable-osk" = {
|
||||
description = "Enable on-screen keyboard in Phosh";
|
||||
services.dbus.enable = true;
|
||||
|
||||
programs.dconf = {
|
||||
enable = true;
|
||||
profiles.user = {
|
||||
databases = [{
|
||||
settings = {
|
||||
"org/gnome/desktop/interface" = {
|
||||
color-scheme = "prefer-dark";
|
||||
clock-format = "12h";
|
||||
clock-show-weekday = true;
|
||||
};
|
||||
"org/gnome/desktop/media-handling" = {
|
||||
automount = false;
|
||||
automount-open = false;
|
||||
autorun-never = true;
|
||||
};
|
||||
"org/gnome/settings-daemon/plugins/power" = {
|
||||
sleep-inactive-ac-type = "nothing";
|
||||
};
|
||||
"org/gnome/desktop/a11y/applications" = {
|
||||
screen-keyboard-enabled = true;
|
||||
};
|
||||
};
|
||||
}];
|
||||
};
|
||||
};
|
||||
|
||||
security.pam.services."login".enableGnomeKeyring = true;
|
||||
security.pam.services."gdm-password".enableGnomeKeyring = true;
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
systemd.user.services.squeekboard = {
|
||||
description = "Squeekboard on-screen keyboard";
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
partOf = [ "graphical-session.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = pkgs.writeShellScript "phosh-enable-osk.sh" ''
|
||||
#!/bin/sh
|
||||
# Allow OSK usage in this session
|
||||
${pkgs.glib.bin}/bin/gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true || true
|
||||
ExecStart = "${pkgs.squeekboard}/bin/squeekboard";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
};
|
||||
|
||||
environment.sessionVariables = {
|
||||
GDK_SCALE = "2";
|
||||
GDK_DPI_SCALE = "0.5";
|
||||
|
||||
# Make GLib / gsettings actually see schemas
|
||||
XDG_DATA_DIRS = [ "/run/current-system/sw/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}" ];
|
||||
GSETTINGS_SCHEMA_DIR =
|
||||
"/run/current-system/sw/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}/glib-2.0/schemas";
|
||||
};
|
||||
|
||||
systemd.user.services."force-osk" = {
|
||||
description = "Force-enable GNOME OSK after session init";
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
partOf = [ "graphical-session.target" ];
|
||||
|
||||
unitConfig = {
|
||||
After = [ "gnome-session-initialized.target" "graphical-session.target" ];
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = ''
|
||||
${pkgs.glib.bin}/bin/gsettings set \
|
||||
org.gnome.desktop.a11y.applications screen-keyboard-enabled true
|
||||
'';
|
||||
Type = "oneshot";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -108,12 +155,14 @@
|
||||
oh-my-posh
|
||||
zsh
|
||||
git
|
||||
dbus
|
||||
glib
|
||||
squeekboard
|
||||
(pkgs.writeShellScriptBin "osk-wayland" ''
|
||||
exec ${pkgs.squeekboard}/bin/squeekboard "$@"
|
||||
'')
|
||||
dconf
|
||||
phoc
|
||||
gsettings-desktop-schemas
|
||||
#(pkgs.writeShellScriptBin "osk-wayland" ''
|
||||
# exec ${pkgs.squeekboard}/bin/squeekboard "$@"
|
||||
#'')
|
||||
inputs.lazyvim-nixvim.packages.${stdenv.hostPlatform.system}.nvim
|
||||
];
|
||||
|
||||
@@ -135,14 +184,6 @@
|
||||
defaultFonts.monospace = [ "FiraCode Nerd Font Mono" ];
|
||||
};
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
programs.mtr.enable = true;
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
|
||||
# Bluetooth
|
||||
hardware.bluetooth.enable = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user