mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2025-08-06 20:01:45 +00:00
Compare commits
5 Commits
bff5d396a4
...
23282a60d1
Author | SHA1 | Date | |
---|---|---|---|
23282a60d1 | |||
b6ba66db64 | |||
c4480895a1 | |||
fd2e629ec2 | |||
85b653891d |
@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
# [0.17.0] - 2025-06-20
|
# [0.17.3] - 2025-06-20
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- scene list no longer prints the UUIDs by default, enable it with the --uuid flag.
|
- scene list no longer prints the UUIDs by default, enable it with the --uuid flag.
|
||||||
|
- if NO_COLOR is set, print colourless check and cross marks in tables.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
@ -615,7 +615,11 @@ obsws-cli screenshot save --width=2560 --height=1440 "Scene" "C:\Users\me\Videos
|
|||||||
|
|
||||||
## Disable Colouring
|
## Disable Colouring
|
||||||
|
|
||||||
If you prefer colourless output you can set the environment variable `NO_COLOR`. See the [rich documentation][rich-doc-envvars]
|
If you prefer colourless output you can set the environment variable `NO_COLOR`, see [NO_COLOR][no-colour].
|
||||||
|
|
||||||
|
```console
|
||||||
|
NO_COLOR="1" obsws-cli scene list
|
||||||
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
@ -624,4 +628,4 @@ If you prefer colourless output you can set the environment variable `NO_COLOR`.
|
|||||||
|
|
||||||
[obs-studio]: https://obsproject.com/
|
[obs-studio]: https://obsproject.com/
|
||||||
[obs-keyids]: https://github.com/obsproject/obs-studio/blob/master/libobs/obs-hotkeys.h
|
[obs-keyids]: https://github.com/obsproject/obs-studio/blob/master/libobs/obs-hotkeys.h
|
||||||
[rich-doc-envvars]: https://rich.readthedocs.io/en/stable/console.html#environment-variables
|
[no-colour]: https://no-color.org/
|
||||||
|
@ -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.17.1"
|
__version__ = "0.17.5"
|
||||||
|
@ -65,7 +65,7 @@ def list_(
|
|||||||
table.add_row(
|
table.add_row(
|
||||||
filter['filterName'],
|
filter['filterName'],
|
||||||
util.snakecase_to_titlecase(filter['filterKind']),
|
util.snakecase_to_titlecase(filter['filterKind']),
|
||||||
':white_heavy_check_mark:' if filter['filterEnabled'] else ':x:',
|
util.check_mark(filter['filterEnabled']),
|
||||||
'\n'.join(
|
'\n'.join(
|
||||||
[
|
[
|
||||||
f'{util.snakecase_to_titlecase(k):<20} {v:>10}'
|
f'{util.snakecase_to_titlecase(k):<20} {v:>10}'
|
||||||
|
@ -5,7 +5,7 @@ from typing import Annotated, Optional
|
|||||||
import typer
|
import typer
|
||||||
from rich.table import Table
|
from rich.table import Table
|
||||||
|
|
||||||
from . import console, validate
|
from . import console, util, validate
|
||||||
from .alias import AliasGroup
|
from .alias import AliasGroup
|
||||||
from .protocols import DataclassProtocol
|
from .protocols import DataclassProtocol
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ def list_(
|
|||||||
table.add_row(
|
table.add_row(
|
||||||
str(item_id),
|
str(item_id),
|
||||||
group_name,
|
group_name,
|
||||||
':white_heavy_check_mark:' if is_enabled else ':x:',
|
util.check_mark(is_enabled),
|
||||||
)
|
)
|
||||||
|
|
||||||
console.out.print(table)
|
console.out.print(table)
|
||||||
|
@ -81,7 +81,7 @@ def list_(
|
|||||||
input_mark = ''
|
input_mark = ''
|
||||||
try:
|
try:
|
||||||
input_muted = ctx.obj.get_input_mute(name=input_name).input_muted
|
input_muted = ctx.obj.get_input_mute(name=input_name).input_muted
|
||||||
input_mark = ':white_heavy_check_mark:' if input_muted else ':x:'
|
input_mark = util.check_mark(input_muted)
|
||||||
except obsws.error.OBSSDKRequestError as e:
|
except obsws.error.OBSSDKRequestError as e:
|
||||||
if e.code == 604: # Input does not support audio
|
if e.code == 604: # Input does not support audio
|
||||||
input_mark = 'N/A'
|
input_mark = 'N/A'
|
||||||
|
@ -5,7 +5,7 @@ from typing import Annotated
|
|||||||
import typer
|
import typer
|
||||||
from rich.table import Table
|
from rich.table import Table
|
||||||
|
|
||||||
from . import console, validate
|
from . import console, util, validate
|
||||||
from .alias import AliasGroup
|
from .alias import AliasGroup
|
||||||
|
|
||||||
app = typer.Typer(cls=AliasGroup)
|
app = typer.Typer(cls=AliasGroup)
|
||||||
@ -32,7 +32,7 @@ def list_(ctx: typer.Context):
|
|||||||
for profile in resp.profiles:
|
for profile in resp.profiles:
|
||||||
table.add_row(
|
table.add_row(
|
||||||
profile,
|
profile,
|
||||||
':white_heavy_check_mark:' if profile == resp.current_profile_name else '',
|
util.check_mark(profile == resp.current_profile_name, empty_if_false=True),
|
||||||
)
|
)
|
||||||
|
|
||||||
console.out.print(table)
|
console.out.print(table)
|
||||||
|
@ -5,7 +5,7 @@ from typing import Annotated
|
|||||||
import typer
|
import typer
|
||||||
from rich.table import Table
|
from rich.table import Table
|
||||||
|
|
||||||
from . import console, validate
|
from . import console, util, validate
|
||||||
from .alias import AliasGroup
|
from .alias import AliasGroup
|
||||||
|
|
||||||
app = typer.Typer(cls=AliasGroup)
|
app = typer.Typer(cls=AliasGroup)
|
||||||
@ -48,20 +48,20 @@ def list_(
|
|||||||
|
|
||||||
for scene_name, scene_uuid in scenes:
|
for scene_name, scene_uuid in scenes:
|
||||||
if scene_name == active_scene:
|
if scene_name == active_scene:
|
||||||
scene_output = f'[bold green]{scene_name}[/bold green]'
|
scene_output = f'[bold]{scene_name}[/bold]'
|
||||||
else:
|
else:
|
||||||
scene_output = f'[dim]{scene_name}[/dim]'
|
scene_output = f'[dim]{scene_name}[/dim]'
|
||||||
|
|
||||||
if uuid:
|
if uuid:
|
||||||
table.add_row(
|
table.add_row(
|
||||||
scene_output,
|
scene_output,
|
||||||
':white_heavy_check_mark:' if scene_name == active_scene else '',
|
util.check_mark(scene_name == active_scene, empty_if_false=True),
|
||||||
scene_uuid,
|
scene_uuid,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
table.add_row(
|
table.add_row(
|
||||||
scene_output,
|
scene_output,
|
||||||
':white_heavy_check_mark:' if scene_name == active_scene else '',
|
util.check_mark(scene_name == active_scene, empty_if_false=True),
|
||||||
)
|
)
|
||||||
|
|
||||||
console.out.print(table)
|
console.out.print(table)
|
||||||
|
@ -5,7 +5,7 @@ from typing import Annotated, Optional
|
|||||||
import typer
|
import typer
|
||||||
from rich.table import Table
|
from rich.table import Table
|
||||||
|
|
||||||
from . import console, validate
|
from . import console, util, validate
|
||||||
from .alias import AliasGroup
|
from .alias import AliasGroup
|
||||||
|
|
||||||
app = typer.Typer(cls=AliasGroup)
|
app = typer.Typer(cls=AliasGroup)
|
||||||
@ -102,9 +102,7 @@ def list_(
|
|||||||
str(group_item_id),
|
str(group_item_id),
|
||||||
group_item_name,
|
group_item_name,
|
||||||
item_name,
|
item_name,
|
||||||
':white_heavy_check_mark:'
|
util.check_mark(is_enabled and group_item_enabled),
|
||||||
if is_enabled and group_item_enabled
|
|
||||||
else ':x:',
|
|
||||||
group_item_source_uuid,
|
group_item_source_uuid,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
@ -112,9 +110,7 @@ def list_(
|
|||||||
str(group_item_id),
|
str(group_item_id),
|
||||||
group_item_name,
|
group_item_name,
|
||||||
item_name,
|
item_name,
|
||||||
':white_heavy_check_mark:'
|
util.check_mark(is_enabled and group_item_enabled),
|
||||||
if is_enabled and group_item_enabled
|
|
||||||
else ':x:',
|
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
if uuid:
|
if uuid:
|
||||||
@ -122,7 +118,7 @@ def list_(
|
|||||||
str(item_id),
|
str(item_id),
|
||||||
item_name,
|
item_name,
|
||||||
'',
|
'',
|
||||||
':white_heavy_check_mark:' if is_enabled else ':x:',
|
util.check_mark(is_enabled),
|
||||||
source_uuid,
|
source_uuid,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
@ -130,7 +126,7 @@ def list_(
|
|||||||
str(item_id),
|
str(item_id),
|
||||||
item_name,
|
item_name,
|
||||||
'',
|
'',
|
||||||
':white_heavy_check_mark:' if is_enabled else ':x:',
|
util.check_mark(is_enabled),
|
||||||
)
|
)
|
||||||
|
|
||||||
console.out.print(table)
|
console.out.print(table)
|
||||||
|
@ -1,6 +1,18 @@
|
|||||||
"""module contains utility functions for the obsws_cli package."""
|
"""module contains utility functions for the obsws_cli package."""
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
def snakecase_to_titlecase(snake_str):
|
|
||||||
|
def snakecase_to_titlecase(snake_str: str) -> str:
|
||||||
"""Convert a snake_case string to a title case string."""
|
"""Convert a snake_case string to a title case string."""
|
||||||
return snake_str.replace('_', ' ').title()
|
return snake_str.replace('_', ' ').title()
|
||||||
|
|
||||||
|
|
||||||
|
def check_mark(value: bool, empty_if_false: bool = False) -> str:
|
||||||
|
"""Return a check mark or cross mark based on the boolean value."""
|
||||||
|
if empty_if_false and not value:
|
||||||
|
return ''
|
||||||
|
|
||||||
|
if os.getenv('NO_COLOR', '') != '':
|
||||||
|
return '✓' if value else '✗'
|
||||||
|
return '✅' if value else '❌'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user