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

53
LINES

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

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

Download Jar. Uses 3874K of libraries. Click here for Pure Java version (14320L/99K).

!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 + "]");
  bot("Super User VM.");
  print("\nType Linux commands here to execute them.\n");
  focusConsole();
  sleep();
}

answer {
  if "ready" ret "yes";
  if "backtick *" ret format("OK *", backtick_verbose($1));
  if "backtick uninterruptible *" {
    temp tempSetTL(backtick_uninterruptable, true);
    ret format("OK *", backtick_verbose($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  old transpilations   

Travelled to 18 computer(s): aoiabmzegqzx, bhatertpkbcr, bvpoyihotdib, cbybwowwnfue, cfunsshuasjs, emufipobbhmk, fonkrhpcolwg, gwrvuhgaqvyk, hzfkhshlejco, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1009053
Snippet name: JavaX Super User VM - start using #1009062 on Linux
Eternal ID of this version: #1009053/36
Text MD5: 249ba77beeb09526647754c761353b85
Transpilation MD5: 17d5aa370a9b31456dddedfa314bde9d
Author: stefan
Category: javax
Type: JavaX module (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-20 17:46:52
Source code size: 1538 bytes / 53 lines
Pitched / IR pitched: No / No
Views / Downloads: 815 / 2978
Version history: 35 change(s)
Referenced in: #1009059 - Super User VM Starter Helper [used internally]
#1009062 - Linux: Start JavaX Super User VM v2 [prompts for password]