From f33e21aec7c2383b7038062d9a9773e502648fd6 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Tue, 26 May 2026 14:25:51 +0800 Subject: [PATCH] update mmsg usecase in docs --- docs/bindings/keys.md | 2 +- docs/configuration/input.md | 2 +- docs/configuration/monitors.md | 16 ++++++++-------- docs/ipc.md | 5 +++-- docs/screenshot.md | 2 +- docs/window-management/rules.md | 2 +- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/docs/bindings/keys.md b/docs/bindings/keys.md index 616ea305..5abc716b 100644 --- a/docs/bindings/keys.md +++ b/docs/bindings/keys.md @@ -51,7 +51,7 @@ You can divide key bindings into named modes. Rules: 2. If no `keymode` is set before a bind, it belongs to the `default` mode. 3. The special `common` keymode applies its binds **across all modes**. -Use `setkeymode` to switch modes, and `mmsg -b` to query the current mode. +Use `setkeymode` to switch modes, and `mmsg get keymode` to query the current mode. ```ini # Binds in 'common' apply in every mode diff --git a/docs/configuration/input.md b/docs/configuration/input.md index ee12906a..b821bf29 100644 --- a/docs/configuration/input.md +++ b/docs/configuration/input.md @@ -131,7 +131,7 @@ Or bind it manually to a key: bind=alt,shift_l,switch_keyboard_layout ``` -Use `mmsg -g -k` to query the current keyboard layout at any time. +Use `mmsg get keyboardlayout` to query the current layout. --- diff --git a/docs/configuration/monitors.md b/docs/configuration/monitors.md index 28ef240b..084db60c 100644 --- a/docs/configuration/monitors.md +++ b/docs/configuration/monitors.md @@ -83,13 +83,13 @@ name:xxx&&make:xxx&&model:xxx&&serial:xxx ```bash # By name (shorthand) -mmsg -d toggle_monitor,eDP-1 +mmsg dispatch toggle_monitor,eDP-1 # By make and model -mmsg -d toggle_monitor,make:Chimei Innolux Corporation&&model:0x15F5 +mmsg dispatch toggle_monitor,make:Chimei Innolux Corporation&&model:0x15F5 # By serial -mmsg -d toggle_monitor,serial:12345678 +mmsg dispatch toggle_monitor,serial:12345678 ``` --- @@ -166,13 +166,13 @@ You can control monitor power using the `mmsg` IPC tool. ```bash # Turn off -mmsg -d disable_monitor,eDP-1 +mmsg dispatch disable_monitor,eDP-1 # Turn on -mmsg -d enable_monitor,eDP-1 +mmsg dispatch enable_monitor,eDP-1 # Toggle -mmsg -d toggle_monitor,eDP-1 +mmsg dispatch toggle_monitor,eDP-1 ``` You can also use `wlr-randr` for monitor management: @@ -257,10 +257,10 @@ You can create and manage virtual displays through IPC commands: ```bash # Create virtual output -mmsg -d create_virtual_output +mmsg dispatch create_virtual_output # Destroy all virtual outputs -mmsg -d destroy_all_virtual_output +mmsg dispatch destroy_all_virtual_output ``` You can configure virtual monitors using `wlr-randr`: diff --git a/docs/ipc.md b/docs/ipc.md index b4372c39..489293fa 100644 --- a/docs/ipc.md +++ b/docs/ipc.md @@ -30,10 +30,11 @@ description: Control mangowm programmatically using mmsg. | `get focusing-client` | Returns full JSON details for the client currently in focus. | | `get client ` | Returns full JSON details for a client with the given ID. | | `get tag ` | Queries status of a specific tag on a monitor. | +| `get tags ` | Returns a JSON object containing the status of all tags on a monitor. | | `get all-clients` | Returns a JSON array of all active clients. | | `get all-monitors` | Returns a JSON array of all connected monitors. | | `get all-tags` | Returns a JSON object containing the status of all tags. | -| `get last_open_surface ` | Returns the last focused surface name for a monitor. | +| `get last_open_surface []` | Returns the last focused surface name for a monitor,if the mon not set, it will get current monitor. | *Example:* ```bash @@ -54,7 +55,7 @@ Subscribes the client to real-time updates. When the state changes, the server p * `watch all-clients` * `watch keymode` * `watch keyboardlayout` -* `watch last_open_surface ` +* `watch last_open_surface []` *Example:* ```bash diff --git a/docs/screenshot.md b/docs/screenshot.md index f07cdf0c..4ae84c3d 100644 --- a/docs/screenshot.md +++ b/docs/screenshot.md @@ -90,7 +90,7 @@ Uses `mmsg` (ships with mango) to capture the focused window. ```bash #!/usr/bin/env bash -geometry=$(mmsg -x | awk '/x / {x=$3} /y / {y=$3} /width / {w=$3} /height / {h=$3} END {print x","y" "w"x"h}') +geometry=$(mmsg get focusing-client | jq -r '"\(.x),\(.y) \(.width)x\(.height)"') [ -z "$geometry" ] && exit 1 grim -g "$geometry" "$HOME/Pictures/Screenshots/$(date +%Y%m%d%H%M%S).png" ``` diff --git a/docs/window-management/rules.md b/docs/window-management/rules.md index acfd5a79..41b4cc53 100644 --- a/docs/window-management/rules.md +++ b/docs/window-management/rules.md @@ -220,7 +220,7 @@ You can set all parameters in one line. Target "layer shell" surfaces like statu layerrule=layer_name:Values,Parameter:Values,Parameter:Values ``` -> **Tip:** You can use `mmsg -e` to get the last open layer name for debugging. +> **Tip:** You can use `mmsg get last_open_surface` to get the last open layer name for debugging. | Parameter | Type | Values | Description | | :--- | :--- | :--- | :--- |