Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

48
LINES

< > BotCompany Repo | #1009053 - JavaX Super User VM - start using #1009062 on Linux

JavaX module (desktop) [tags: use-pretranspiled]

Uses 3874K of libraries. Click here for Pure Java version (12758L/94K).

!7

p-magellan-thread { // Magellan is a pretty face
  tt(); // type writer font
  centerHigherConsole();
  consoleIcon(#1101431);
  hideFrameOnMinimize(consoleFrame());
  installTrayIcon(#1101431, "JavaX Super User VM", r showConsole,
    "Exit JavaX Super User VM", rThread cleanKill);
  
  // Figure out where we come from
  
  File originalHomeDir = newFile(first(args));
  
  // Show who we are
  
  S user = systemUserName();
  print("User: " + user);
  print("Home: " + userHome());
  if (neq(user, "root")) {
    print("Failure: I'm not root!");
    ret;
  }
  
  // Copy VM arguments from last home
  
  if (fileExists(originalHomeDir)) {
    File out = getProgramFile(#1005850, "default-vm-args");
    File in = newFile(javaxDataDirForUserHome(originalHomeDir), #1005850, "default-vm-args");
    if (!out.exists() && in.exists())
      copyFile(in, out);
  }
  
  // Rename ourselves & be open for business
  
  renameVM("Super User VM.");
  consoleTitle("JavaX Super User VM [" + user + "]");
  quietBot();
  print("\nType Linux commands here to execute them.\n");
  focusConsole();
  sleep();
}

answer {
  if "backtick *" ret format("OK *", backtick($1));
  if "program *" { directNohupJavax($1); ret "OK, starting " + $1; }
  try answer "Exit code: " + backtickToConsole_returnExitCode(s);
}

Author comment

Began life as a copy of #1001710

download  show line numbers  debug dex   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, bvpoyihotdib, cbybwowwnfue, cfunsshuasjs, emufipobbhmk, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1009053
Snippet name: JavaX Super User VM - start using #1009062 on Linux
Eternal ID of this version: #1009053/31
Text MD5: e4632bf9b259f3037dd7410e771be9a6
Transpilation MD5: d28260724eaa78fdbab8a503211a7d82
Author: stefan
Category: javax
Type: JavaX module (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-12 15:14:05
Source code size: 1352 bytes / 48 lines
Pitched / IR pitched: No / No
Views / Downloads: 364 / 1599
Version history: 30 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1009053 & http://1009053.tinybrain.de