mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-28 21:37:28 -04:00
update mmsg usecase in docs
This commit is contained in:
parent
caf36397fb
commit
f33e21aec7
6 changed files with 15 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -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`:
|
||||
|
|
|
|||
|
|
@ -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 <id>` | Returns full JSON details for a client with the given ID. |
|
||||
| `get tag <mon> <idx>` | Queries status of a specific tag on a monitor. |
|
||||
| `get tags <mon>` | 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 <mon>` | Returns the last focused surface name for a monitor. |
|
||||
| `get last_open_surface [<mon>]` | 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 <mon_name>`
|
||||
* `watch last_open_surface [<mon_name>]`
|
||||
|
||||
*Example:*
|
||||
```bash
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
```
|
||||
|
|
|
|||
|
|
@ -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 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue