-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpy_menu.py
More file actions
executable file
·742 lines (629 loc) · 30.1 KB
/
Copy pathpy_menu.py
File metadata and controls
executable file
·742 lines (629 loc) · 30.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
#!/usr/bin/env python3
#
# py_menu.py - Python-based TUI for Linux Setup with Categories and Multi-Select
# Description: Enhanced menu system with categories, search, multi-select, and batch installation
# Supports both local and remote execution
# Usage: ./py_menu.py
# Can also be run remotely with:
# REPO_USER=user REPO_NAME=repo bash <(curl -fsSL https://raw.githubusercontent.com/user/repo/main/bootstrap.sh) python-menu
import os
import sys
import subprocess
import curses
from curses import wrapper
from pathlib import Path
import re
import urllib.request
import urllib.error
import json
import tempfile
class RemoteAwareInstallerMenu:
def __init__(self):
# Check if running remotely (in a temporary directory)
self.script_path = Path(__file__)
self.is_remote = str(self.script_path).startswith("/tmp/") or str(self.script_path).startswith("/var/tmp/")
# Repository configuration from environment variables
self.repo_user = os.environ.get("REPO_USER", "gdellis")
self.repo_name = os.environ.get("REPO_NAME", "linux-setup")
self.repo_branch = os.environ.get("REPO_BRANCH", "main")
if self.is_remote:
print(f"Running remotely from {self.repo_user}/{self.repo_name} ({self.repo_branch})")
self.installers = self.discover_remote_installers()
self.categories = self.organize_by_category()
else:
self.script_dir = self.script_path.parent
self.installers_dir = self.script_dir / "installers"
self.installers = self.discover_local_installers()
self.categories = self.organize_by_category()
self.current_view = "main" # "main", "category", "search", or "multiselect"
self.selected = 0
self.offset = 0
self.search_term = ""
self.filtered_items = []
self.current_category = None
self.multiselect_mode = False
self.selected_items = set() # Set of indices for multiselect
self.multiselect_items = [] # Items available for multiselect
def fetch_remote_content(self, path):
"""Fetch content from remote repository"""
url = f"https://raw.githubusercontent.com/{self.repo_user}/{self.repo_name}/{self.repo_branch}/{path}"
try:
with urllib.request.urlopen(url) as response:
return response.read().decode('utf-8')
except urllib.error.URLError as e:
print(f"Error fetching {url}: {e}")
return None
def list_remote_directory(self, path):
"""List files in a remote directory (simplified approach)"""
# For GitHub, we can't easily list directory contents via raw URLs
# We'll need to know the installer names or use GitHub API
# For now, let's try a few common installer names
common_installers = [
"setup_vscode.sh", "setup_neovim.sh", "setup_gum.sh",
"setup_nala.sh", "setup_fabric.sh", "setup_ollama.sh",
"setup_1password.sh", "setup_protonvpn.sh", "setup_syncthing.sh",
"setup_orcaslicer.sh", "setup_amdgpu.sh", "setup_protonmail.sh", "setup_beyondcompare.sh"
]
return common_installers
def discover_remote_installers(self):
"""Discover installers from remote repository"""
installers = []
# Try to get list of installers from remote directory
# This is a simplified approach - in practice, you might want to:
# 1. Use GitHub API to list files
# 2. Have a manifest file in the repo
# 3. Try a predefined list of common installers
installer_names = self.list_remote_directory("installers/")
for installer_name in installer_names:
if not installer_name.startswith("setup_") or not installer_name.endswith(".sh"):
continue
if installer_name in ["setup_gum.sh", "setup_new_installer.sh"]:
continue
# Fetch the installer content to extract metadata
installer_path = f"installers/{installer_name}"
content = self.fetch_remote_content(installer_path)
if content is None:
continue
# Extract metadata from file header
description = "No description"
category = "Utilities" # Default category
for line in content.split('\n'):
if line.startswith("# Description:"):
description = line.replace("# Description:", "").strip()
elif line.startswith("# Category:"):
category = line.replace("# Category:", "").strip()
elif line.strip() and not line.startswith("#"):
break
display_name = installer_name.replace("setup_", "").replace(".sh", "")
installers.append({
'name': display_name,
'description': description,
'category': category,
'path': installer_path,
'is_remote': True
})
return installers
def discover_local_installers(self):
"""Discover all setup_*.sh scripts locally"""
installers = []
if not self.installers_dir.exists():
return installers
for script_path in sorted(self.installers_dir.glob("setup_*.sh")):
# Skip special scripts
name = script_path.stem
if name in ["setup_gum", "setup_new_installer"]:
continue
# Extract metadata from file header
description = "No description"
category = "Utilities" # Default category
try:
with open(script_path, 'r') as f:
for line in f:
if line.startswith("# Description:"):
description = line.replace("# Description:", "").strip()
elif line.startswith("# Category:"):
category = line.replace("# Category:", "").strip()
# Break if we've passed the header comment section
elif line.strip() and not line.startswith("#"):
break
except Exception:
pass
display_name = name.replace("setup_", "")
installers.append({
'name': display_name,
'description': description,
'category': category,
'path': str(script_path),
'is_remote': False
})
return installers
def organize_by_category(self):
"""Organize installers by category"""
categories = {}
# Add installers to their categories
for installer in self.installers:
cat = installer['category']
if cat not in categories:
categories[cat] = []
categories[cat].append(installer)
# Sort categories and their contents
for cat in categories:
categories[cat].sort(key=lambda x: x['name'])
# Sort categories alphabetically
return dict(sorted(categories.items()))
def get_current_items(self):
"""Get items to display based on current view"""
if self.current_view == "search":
return self.filtered_items
elif self.current_view == "category":
return self.categories.get(self.current_category, [])
elif self.current_view == "multiselect":
return self.multiselect_items
else: # main view
# Return categories with item counts
items = []
for category, installers in self.categories.items():
items.append({
'type': 'category',
'name': category,
'description': f"{len(installers)} items",
'installers': installers
})
return items
def filter_items(self):
"""Filter items based on search term"""
if not self.search_term:
self.filtered_items = []
self.current_view = "main" if self.current_category is None else "category"
return
self.current_view = "search"
all_items = []
# In category view, only search within current category
if self.current_category and self.current_category in self.categories:
items_to_search = self.categories[self.current_category]
else:
# In main view, search all installers
items_to_search = self.installers
for item in items_to_search:
if (self.search_term.lower() in item['name'].lower() or
self.search_term.lower() in item['description'].lower()):
item_copy = item.copy()
item_copy['type'] = 'installer'
all_items.append(item_copy)
self.filtered_items = all_items
def enter_multiselect_mode(self):
"""Enter multiselect mode with current items"""
self.multiselect_mode = True
self.current_view = "multiselect"
self.selected_items = set()
# Get current items for multiselect
if self.search_term and self.current_view == "search":
self.multiselect_items = self.filtered_items.copy()
elif self.current_category:
self.multiselect_items = self.categories.get(self.current_category, []).copy()
else:
# If in main view, collect all installers from all categories
self.multiselect_items = []
for category_installers in self.categories.values():
self.multiselect_items.extend(category_installers)
self.selected = 0
self.offset = 0
def toggle_selection(self, idx):
"""Toggle selection of an item in multiselect mode"""
if idx in self.selected_items:
self.selected_items.remove(idx)
else:
self.selected_items.add(idx)
def draw_menu(self, stdscr):
"""Draw the menu interface"""
height, width = stdscr.getmaxyx()
# Clear screen
stdscr.clear()
# Title
if self.current_view == "search":
title = f"Search Results: '{self.search_term}'"
elif self.current_view == "category":
title = f"Category: {self.current_category}"
elif self.current_view == "multiselect":
title = "Multi-Select Mode"
else:
title = "Linux Setup - Installation Menu"
stdscr.addstr(0, (width - len(title)) // 2, title, curses.A_BOLD)
stdscr.addstr(1, 0, "=" * width)
# Remote execution indicator
if self.is_remote:
stdscr.addstr(2, 0, f"REMOTE MODE: {self.repo_user}/{self.repo_name}", curses.A_BOLD)
stdscr.addstr(3, 0, "-" * width)
offset_row = 4
else:
offset_row = 2
# Breadcrumb navigation
if self.current_view != "main":
breadcrumb = "Main"
if self.current_view == "category":
breadcrumb += f" > {self.current_category}"
elif self.current_view == "search":
breadcrumb += f" > Search"
elif self.current_view == "multiselect":
if self.current_category:
breadcrumb += f" > {self.current_category}"
breadcrumb += " > Multi-Select"
stdscr.addstr(offset_row, 0, breadcrumb[:width-1])
stdscr.addstr(offset_row + 1, 0, "-" * width)
search_row = offset_row + 2
else:
search_row = offset_row
# Search bar
search_prompt = f"Search: {self.search_term}"
stdscr.addstr(search_row, 0, search_prompt[:width-1])
stdscr.addstr(search_row + 1, 0, "-" * width)
# Instructions
if self.current_view == "main":
instructions = "↑/↓: Navigate | Enter: Select | /: Search | m: Multi-Select All | q: Quit"
elif self.current_view == "category":
instructions = "↑/↓: Navigate | Enter: Select | /: Search | m: Multi-Select | ←: Back | q: Quit"
elif self.current_view == "search":
instructions = "↑/↓: Navigate | Enter: Select | m: Multi-Select | ESC: Clear Search | ←: Back | q: Quit"
elif self.current_view == "multiselect":
instructions = "↑/↓: Navigate | Space: Toggle | Enter: Install Selected | a: Select All | ←: Back | q: Quit"
else:
instructions = "↑/↓: Navigate | Enter: Select | ←: Back | q: Quit"
stdscr.addstr(search_row + 2, 0, instructions[:width-1])
stdscr.addstr(search_row + 3, 0, "-" * width)
# Calculate visible items
max_visible = height - (search_row + 7) # Reserve space for header/footer/instructions
if max_visible <= 0:
return
# Get current items to display
items = self.get_current_items()
# Adjust offset to keep selection visible
if self.selected >= len(items):
self.selected = max(0, len(items) - 1)
if self.offset >= len(items):
self.offset = max(0, len(items) - 1)
if self.selected < self.offset:
self.offset = self.selected
elif self.selected >= self.offset + max_visible:
self.offset = self.selected - max_visible + 1
# Display items
for i in range(max_visible):
idx = self.offset + i
if idx >= len(items):
break
item = items[idx]
# Highlight selected item
if idx == self.selected:
attr = curses.A_REVERSE
else:
attr = curses.A_NORMAL
# Format display based on item type and mode
if self.current_view == "multiselect":
# Multi-select mode with checkboxes
checked = "☒" if idx in self.selected_items else "☐"
line = f"{checked} {item['name']:<20} - {item['description']}"
elif item.get('type') == 'category':
line = f"📁 {item['name']:<20} - {item['description']}"
elif item.get('type') == 'installer':
line = f"⚙️ {item['name']:<20} - {item['description']}"
else:
# Default installer display in main/category view
line = f"⚙️ {item['name']:<20} - {item['description']}"
stdscr.addstr(search_row + 4 + i, 0, line[:width-1], attr)
# Status line
if items:
if self.current_view == "multiselect":
status = f"Items: {len(items)} | Selected: {len(self.selected_items)} | Current: {self.selected + 1}"
else:
status = f"Items: {len(items)} | Selected: {self.selected + 1}"
else:
status = "No items found"
stdscr.addstr(height - 2, 0, status[:width-1], curses.A_BOLD)
# Additional info line
if self.current_view == "multiselect":
info = f"Space: Toggle item | Enter: Install selected | a: Select all"
stdscr.addstr(height - 1, 0, info[:width-1], curses.A_DIM)
elif self.multiselect_mode:
info = "Multi-select mode available (press 'm' to enter)"
stdscr.addstr(height - 1, 0, info[:width-1], curses.A_DIM)
stdscr.refresh()
def run_remote_installer(self, stdscr, installer_path):
"""Run a remote installer by downloading and executing it"""
stdscr.clear()
height, width = stdscr.getmaxyx()
installer_name = Path(installer_path).name
stdscr.addstr(0, 0, f"Running: {installer_name} (Remote)", curses.A_BOLD)
stdscr.addstr(1, 0, "Downloading and executing...")
stdscr.addstr(2, 0, "Press Ctrl+C to cancel")
stdscr.refresh()
# End curses mode temporarily
curses.endwin()
# Download the installer to a temporary file
url = f"https://raw.githubusercontent.com/{self.repo_user}/{self.repo_name}/{self.repo_branch}/{installer_path}"
print(f"Downloading {url}")
try:
# Create temporary file
with tempfile.NamedTemporaryFile(mode='w', suffix='.sh', delete=False) as tmp_file:
tmp_path = tmp_file.name
# Download the installer
urllib.request.urlretrieve(url, tmp_path)
# Make it executable
os.chmod(tmp_path, 0o755)
# Set environment variables for the remote installer
env = os.environ.copy()
env["REPO_USER"] = self.repo_user
env["REPO_NAME"] = self.repo_name
env["REPO_BRANCH"] = self.repo_branch
# Run the installer
result = subprocess.run(["bash", tmp_path], check=True, env=env)
success = True
# Clean up
os.unlink(tmp_path)
except subprocess.CalledProcessError as e:
success = False
print(f"Installation failed with exit code {e.returncode}")
except Exception as e:
success = False
print(f"Error running installer: {e}")
except KeyboardInterrupt:
success = False
print("Installation cancelled")
# Show completion message
if success:
print("\n✅ Installation completed successfully!")
else:
print("\n❌ Installation failed or was cancelled.")
input("\nPress Enter to return to menu...")
# Restart curses mode
stdscr = curses.initscr()
curses.cbreak()
stdscr.keypad(True)
curses.noecho()
return stdscr
def run_local_installer(self, stdscr, installer_path):
"""Run a local installer"""
stdscr.clear()
height, width = stdscr.getmaxyx()
installer_name = Path(installer_path).name
stdscr.addstr(0, 0, f"Running: {installer_name}", curses.A_BOLD)
stdscr.addstr(1, 0, "Installation in progress...")
stdscr.addstr(2, 0, "Press Ctrl+C to cancel")
stdscr.refresh()
# End curses mode temporarily
curses.endwin()
# Run the installer
try:
result = subprocess.run(["bash", installer_path], check=True)
success = True
except subprocess.CalledProcessError as e:
success = False
print(f"Installation failed with exit code {e.returncode}")
except KeyboardInterrupt:
success = False
print("Installation cancelled")
# Show completion message
if success:
print("\n✅ Installation completed successfully!")
else:
print("\n❌ Installation failed or was cancelled.")
input("\nPress Enter to return to menu...")
# Restart curses mode
stdscr = curses.initscr()
curses.cbreak()
stdscr.keypad(True)
curses.noecho()
return stdscr
def run_installer(self, stdscr, installer):
"""Run an installer (local or remote)"""
if installer.get('is_remote', False):
return self.run_remote_installer(stdscr, installer['path'])
else:
return self.run_local_installer(stdscr, installer['path'])
def run_batch_installers(self, stdscr, installers):
"""Run multiple installers in batch"""
if not installers:
return stdscr
stdscr.clear()
height, width = stdscr.getmaxyx()
stdscr.addstr(0, 0, "Batch Installation", curses.A_BOLD)
stdscr.addstr(1, 0, f"Installing {len(installers)} items...")
stdscr.addstr(2, 0, "Press Ctrl+C to cancel")
stdscr.refresh()
# End curses mode temporarily
curses.endwin()
success_count = 0
failed_count = 0
for i, installer in enumerate(installers):
installer_name = Path(installer['path']).name
print(f"\n[{i+1}/{len(installers)}] Installing: {installer_name}")
try:
if installer.get('is_remote', False):
# Download and run remote installer
url = f"https://raw.githubusercontent.com/{self.repo_user}/{self.repo_name}/{self.repo_branch}/{installer['path']}"
# Create temporary file
with tempfile.NamedTemporaryFile(mode='w', suffix='.sh', delete=False) as tmp_file:
tmp_path = tmp_file.name
# Download the installer
urllib.request.urlretrieve(url, tmp_path)
# Make it executable
os.chmod(tmp_path, 0o755)
# Set environment variables for the remote installer
env = os.environ.copy()
env["REPO_USER"] = self.repo_user
env["REPO_NAME"] = self.repo_name
env["REPO_BRANCH"] = self.repo_branch
# Run the installer
result = subprocess.run(["bash", tmp_path], check=True, env=env)
success_count += 1
print(f"✅ {installer_name} installed successfully!")
# Clean up
os.unlink(tmp_path)
else:
# Run local installer
result = subprocess.run(["bash", installer['path']], check=True)
success_count += 1
print(f"✅ {installer_name} installed successfully!")
except subprocess.CalledProcessError as e:
failed_count += 1
print(f"❌ {installer_name} failed with exit code {e.returncode}")
except Exception as e:
failed_count += 1
print(f"❌ {installer_name} failed with error: {e}")
except KeyboardInterrupt:
print("\n❌ Installation cancelled by user")
break
# Show summary
print(f"\n📊 Installation Summary:")
print(f" Successful: {success_count}")
print(f" Failed: {failed_count}")
print(f" Total: {len(installers)}")
input("\nPress Enter to return to menu...")
# Restart curses mode
stdscr = curses.initscr()
curses.cbreak()
stdscr.keypad(True)
curses.noecho()
return stdscr
def navigate_back(self):
"""Navigate back to previous view"""
if self.current_view == "search":
self.search_term = ""
self.current_view = "main" if self.current_category is None else "category"
self.filtered_items = []
elif self.current_view == "category":
self.current_view = "main"
self.current_category = None
elif self.current_view == "multiselect":
self.current_view = "main" if self.current_category is None else "category"
self.multiselect_mode = False
self.selected_items = set()
self.multiselect_items = []
# In main view, back quits
def select_all_items(self):
"""Select all items in multiselect mode"""
if self.current_view == "multiselect":
items = self.get_current_items()
self.selected_items = set(range(len(items)))
def run(self, stdscr):
"""Main menu loop"""
# Setup curses
curses.curs_set(0) # Hide cursor
stdscr.keypad(True)
curses.noecho()
while True:
self.draw_menu(stdscr)
try:
key = stdscr.getch()
if key == ord('q') or key == ord('Q'):
break
elif key == curses.KEY_DOWN:
items = self.get_current_items()
if items:
self.selected = min(self.selected + 1, len(items) - 1)
elif key == curses.KEY_UP:
if self.get_current_items():
self.selected = max(self.selected - 1, 0)
elif key == ord('\n') or key == curses.KEY_ENTER:
items = self.get_current_items()
if items and self.selected < len(items):
item = items[self.selected]
if self.current_view == "multiselect":
# In multiselect mode, Enter installs selected items
if self.selected_items:
# Get selected items
selected_installers = []
for idx in self.selected_items:
if idx < len(self.multiselect_items):
selected_installers.append(self.multiselect_items[idx])
if selected_installers:
stdscr = self.run_batch_installers(stdscr, selected_installers)
# Exit multiselect mode after installation
self.current_view = "main" if self.current_category is None else "category"
self.multiselect_mode = False
self.selected_items = set()
self.multiselect_items = []
self.selected = 0
self.offset = 0
elif self.current_view == "main" and item.get('type') == 'category':
# Enter category
self.current_view = "category"
self.current_category = item['name']
self.selected = 0
self.offset = 0
elif item.get('type') == 'installer' or 'path' in item:
# Run installer
if 'path' in item:
stdscr = self.run_installer(stdscr, item)
elif key == ord(' '):
# Spacebar to toggle selection in multiselect mode
if self.current_view == "multiselect":
self.toggle_selection(self.selected)
elif key == ord('a') or key == ord('A'):
# Select all in multiselect mode
if self.current_view == "multiselect":
self.select_all_items()
elif key == ord('m') or key == ord('M'):
# Enter multiselect mode
if self.current_view in ["category", "search"] or (self.current_view == "main" and not self.search_term):
self.enter_multiselect_mode()
elif key == curses.KEY_LEFT or key == ord('h') or key == ord('H'):
# Navigate back
self.navigate_back()
self.selected = 0
self.offset = 0
elif key == ord('/'):
# Enter search mode
self.search_term = ""
self.filter_items()
elif key in [curses.KEY_BACKSPACE, 127, 8]:
if self.search_term:
self.search_term = self.search_term[:-1]
self.filter_items()
elif key == 27: # ESC key
if self.current_view == "search":
self.search_term = ""
self.current_view = "main" if self.current_category is None else "category"
self.filtered_items = []
else:
self.navigate_back()
self.selected = 0
self.offset = 0
elif 32 <= key <= 126: # Printable characters
self.search_term += chr(key)
self.filter_items()
except KeyboardInterrupt:
break
def main():
"""Main entry point"""
if len(sys.argv) > 1 and sys.argv[1] == "--help":
print("Linux Setup Menu - Python TUI with Categories and Multi-Select")
print("Supports both local and remote execution")
print("")
print("Usage: ./py_menu.py")
print("")
print("For remote execution:")
print(" REPO_USER=user REPO_NAME=repo bash <(curl -fsSL https://raw.githubusercontent.com/user/repo/main/bootstrap.sh) python-menu")
print("")
print("Environment Variables:")
print(" REPO_USER - GitHub username (default: gdellis)")
print(" REPO_NAME - Repository name (default: linux-setup)")
print(" REPO_BRANCH - Repository branch (default: main)")
print("")
print("Navigation:")
print(" Arrow keys - Move selection")
print(" Enter - Select category/run installer")
print(" / - Start search mode")
print(" m - Enter multi-select mode")
print(" Space - Toggle selection in multi-select mode")
print(" a - Select all items in multi-select mode")
print(" ←/h - Go back to previous menu")
print(" ESC - Clear search/go back")
print(" q - Quit menu")
return
menu = RemoteAwareInstallerMenu()
try:
wrapper(menu.run)
except Exception as e:
print(f"Error running menu: {e}")
sys.exit(1)
if __name__ == "__main__":
main()