-
Notifications
You must be signed in to change notification settings - Fork 0
Command Line Interface
Display help information about available commands:
WinMacMenu.exe --help
WinMacMenu.exe -h
WinMacMenu.exe /?List all currently running WinMacMenu sessions with detailed information:
WinMacMenu.exe --list
WinMacMenu.exe -l # Short alias
WinMacMenu.exe --list --output list # Default list format (detailed)
WinMacMenu.exe -l --output table # Compact table formatOutput includes:
- Process ID (PID)
- Window Title
- Config File Name
- Config File Path
- ShowOnLaunch setting
- ShowTrayIcon setting
Output Formats:
-
List format (default): Detailed, multi-line format with Window Title first, no title header
- Best for: Interactive use, detailed inspection, troubleshooting
-
Table format: Compact tabular format with Window Title first, column headers, no title header
- Best for: Scripts, quick overview, when managing many sessions
Example list format output:
Window Title: WinMacMenu
PID: 1234
Config File: config.ini
Config Path: <default>\config.ini
ShowOnLaunch: true
ShowTrayIcon: true
Window Title: WinMacMenu::custom
PID: 5678
Config File: custom.ini
Config Path: custom.ini
ShowOnLaunch: false
ShowTrayIcon: true
Example table format output:
Window Title PID Config File ShowOnLaunch ShowTrayIcon Config Path
-------------------- -------- -------------------- ------------ ------------ --------------------
WinMacMenu 1234 config.ini true true <default>\config.ini
WinMacMenu::custom 5678 custom.ini false true custom.ini
Restart a specific WinMacMenu session by PID (preserves configuration):
WinMacMenu.exe --reload <PID>
WinMacMenu.exe -r <PID> # Short aliasExample:
WinMacMenu.exe --reload 1234
WinMacMenu.exe -r 1234 # Short aliasThis will:
- Gracefully terminate the specified session
- Start a new session with the same configuration
- The new session will have a different PID
Gracefully shutdown a specific WinMacMenu session by PID:
WinMacMenu.exe --shutdown <PID>
WinMacMenu.exe -k <PID> # Short aliasExample:
WinMacMenu.exe --shutdown 1234
WinMacMenu.exe -k 1234 # Short aliasOpen the settings dialog for a specific WinMacMenu session:
WinMacMenu.exe --settings <PID>
WinMacMenu.exe -s <PID> # Short aliasExample:
WinMacMenu.exe --settings 1234
WinMacMenu.exe -s 1234 # Short aliasThis will open the settings GUI dialog for the specified session, allowing you to modify configuration options.
You can specify custom configuration files when starting WinMacMenu:
WinMacMenu.exe --config "path\to\custom.ini"This works with both GUI and CLI modes:
WinMacMenu.exe --config "custom.ini" --list
WinMacMenu.exe --config "project1.ini"You can run multiple WinMacMenu sessions simultaneously with different configurations:
WinMacMenu.exe --config "config1.ini"
WinMacMenu.exe --config "config2.ini"
WinMacMenu.exe --config "config3.ini"Each session will have its own:
- Process ID
- Configuration settings
- Tray icon (if enabled)
- Menu customizations
# Quick overview of running sessions (table format)
WinMacMenu.exe -l --output table
# Detailed inspection of sessions (list format)
WinMacMenu.exe -l --output list
# Reload a session after config changes
WinMacMenu.exe -r 1234
# Open settings to modify configuration
WinMacMenu.exe -s 1234
# Shutdown unnecessary sessions
WinMacMenu.exe -k 5678# Start different configurations for different projects
WinMacMenu.exe --config "work.ini"
WinMacMenu.exe --config "personal.ini"
WinMacMenu.exe --config "development.ini"
# List all running sessions
WinMacMenu.exe -l
# Manage specific sessions as needed
WinMacMenu.exe -s 1234
WinMacMenu.exe -r 5678The CLI interface makes it easy to integrate WinMacMenu management into scripts:
# Get all WinMacMenu PIDs using table format (easier to parse)
$sessions = & "WinMacMenu.exe" -l --output table | Select-Object -Skip 4 | Where-Object { $_ -match "^\d+" }
# Reload all sessions
foreach ($session in $sessions) {
if ($session -match "^(\d+)") {
$pid = $matches[1]
Write-Host "Reloading session $pid"
& "WinMacMenu.exe" -r $pid
}
}
# Alternative using list format
$sessions = & "WinMacMenu.exe" -l | Where-Object { $_ -match "PID: (\d+)" }
foreach ($session in $sessions) {
if ($session -match "PID: (\d+)") {
$pid = $matches[1]
Write-Host "Reloading session $pid"
& "WinMacMenu.exe" -r $pid
}
}@echo off
echo Checking WinMacMenu sessions...
WinMacMenu.exe -l
echo.
echo Reloading session 1234...
WinMacMenu.exe -r 1234
echo.
echo Opening settings for session 5678...
WinMacMenu.exe -s 5678The CLI commands provide appropriate error messages:
- Invalid PID: "Error: Invalid PID 'abc' for --reload"
- Session not found: "Error: No WinMacMenu session found with PID 1234"
- No sessions: "No WinMacMenu sessions found."
- 0: Success
- 1: Error (invalid arguments, session not found, etc.)
This allows for proper error handling in scripts and automation workflows.