Start Gyre from an icon: launch / quit / install-desktop

- python3 -m sandtable install-desktop puts a Gyre icon in the app grid and on
  the desktop (freedesktop .desktop entry with a "Quit Gyre" action).
- The icon runs `launch`: starts the web page in the background (no terminal,
  own session, log in .cache/server.log) if it isn't running, then opens it.
  A dialog shows the reason if it can't start.
- Quit link on the page (local computer only) and `quit`: stop any design,
  motors off, close the page.
- Gyre icon (sandtable/static/gyre.svg), also the page's tab icon.
- Simulator takes several lines per tick, so streaming tests aren't slowed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ckochandClaude Opus 5.5 committed 2026-11-01 21:25:10 -05:00
1 parent 8a377af116
commit db78b1f2e6
9 files changed
+195 -13

No files matched your search

+7
View File
@@ -452,6 +452,9 @@ def main(argv=None):
sub = ap.add_subparsers(dest='cmd', required=True)
sub.add_parser('ports', help='list serial ports')
sub.add_parser('info', help='connect and show the controller and its settings')
sub.add_parser('launch', help='start the web page in the background if needed and open it (the Gyre icon)')
sub.add_parser('quit', help='close the web page started by launch (stops any design, motors off)')
sub.add_parser('install-desktop', help='put a Gyre icon in the app grid and on the desktop (Linux)')
for name, text in (('web', 'the web page: a library of designs to play, plus the jog panel'),
('ui', 'the same web page, opened at the jog panel: home, jog, calibrate')):
u = sub.add_parser(name, help=text)
@@ -483,5 +486,9 @@ def main(argv=None):
m.add_argument('--no-home', action='store_true')
args = ap.parse_args(argv)
cfg = config.load(args.config)
if args.cmd in ('launch', 'quit', 'install-desktop'): # no USB connection needed here
from . import launcher
sys.exit({'launch': launcher.launch, 'quit': launcher.quit_gyre,
'install-desktop': lambda: launcher.install_desktop() and 0}[args.cmd]())
{'ports': cmd_ports, 'info': cmd_info, 'flash': cmd_flash, 'ui': cmd_web, 'web': cmd_web, 'setup': cmd_setup, 'test': cmd_test, 'home': cmd_home,
'play': cmd_play, 'gen': cmd_gen, 'erase': cmd_erase, 'move': cmd_move}[args.cmd](cfg, args)