added client dnd options

This commit is contained in:
draxaris1010 2026-02-15 14:42:13 +01:00
parent 2905efc94e
commit 6ab759c09c
No known key found for this signature in database
8 changed files with 18 additions and 0 deletions

View file

@ -25,6 +25,7 @@ _scrcpy() {
--display-id=
--display-ime-policy=
--display-orientation=
--do-not-disturb
-e --select-tcpip
-f --fullscreen
--force-adb-forward

View file

@ -32,6 +32,7 @@ arguments=(
'--display-id=[Specify the display id to mirror]'
'--display-ime-policy[Set the policy for selecting where the IME should be displayed]'
'--display-orientation=[Set the initial display orientation]:orientation values:(0 90 180 270 flip0 flip90 flip180 flip270)'
'--do-not-disturb[Enable Do Not Disturb]'
{-e,--select-tcpip}'[Use TCP/IP device]'
{-f,--fullscreen}'[Start in fullscreen]'
'--force-adb-forward[Do not attempt to use \"adb reverse\" to connect to the device]'

View file

@ -114,6 +114,7 @@ enum {
OPT_NO_VD_SYSTEM_DECORATIONS,
OPT_NO_VD_DESTROY_CONTENT,
OPT_DISPLAY_IME_POLICY,
OPT_DO_NOT_DISTURB,
};
struct sc_option {
@ -409,6 +410,11 @@ static const struct sc_option options[] = {
"before the rotation.\n"
"Default is 0.",
},
{
.longopt_id = OPT_DO_NOT_DISTURB,
.longopt = "do-not-disturb",
.text = "Enable Do Not Disturb",
},
{
.shortopt = 'e',
.longopt = "select-tcpip",
@ -2821,6 +2827,9 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
return false;
}
break;
case OPT_DO_NOT_DISTURB:
opts->do_not_disturb = true;
break;
default:
// getopt prints the error message on stderr
return false;

View file

@ -113,6 +113,7 @@ const struct scrcpy_options scrcpy_options_default = {
.angle = NULL,
.vd_destroy_content = true,
.vd_system_decorations = true,
.do_not_disturb = false,
};
enum sc_orientation

View file

@ -314,6 +314,7 @@ struct scrcpy_options {
bool require_audio;
bool kill_adb_on_close;
bool camera_high_speed;
bool do_not_disturb;
#define SC_OPTION_LIST_ENCODERS 0x1
#define SC_OPTION_LIST_DISPLAYS 0x2
#define SC_OPTION_LIST_CAMERAS 0x4

View file

@ -453,6 +453,7 @@ scrcpy(struct scrcpy_options *options) {
.audio_dup = options->audio_dup,
.show_touches = options->show_touches,
.stay_awake = options->stay_awake,
.do_not_disturb = options->do_not_disturb,
.video_codec_options = options->video_codec_options,
.audio_codec_options = options->audio_codec_options,
.video_encoder = options->video_encoder,

View file

@ -360,6 +360,9 @@ execute_server(struct sc_server *server,
if (params->show_touches) {
ADD_PARAM("show_touches=true");
}
if (params->do_not_disturb) {
ADD_PARAM("do_not_disturb=true");
}
if (params->stay_awake) {
ADD_PARAM("stay_awake=true");
}

View file

@ -56,6 +56,7 @@ struct sc_server_params {
bool audio_dup;
bool show_touches;
bool stay_awake;
bool do_not_disturb;
bool force_adb_forward;
bool power_off_on_close;
bool clipboard_autosync;