@gamecrate/cli 2.2.1 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/gamecrate.js +12 -7
  2. package/package.json +1 -1
package/dist/gamecrate.js CHANGED
@@ -1056,6 +1056,7 @@ import { basename, join } from "node:path";
1056
1056
  var CONTAINER_RUNTIME_DIR = "/tmp/xdg";
1057
1057
  var CONTAINER_LOG_DIR = "/logs";
1058
1058
  var X11_SOCKET_DIR = "/tmp/.X11-unix";
1059
+ var HOST_X11_DIR = "/run/host-x11";
1059
1060
  var CONTAINER_XAUTHORITY = "/tmp/xauth";
1060
1061
  var CONTAINER_XDG_DIR = "/xdg";
1061
1062
  var RUNTIME_DIR_SIZE = "64m";
@@ -1080,12 +1081,14 @@ function buildRunSpec(plan, modMounts, identity, image) {
1080
1081
  const proton = image?.launcher === "proton";
1081
1082
  const executable = image?.executable ?? game.executable;
1082
1083
  refuseProtonHeaded(plan.game, plan.mode, image);
1083
- const command = proton ? ["run-headless-windows", winPath(join(game.gameFiles.container, basename(executable)))] : headed ? [executable] : [
1084
+ const command = proton ? ["run-headless-windows", winPath(join(game.gameFiles.container, basename(executable)))] : headed ? ["run-headed", executable] : [
1084
1085
  "xvfb-run",
1085
1086
  "-a",
1086
1087
  `--server-args=-screen 0 ${settings.width}x${settings.height}x24`,
1087
1088
  executable
1088
1089
  ];
1090
+ if (headed)
1091
+ env.SCREEN = `${settings.width}x${settings.height}x24`;
1089
1092
  if (proton) {
1090
1093
  Object.assign(env, {
1091
1094
  SCREEN: `${settings.width}x${settings.height}x24`,
@@ -1106,7 +1109,7 @@ function buildRunSpec(plan, modMounts, identity, image) {
1106
1109
  }
1107
1110
  addScratch(mounts, env, plan, identity);
1108
1111
  if (headed)
1109
- addSession(mounts, env, plan);
1112
+ addSession(mounts, env, plan, identity);
1110
1113
  const deviceCgroupRules = [];
1111
1114
  if (settings.input) {
1112
1115
  mounts.push({ type: "bind", source: "/dev/input", target: "/dev/input", readonly: true });
@@ -1174,10 +1177,10 @@ function addScratch(mounts, env, plan, identity) {
1174
1177
  env.XDG_CACHE_HOME = `${CONTAINER_XDG_DIR}/cache`;
1175
1178
  env.XDG_DATA_HOME ??= `${CONTAINER_XDG_DIR}/data`;
1176
1179
  }
1177
- function addSession(mounts, env, plan) {
1180
+ function addSession(mounts, env, plan, identity) {
1178
1181
  const { settings } = plan;
1179
1182
  if (settings.display === "x11")
1180
- addX11(mounts, env);
1183
+ addX11(mounts, env, identity);
1181
1184
  else
1182
1185
  addWayland(mounts, env);
1183
1186
  if (!settings.audio)
@@ -1187,11 +1190,13 @@ function addSession(mounts, env, plan) {
1187
1190
  }
1188
1191
  env.PULSE_SERVER = `unix:${CONTAINER_RUNTIME_DIR}/pulse/native`;
1189
1192
  }
1190
- function addX11(mounts, env) {
1193
+ function addX11(mounts, env, identity) {
1191
1194
  const x11 = x11Session();
1192
1195
  if (!x11)
1193
1196
  return;
1194
- mounts.push({ type: "bind", source: X11_SOCKET_DIR, target: X11_SOCKET_DIR });
1197
+ mounts.push({ type: "tmpfs", target: X11_SOCKET_DIR, uid: identity.uid, gid: identity.gid, mode: "1777" });
1198
+ mounts.push({ type: "bind", source: X11_SOCKET_DIR, target: HOST_X11_DIR, readonly: true });
1199
+ env.HOST_X11_DIR = HOST_X11_DIR;
1195
1200
  env.DISPLAY = x11.display;
1196
1201
  env.XDG_SESSION_TYPE = "x11";
1197
1202
  env.SDL_VIDEODRIVER = "x11";
@@ -7585,7 +7590,7 @@ function published2(value) {
7585
7590
  }
7586
7591
 
7587
7592
  // src/index.ts
7588
- var VERSION = "2.2.1";
7593
+ var VERSION = "2.3.0";
7589
7594
  async function main(argv) {
7590
7595
  const supervised = supervisedDir(argv);
7591
7596
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamecrate/cli",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "Run a modded game in a container, with mods resolved from your local checkouts.",
5
5
  "license": "MIT",
6
6
  "type": "module",