mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2025-08-06 03:41:46 +00:00
Compare commits
6 Commits
4bf8edb692
...
98e0d98cc7
Author | SHA1 | Date | |
---|---|---|---|
98e0d98cc7 | |||
c6b22c7cf2 | |||
c3e55200db | |||
4d37714aaf | |||
157e1a167c | |||
d628c5d3a4 |
60
README.md
60
README.md
@ -14,6 +14,7 @@ For an outline of past/future changes refer to: [CHANGELOG](CHANGELOG.md)
|
|||||||
|
|
||||||
- [Installation](#installation)
|
- [Installation](#installation)
|
||||||
- [Configuration](#configuration)
|
- [Configuration](#configuration)
|
||||||
|
- [Style](#style)
|
||||||
- [Commands](#root-typer)
|
- [Commands](#root-typer)
|
||||||
- [License](#license)
|
- [License](#license)
|
||||||
|
|
||||||
@ -68,6 +69,37 @@ OBS_PASSWORD=<websocket password>
|
|||||||
|
|
||||||
Flags can be used to override environment variables.
|
Flags can be used to override environment variables.
|
||||||
|
|
||||||
|
## Style
|
||||||
|
|
||||||
|
Styling is opt-in, by default you will get a colourless output:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
You may enable styling with the --style/-s flag:
|
||||||
|
|
||||||
|
```console
|
||||||
|
obsws-cli --style="cyan" sceneitem list
|
||||||
|
```
|
||||||
|
|
||||||
|
Available styles: _red, magenta, purple, blue, cyan, green, yellow, orange, white, grey, navy, black_
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Optionally you may disable border colouring with the --no-border flag:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
```console
|
||||||
|
obsws-cli --style="cyan" --no-border sceneitem list
|
||||||
|
```
|
||||||
|
|
||||||
|
Or with environment variables:
|
||||||
|
|
||||||
|
```env
|
||||||
|
OBS_STYLE=cyan
|
||||||
|
OBS_STYLE_NO_BORDER=true
|
||||||
|
```
|
||||||
|
|
||||||
## Root Typer
|
## Root Typer
|
||||||
|
|
||||||
- obs-version: Get the OBS Client and WebSocket versions.
|
- obs-version: Get the OBS Client and WebSocket versions.
|
||||||
@ -628,34 +660,6 @@ obsws-cli projector open --monitor-index=1 "test_group"
|
|||||||
obsws-cli screenshot save --width=2560 --height=1440 "Scene" "C:\Users\me\Videos\screenshot.png"
|
obsws-cli screenshot save --width=2560 --height=1440 "Scene" "C:\Users\me\Videos\screenshot.png"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Style
|
|
||||||
|
|
||||||
By default styling is disabled but you may enable it with:
|
|
||||||
|
|
||||||
- --style/-s: Style used in output.
|
|
||||||
- OBS_STYLE
|
|
||||||
- --no-border/-b: Disable table border styling in output.
|
|
||||||
- OBS_STYLE_NO_BORDER
|
|
||||||
|
|
||||||
Available styles:
|
|
||||||
|
|
||||||
- red
|
|
||||||
- magenta
|
|
||||||
- purple
|
|
||||||
- blue
|
|
||||||
- cyan
|
|
||||||
- green
|
|
||||||
- yellow
|
|
||||||
- orange
|
|
||||||
- white
|
|
||||||
- grey
|
|
||||||
- navy
|
|
||||||
- black
|
|
||||||
|
|
||||||
```console
|
|
||||||
obsws-cli --style=cyan --no-border scene list
|
|
||||||
```
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
`obsws-cli` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
|
`obsws-cli` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
|
||||||
|
BIN
img/coloured-border.png
Executable file
BIN
img/coloured-border.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 6.2 KiB |
BIN
img/coloured-no-border.png
Executable file
BIN
img/coloured-no-border.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 6.2 KiB |
BIN
img/colourless.png
Executable file
BIN
img/colourless.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 5.4 KiB |
@ -1,4 +1,4 @@
|
|||||||
# SPDX-FileCopyrightText: 2025-present onyx-and-iris <code@onyxandiris.online>
|
# SPDX-FileCopyrightText: 2025-present onyx-and-iris <code@onyxandiris.online>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
__version__ = "0.19.0"
|
__version__ = "0.19.1"
|
||||||
|
@ -62,8 +62,8 @@ def list_(
|
|||||||
(Text('Enabled', justify='center'), 'center', None),
|
(Text('Enabled', justify='center'), 'center', None),
|
||||||
(Text('Settings', justify='center'), 'center', ctx.obj['style'].column),
|
(Text('Settings', justify='center'), 'center', ctx.obj['style'].column),
|
||||||
]
|
]
|
||||||
for name, justify, style in columns:
|
for heading, justify, style in columns:
|
||||||
table.add_column(name, justify=justify, style=style)
|
table.add_column(heading, justify=justify, style=style)
|
||||||
|
|
||||||
for filter in resp.filters:
|
for filter in resp.filters:
|
||||||
resp = ctx.obj['obsws'].get_source_filter_default_settings(filter['filterKind'])
|
resp = ctx.obj['obsws'].get_source_filter_default_settings(filter['filterKind'])
|
||||||
|
@ -61,8 +61,8 @@ def list_(
|
|||||||
(Text('Group Name', justify='center'), 'left', ctx.obj['style'].column),
|
(Text('Group Name', justify='center'), 'left', ctx.obj['style'].column),
|
||||||
(Text('Enabled', justify='center'), 'center', None),
|
(Text('Enabled', justify='center'), 'center', None),
|
||||||
]
|
]
|
||||||
for column, justify, style in columns:
|
for heading, justify, style in columns:
|
||||||
table.add_column(column, justify=justify, style=style)
|
table.add_column(heading, justify=justify, style=style)
|
||||||
|
|
||||||
for item_id, group_name, is_enabled in groups:
|
for item_id, group_name, is_enabled in groups:
|
||||||
table.add_row(
|
table.add_row(
|
||||||
|
@ -74,8 +74,8 @@ def list_(
|
|||||||
(Text('Kind', justify='center'), 'center', ctx.obj['style'].column),
|
(Text('Kind', justify='center'), 'center', ctx.obj['style'].column),
|
||||||
(Text('Muted', justify='center'), 'center', None),
|
(Text('Muted', justify='center'), 'center', None),
|
||||||
]
|
]
|
||||||
for column, justify, style in columns:
|
for heading, justify, style in columns:
|
||||||
table.add_column(column, justify=justify, style=style)
|
table.add_column(heading, justify=justify, style=style)
|
||||||
|
|
||||||
for input_name, input_kind, input_uuid in inputs:
|
for input_name, input_kind, input_uuid in inputs:
|
||||||
input_mark = ''
|
input_mark = ''
|
||||||
|
@ -29,8 +29,8 @@ def list_(ctx: typer.Context):
|
|||||||
(Text('Profile Name', justify='center'), 'left', ctx.obj['style'].column),
|
(Text('Profile Name', justify='center'), 'left', ctx.obj['style'].column),
|
||||||
(Text('Current', justify='center'), 'center', None),
|
(Text('Current', justify='center'), 'center', None),
|
||||||
]
|
]
|
||||||
for column, justify, style in columns:
|
for heading, justify, style in columns:
|
||||||
table.add_column(column, justify=justify, style=style)
|
table.add_column(heading, justify=justify, style=style)
|
||||||
|
|
||||||
for profile in resp.profiles:
|
for profile in resp.profiles:
|
||||||
table.add_row(
|
table.add_row(
|
||||||
|
@ -43,8 +43,8 @@ def list_(
|
|||||||
(Text('Scene Name', justify='center'), 'left', ctx.obj['style'].column),
|
(Text('Scene Name', justify='center'), 'left', ctx.obj['style'].column),
|
||||||
(Text('Active', justify='center'), 'center', None),
|
(Text('Active', justify='center'), 'center', None),
|
||||||
]
|
]
|
||||||
for column, justify, style in columns:
|
for heading, justify, style in columns:
|
||||||
table.add_column(column, justify=justify, style=style)
|
table.add_column(heading, justify=justify, style=style)
|
||||||
|
|
||||||
for scene_name, scene_uuid in scenes:
|
for scene_name, scene_uuid in scenes:
|
||||||
if uuid:
|
if uuid:
|
||||||
@ -108,7 +108,11 @@ def switch(
|
|||||||
|
|
||||||
if preview:
|
if preview:
|
||||||
ctx.obj['obsws'].set_current_preview_scene(scene_name)
|
ctx.obj['obsws'].set_current_preview_scene(scene_name)
|
||||||
console.out.print(f'Switched to preview scene: [green]{scene_name}[/green]')
|
console.out.print(
|
||||||
|
f'Switched to preview scene: {console.highlight(ctx, scene_name)}'
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
ctx.obj['obsws'].set_current_program_scene(scene_name)
|
ctx.obj['obsws'].set_current_program_scene(scene_name)
|
||||||
console.out.print(f'Switched to program scene: [green]{scene_name}[/green]')
|
console.out.print(
|
||||||
|
f'Switched to program scene: {console.highlight(ctx, scene_name)}'
|
||||||
|
)
|
||||||
|
@ -78,8 +78,8 @@ def list_(
|
|||||||
('Enabled', 'center', None),
|
('Enabled', 'center', None),
|
||||||
]
|
]
|
||||||
# Add columns to the table
|
# Add columns to the table
|
||||||
for column, justify, style in columns:
|
for heading, justify, style in columns:
|
||||||
table.add_column(column, justify=justify, style=style)
|
table.add_column(heading, justify=justify, style=style)
|
||||||
|
|
||||||
for item_id, item_name, is_group, is_enabled, source_uuid in items:
|
for item_id, item_name, is_group, is_enabled, source_uuid in items:
|
||||||
if is_group:
|
if is_group:
|
||||||
|
@ -42,11 +42,6 @@ class Disabled(Style):
|
|||||||
column: str = 'none'
|
column: str = 'none'
|
||||||
highlight: str = 'none'
|
highlight: str = 'none'
|
||||||
|
|
||||||
def __post_init__(self):
|
|
||||||
"""Post-initialization to set default values."""
|
|
||||||
super().__post_init__()
|
|
||||||
os.environ['NO_COLOR'] = '1'
|
|
||||||
|
|
||||||
|
|
||||||
@register_style
|
@register_style
|
||||||
@dataclass
|
@dataclass
|
||||||
@ -182,4 +177,7 @@ class Black(Style):
|
|||||||
|
|
||||||
def request_style_obj(style_name: str, no_border: bool) -> Style:
|
def request_style_obj(style_name: str, no_border: bool) -> Style:
|
||||||
"""Entry point for style objects. Returns a Style object based on the style name."""
|
"""Entry point for style objects. Returns a Style object based on the style name."""
|
||||||
|
if style_name == 'disabled':
|
||||||
|
os.environ['NO_COLOR'] = '1'
|
||||||
|
|
||||||
return registry[style_name.lower()](no_border=no_border)
|
return registry[style_name.lower()](no_border=no_border)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user