mirror of
https://github.com/harivansh-afk/deskctl.git
synced 2026-04-15 04:03:28 +00:00
replace firefox with chrome (#14)
This commit is contained in:
parent
580ea79c27
commit
ff26c57035
7 changed files with 61 additions and 63 deletions
|
|
@ -37,9 +37,9 @@ preferred read surface for focused state queries.
|
|||
## Wait for state transitions
|
||||
|
||||
```sh
|
||||
deskctl wait window --selector 'title=Firefox' --timeout 10
|
||||
deskctl wait window --selector 'title=Chromium' --timeout 10
|
||||
deskctl wait focus --selector 'id=win3' --timeout 5
|
||||
deskctl --json wait window --selector 'class=firefox' --poll-ms 100
|
||||
deskctl --json wait window --selector 'class=chromium' --poll-ms 100
|
||||
```
|
||||
|
||||
Wait commands return the matched window payload on success. In `--json` mode,
|
||||
|
|
@ -48,9 +48,9 @@ timeouts and selector failures expose structured `kind` values.
|
|||
## Act on windows
|
||||
|
||||
```sh
|
||||
deskctl launch firefox
|
||||
deskctl launch chromium
|
||||
deskctl focus @w1
|
||||
deskctl focus 'title=Firefox'
|
||||
deskctl focus 'title=Chromium'
|
||||
deskctl click @w1
|
||||
deskctl click 960,540
|
||||
deskctl dblclick @w2
|
||||
|
|
@ -86,8 +86,8 @@ more deterministic for automation, and easier to retry safely.
|
|||
```sh
|
||||
ref=w1
|
||||
id=win1
|
||||
title=Firefox
|
||||
class=firefox
|
||||
title=Chromium
|
||||
class=chromium
|
||||
focused
|
||||
```
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ w1
|
|||
win1
|
||||
```
|
||||
|
||||
Bare strings like `firefox` are fuzzy matches. They resolve when there is one
|
||||
Bare strings like `chromium` are fuzzy matches. They resolve when there is one
|
||||
match and fail with candidate windows when there are multiple matches.
|
||||
|
||||
## Global options
|
||||
|
|
|
|||
|
|
@ -38,13 +38,13 @@ Prefer explicit selectors when you need deterministic targeting:
|
|||
```sh
|
||||
ref=w1
|
||||
id=win1
|
||||
title=Firefox
|
||||
class=firefox
|
||||
title=Chromium
|
||||
class=chromium
|
||||
focused
|
||||
```
|
||||
|
||||
Legacy refs such as `@w1` still work after `snapshot` or `list-windows`. Bare
|
||||
strings like `firefox` are fuzzy matches and now fail on ambiguity.
|
||||
strings like `chromium` are fuzzy matches and now fail on ambiguity.
|
||||
|
||||
## 4. Wait, act, verify
|
||||
|
||||
|
|
@ -55,16 +55,16 @@ The core loop is:
|
|||
deskctl snapshot --annotate
|
||||
|
||||
# wait
|
||||
deskctl wait window --selector 'title=Firefox' --timeout 10
|
||||
deskctl wait window --selector 'title=Chromium' --timeout 10
|
||||
|
||||
# act
|
||||
deskctl focus 'title=Firefox'
|
||||
deskctl focus 'title=Chromium'
|
||||
deskctl hotkey ctrl l
|
||||
deskctl type "https://example.com"
|
||||
deskctl press enter
|
||||
|
||||
# verify
|
||||
deskctl wait focus --selector 'title=Firefox' --timeout 5
|
||||
deskctl wait focus --selector 'title=Chromium' --timeout 5
|
||||
deskctl snapshot
|
||||
```
|
||||
|
||||
|
|
@ -84,8 +84,8 @@ Every command supports `--json` and uses the same top-level envelope:
|
|||
{
|
||||
"ref_id": "w1",
|
||||
"window_id": "win1",
|
||||
"title": "Firefox",
|
||||
"app_name": "firefox",
|
||||
"title": "Chromium",
|
||||
"app_name": "chromium",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"width": 1920,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue