2022-02-21 22:38:53 +01:00
|
|
|
_scrcpy() {
|
|
|
|
|
local cur prev words cword
|
|
|
|
|
local opts="
|
|
|
|
|
--always-on-top
|
2024-11-15 19:17:04 +01:00
|
|
|
--angle
|
2023-02-18 18:32:43 +01:00
|
|
|
--audio-bit-rate=
|
2023-03-14 23:40:48 +01:00
|
|
|
--audio-buffer=
|
2023-02-18 19:05:43 +01:00
|
|
|
--audio-codec=
|
2023-02-22 22:48:23 +01:00
|
|
|
--audio-codec-options=
|
2024-07-16 20:56:18 +02:00
|
|
|
--audio-dup
|
2023-02-19 20:20:29 +01:00
|
|
|
--audio-encoder=
|
2023-05-30 21:29:05 +02:00
|
|
|
--audio-source=
|
2023-03-13 09:23:02 +01:00
|
|
|
--audio-output-buffer=
|
2023-02-21 19:56:44 +01:00
|
|
|
-b --video-bit-rate=
|
2023-10-26 23:54:34 +02:00
|
|
|
--camera-ar=
|
2023-07-16 17:07:19 +08:00
|
|
|
--camera-id=
|
2023-07-22 17:17:05 +08:00
|
|
|
--camera-facing=
|
2023-10-27 20:20:19 -04:00
|
|
|
--camera-fps=
|
2023-10-27 20:20:19 -04:00
|
|
|
--camera-high-speed
|
2023-07-16 17:07:19 +08:00
|
|
|
--camera-size=
|
Add --capture-orientation
Deprecate --lock-video-orientation in favor of a more general option
--capture-orientation, which supports all possible orientations
(0, 90, 180, 270, flip0, flip90, flip180, flip270), and a "locked" flag
via a '@' prefix.
All the old "locked video orientations" are supported:
- --lock-video-orientation -> --capture-orientation=@
- --lock-video-orientation=0 -> --capture-orientation=@0
- --lock-video-orientation=90 -> --capture-orientation=@90
- --lock-video-orientation=180 -> --capture-orientation=@180
- --lock-video-orientation=270 -> --capture-orientation=@270
In addition, --capture-orientation can rotate/flip the display without
locking, so that it follows the physical device rotation.
For example:
scrcpy --capture-orientation=flip90
always flips and rotates the capture by 90° clockwise.
The arguments are consistent with --display-orientation and
--record-orientation and --orientation (which provide separate
client-side orientation settings).
Refs #4011 <https://github.com/Genymobile/scrcpy/issues/4011>
PR #5455 <https://github.com/Genymobile/scrcpy/pull/5455>
2024-11-14 20:19:40 +01:00
|
|
|
--capture-orientation=
|
2022-02-21 22:38:53 +01:00
|
|
|
--crop=
|
|
|
|
|
-d --select-usb
|
|
|
|
|
--disable-screensaver
|
2023-11-20 13:09:46 +01:00
|
|
|
--display-id=
|
2023-11-19 01:06:59 +01:00
|
|
|
--display-orientation=
|
2022-02-21 22:38:53 +01:00
|
|
|
-e --select-tcpip
|
2023-06-01 09:52:35 +02:00
|
|
|
-f --fullscreen
|
2022-02-21 22:38:53 +01:00
|
|
|
--force-adb-forward
|
2024-09-06 23:08:08 +02:00
|
|
|
-G
|
2024-09-06 23:08:08 +02:00
|
|
|
--gamepad=
|
2022-02-21 22:38:53 +01:00
|
|
|
-h --help
|
2024-02-25 18:35:52 +01:00
|
|
|
-K
|
2023-11-28 17:17:35 +08:00
|
|
|
--keyboard=
|
2023-06-05 19:48:21 +02:00
|
|
|
--kill-adb-on-close
|
2022-02-21 22:38:53 +01:00
|
|
|
--legacy-paste
|
2024-10-19 17:16:08 +02:00
|
|
|
--list-apps
|
2023-10-24 23:46:56 +02:00
|
|
|
--list-camera-sizes
|
2023-07-16 17:07:19 +08:00
|
|
|
--list-cameras
|
2023-02-23 23:10:15 +01:00
|
|
|
--list-displays
|
2023-02-22 23:15:15 +01:00
|
|
|
--list-encoders
|
2022-02-21 22:38:53 +01:00
|
|
|
-m --max-size=
|
2024-02-25 18:35:52 +01:00
|
|
|
-M
|
2023-06-01 09:52:35 +02:00
|
|
|
--max-fps=
|
2023-11-28 17:17:35 +08:00
|
|
|
--mouse=
|
2024-06-24 23:07:08 +02:00
|
|
|
--mouse-bind=
|
2023-06-01 09:52:35 +02:00
|
|
|
-n --no-control
|
|
|
|
|
-N --no-playback
|
2024-10-12 09:23:31 +02:00
|
|
|
--new-display
|
|
|
|
|
--new-display=
|
2023-02-03 16:27:34 +01:00
|
|
|
--no-audio
|
2023-05-24 21:22:31 +02:00
|
|
|
--no-audio-playback
|
2022-02-21 22:38:53 +01:00
|
|
|
--no-cleanup
|
2023-02-22 19:08:24 +01:00
|
|
|
--no-clipboard-autosync
|
2022-02-21 22:38:53 +01:00
|
|
|
--no-downsize-on-error
|
|
|
|
|
--no-key-repeat
|
|
|
|
|
--no-mipmaps
|
2024-06-21 16:54:00 +02:00
|
|
|
--no-mouse-hover
|
2022-04-23 15:08:30 +02:00
|
|
|
--no-power-on
|
2024-11-16 22:45:38 +01:00
|
|
|
--no-vd-system-decorations
|
2023-05-07 12:08:50 +02:00
|
|
|
--no-video
|
2023-05-24 21:22:31 +02:00
|
|
|
--no-video-playback
|
2023-11-20 17:49:04 +01:00
|
|
|
--orientation=
|
2022-02-21 22:38:53 +01:00
|
|
|
--otg
|
|
|
|
|
-p --port=
|
2023-06-29 21:36:52 +02:00
|
|
|
--pause-on-exit
|
|
|
|
|
--pause-on-exit=
|
2022-02-21 22:38:53 +01:00
|
|
|
--power-off-on-close
|
|
|
|
|
--prefer-text
|
|
|
|
|
--print-fps
|
|
|
|
|
--push-target=
|
|
|
|
|
-r --record=
|
2023-06-01 09:52:35 +02:00
|
|
|
--raw-key-events
|
2022-02-21 22:38:53 +01:00
|
|
|
--record-format=
|
2023-11-20 14:02:46 +01:00
|
|
|
--record-orientation=
|
2022-02-21 22:38:53 +01:00
|
|
|
--render-driver=
|
2023-02-28 21:19:43 +01:00
|
|
|
--require-audio
|
2022-02-21 22:38:53 +01:00
|
|
|
--rotation=
|
|
|
|
|
-s --serial=
|
|
|
|
|
-S --turn-screen-off
|
2024-11-03 22:46:21 +01:00
|
|
|
--screen-off-timeout=
|
2023-06-01 09:52:35 +02:00
|
|
|
--shortcut-mod=
|
2024-10-19 18:19:10 +02:00
|
|
|
--start-app=
|
2022-02-21 22:38:53 +01:00
|
|
|
-t --show-touches
|
|
|
|
|
--tcpip
|
|
|
|
|
--tcpip=
|
2023-06-01 18:46:50 +02:00
|
|
|
--time-limit=
|
2022-02-21 22:38:53 +01:00
|
|
|
--tunnel-host=
|
|
|
|
|
--tunnel-port=
|
|
|
|
|
--v4l2-buffer=
|
|
|
|
|
--v4l2-sink=
|
|
|
|
|
-v --version
|
2023-06-01 09:52:35 +02:00
|
|
|
-V --verbosity=
|
2024-10-29 19:09:01 +01:00
|
|
|
--video-buffer=
|
2023-02-20 21:19:36 +01:00
|
|
|
--video-codec=
|
2023-02-21 21:46:34 +01:00
|
|
|
--video-codec-options=
|
2023-02-22 22:44:01 +01:00
|
|
|
--video-encoder=
|
2023-07-16 17:07:19 +08:00
|
|
|
--video-source=
|
2022-02-21 22:38:53 +01:00
|
|
|
-w --stay-awake
|
|
|
|
|
--window-borderless
|
|
|
|
|
--window-title=
|
|
|
|
|
--window-x=
|
|
|
|
|
--window-y=
|
|
|
|
|
--window-width=
|
|
|
|
|
--window-height="
|
|
|
|
|
|
|
|
|
|
_init_completion -s || return
|
|
|
|
|
|
|
|
|
|
case "$prev" in
|
2023-02-20 21:19:36 +01:00
|
|
|
--video-codec)
|
2023-02-21 19:48:28 +01:00
|
|
|
COMPREPLY=($(compgen -W 'h264 h265 av1' -- "$cur"))
|
|
|
|
|
return
|
|
|
|
|
;;
|
2023-02-18 19:05:43 +01:00
|
|
|
--audio-codec)
|
2023-11-07 15:09:47 +03:00
|
|
|
COMPREPLY=($(compgen -W 'opus aac flac raw' -- "$cur"))
|
2023-02-18 19:05:43 +01:00
|
|
|
return
|
|
|
|
|
;;
|
2023-07-16 17:07:19 +08:00
|
|
|
--video-source)
|
|
|
|
|
COMPREPLY=($(compgen -W 'display camera' -- "$cur"))
|
|
|
|
|
return
|
|
|
|
|
;;
|
2023-05-30 21:29:05 +02:00
|
|
|
--audio-source)
|
2024-07-15 10:57:46 +02:00
|
|
|
COMPREPLY=($(compgen -W 'output mic playback' -- "$cur"))
|
2023-05-30 21:29:05 +02:00
|
|
|
return
|
|
|
|
|
;;
|
2023-07-22 17:17:05 +08:00
|
|
|
--camera-facing)
|
|
|
|
|
COMPREPLY=($(compgen -W 'front back external' -- "$cur"))
|
|
|
|
|
return
|
|
|
|
|
;;
|
2023-11-28 17:17:35 +08:00
|
|
|
--keyboard)
|
2023-11-28 17:17:35 +08:00
|
|
|
COMPREPLY=($(compgen -W 'disabled sdk uhid aoa' -- "$cur"))
|
2023-11-28 17:17:35 +08:00
|
|
|
return
|
|
|
|
|
;;
|
|
|
|
|
--mouse)
|
2024-02-25 15:43:36 +01:00
|
|
|
COMPREPLY=($(compgen -W 'disabled sdk uhid aoa' -- "$cur"))
|
2023-11-28 17:17:35 +08:00
|
|
|
return
|
|
|
|
|
;;
|
2024-09-06 23:08:08 +02:00
|
|
|
--gamepad)
|
2024-09-06 23:08:08 +02:00
|
|
|
COMPREPLY=($(compgen -W 'disabled uhid aoa' -- "$cur"))
|
2024-09-06 23:08:08 +02:00
|
|
|
return
|
|
|
|
|
;;
|
Add --capture-orientation
Deprecate --lock-video-orientation in favor of a more general option
--capture-orientation, which supports all possible orientations
(0, 90, 180, 270, flip0, flip90, flip180, flip270), and a "locked" flag
via a '@' prefix.
All the old "locked video orientations" are supported:
- --lock-video-orientation -> --capture-orientation=@
- --lock-video-orientation=0 -> --capture-orientation=@0
- --lock-video-orientation=90 -> --capture-orientation=@90
- --lock-video-orientation=180 -> --capture-orientation=@180
- --lock-video-orientation=270 -> --capture-orientation=@270
In addition, --capture-orientation can rotate/flip the display without
locking, so that it follows the physical device rotation.
For example:
scrcpy --capture-orientation=flip90
always flips and rotates the capture by 90° clockwise.
The arguments are consistent with --display-orientation and
--record-orientation and --orientation (which provide separate
client-side orientation settings).
Refs #4011 <https://github.com/Genymobile/scrcpy/issues/4011>
PR #5455 <https://github.com/Genymobile/scrcpy/pull/5455>
2024-11-14 20:19:40 +01:00
|
|
|
--capture-orientation)
|
|
|
|
|
COMPREPLY=($(compgen -W '0 90 180 270 flip0 flip90 flip180 flip270 @0 @90 @180 @270 @flip0 @flip90 @flip180 @flip270' -- "$cur"))
|
|
|
|
|
return
|
|
|
|
|
;;
|
2023-12-14 21:21:57 +05:30
|
|
|
--orientation|--display-orientation)
|
2023-12-14 21:25:32 +05:30
|
|
|
COMPREPLY=($(compgen -W '0 90 180 270 flip0 flip90 flip180 flip270' -- "$cur"))
|
2023-11-19 01:06:59 +01:00
|
|
|
return
|
|
|
|
|
;;
|
2023-11-20 14:02:46 +01:00
|
|
|
--record-orientation)
|
2023-12-14 21:25:32 +05:30
|
|
|
COMPREPLY=($(compgen -W '0 90 180 270' -- "$cur"))
|
2023-11-20 14:02:46 +01:00
|
|
|
return
|
|
|
|
|
;;
|
2023-06-29 21:36:52 +02:00
|
|
|
--pause-on-exit)
|
|
|
|
|
COMPREPLY=($(compgen -W 'true false if-error' -- "$cur"))
|
|
|
|
|
return
|
|
|
|
|
;;
|
2022-02-21 22:38:53 +01:00
|
|
|
-r|--record)
|
|
|
|
|
COMPREPLY=($(compgen -f -- "$cur"))
|
|
|
|
|
return
|
|
|
|
|
;;
|
|
|
|
|
--record-format)
|
2023-11-13 09:35:18 +01:00
|
|
|
COMPREPLY=($(compgen -W 'mp4 mkv m4a mka opus aac flac wav' -- "$cur"))
|
2022-02-21 22:38:53 +01:00
|
|
|
return
|
|
|
|
|
;;
|
|
|
|
|
--render-driver)
|
|
|
|
|
COMPREPLY=($(compgen -W 'direct3d opengl opengles2 opengles metal software' -- "$cur"))
|
|
|
|
|
return
|
|
|
|
|
;;
|
|
|
|
|
--shortcut-mod)
|
|
|
|
|
# Only auto-complete a single key
|
|
|
|
|
COMPREPLY=($(compgen -W 'lctrl rctrl lalt ralt lsuper rsuper' -- "$cur"))
|
|
|
|
|
return
|
|
|
|
|
;;
|
|
|
|
|
-V|--verbosity)
|
|
|
|
|
COMPREPLY=($(compgen -W 'verbose debug info warn error' -- "$cur"))
|
|
|
|
|
return
|
|
|
|
|
;;
|
2022-10-07 11:23:59 -03:00
|
|
|
-s|--serial)
|
|
|
|
|
# Use 'adb devices' to list serial numbers
|
|
|
|
|
COMPREPLY=($(compgen -W "$("${ADB:-adb}" devices | awk '$2 == "device" {print $1}')" -- ${cur}))
|
|
|
|
|
return
|
|
|
|
|
;;
|
2023-03-14 23:45:08 +01:00
|
|
|
--audio-bit-rate \
|
|
|
|
|
|--audio-buffer \
|
|
|
|
|
|-b|--video-bit-rate \
|
|
|
|
|
|--audio-codec-options \
|
|
|
|
|
|--audio-encoder \
|
2023-03-13 09:23:02 +01:00
|
|
|
|--audio-output-buffer \
|
2023-10-26 23:54:34 +02:00
|
|
|
|--camera-ar \
|
2023-07-16 17:07:19 +08:00
|
|
|
|--camera-id \
|
2023-10-27 20:20:19 -04:00
|
|
|
|--camera-fps \
|
2023-07-16 17:07:19 +08:00
|
|
|
|--camera-size \
|
2022-02-21 22:38:53 +01:00
|
|
|
|--crop \
|
2023-10-26 22:57:00 +02:00
|
|
|
|--display-id \
|
2022-02-21 22:38:53 +01:00
|
|
|
|--max-fps \
|
|
|
|
|
|-m|--max-size \
|
2024-11-20 07:45:15 +01:00
|
|
|
|--new-display \
|
2022-02-21 22:38:53 +01:00
|
|
|
|-p|--port \
|
|
|
|
|
|--push-target \
|
2023-03-14 23:45:08 +01:00
|
|
|
|--rotation \
|
2022-02-21 22:38:53 +01:00
|
|
|
|--tunnel-host \
|
|
|
|
|
|--tunnel-port \
|
|
|
|
|
|--v4l2-buffer \
|
|
|
|
|
|--v4l2-sink \
|
2024-10-29 19:09:01 +01:00
|
|
|
|--video-buffer \
|
2023-03-14 23:45:08 +01:00
|
|
|
|--video-codec-options \
|
|
|
|
|
|--video-encoder \
|
2022-02-21 22:38:53 +01:00
|
|
|
|--tcpip \
|
|
|
|
|
|--window-*)
|
|
|
|
|
# Option accepting an argument, but nothing to auto-complete
|
|
|
|
|
return
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
COMPREPLY=($(compgen -W "$opts" -- "$cur"))
|
|
|
|
|
[[ $COMPREPLY == *= ]] && compopt -o nospace
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
complete -F _scrcpy scrcpy
|