mirror of
https://github.com/lhns/steam-frame-nix.git
synced 2026-10-06 01:00:13 +02:00
Portal fix, Steam-session keyboard layout, VR keyboard patch, hidden apps, clipboard-sync and a Firefox Flatpak launcher, all under steamFrame.*, plus the outer-session user-services mechanism.
38 lines
1.4 KiB
Nix
38 lines
1.4 KiB
Nix
# Keyboard layout for the Steam session. gamescope (and its Xwayland displays
|
|
# :0/:1) uses xkbcommon defaults, i.e. US, unless XKB_DEFAULT_* is set. KDE's
|
|
# layout setting only applies to the nested desktop. systemd --user on the
|
|
# Frame does not pick up ~/.config/environment.d, so set it directly on the
|
|
# unit that launches gamescope. Takes effect the next time the Steam session
|
|
# starts.
|
|
{ config, lib, ... }:
|
|
let
|
|
cfg = config.steamFrame;
|
|
in {
|
|
options.steamFrame = {
|
|
keyboardLayout = lib.mkOption {
|
|
type = lib.types.nullOr lib.types.str;
|
|
default = null;
|
|
example = "de";
|
|
description = ''
|
|
XKB layout for the Steam session (XKB_DEFAULT_LAYOUT). null leaves
|
|
gamescope's default (US) and writes no drop-in.
|
|
'';
|
|
};
|
|
keyboardVariant = lib.mkOption {
|
|
type = lib.types.nullOr lib.types.str;
|
|
default = null;
|
|
example = "nodeadkeys";
|
|
description = "XKB variant for the Steam session (XKB_DEFAULT_VARIANT).";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf (cfg.keyboardLayout != null || cfg.keyboardVariant != null) {
|
|
xdg.configFile."systemd/user/gamescope-session.service.d/keyboard.conf".text =
|
|
"[Service]\n"
|
|
+ lib.optionalString (cfg.keyboardLayout != null)
|
|
"Environment=XKB_DEFAULT_LAYOUT=${cfg.keyboardLayout}\n"
|
|
+ lib.optionalString (cfg.keyboardVariant != null)
|
|
"Environment=XKB_DEFAULT_VARIANT=${cfg.keyboardVariant}\n";
|
|
};
|
|
}
|