diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..e00ad77 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +name: Publish package + +on: + push + +jobs: + build-nodejs-deb: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install Dependencies + run: sudo apt install dpkg ffmpeg libsdl2-2.0-0 adb wget \ + gcc git pkg-config meson ninja-build libsdl2-dev \ + libavcodec-dev libavdevice-dev libavformat-dev libavutil-dev \ + libswresample-dev libusb-1.0-0 libusb-1.0-0-dev + + - name: Build Deb File + run: | + bash build.sh + + - name: Automatic Release + uses: marvinpinto/action-automatic-releases@latest + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "2.7" + prerelease: false + title: "Latest Build 2.7" + files: | + *.deb diff --git a/DEBIAN/control b/DEBIAN/control new file mode 100644 index 0000000..0126a93 --- /dev/null +++ b/DEBIAN/control @@ -0,0 +1,16 @@ +Package: scrcpy +Source: scrcpy +Version: 2.7 +Architecture: amd64 +Maintainer: jakbin4747@gmail.com +Installed-Size: 203 +Depends: libavcodec60 (>= 7:6.0), libavdevice60 (>= 7:6.0), libavformat60 (>= 7:6.0), libavutil58 (>= 7:6.0), libc6 (>= 2.34), libsdl2-2.0-0 (>= 2.0.12), libusb-1.0-0 (>= 2:1.0.16) +Recommends: adb +Section: net +Priority: optional +Homepage: https://github.com/Genymobile/scrcpy +Description: Display and control your Android device + This application provides display and control of Android devices connected on + USB (or over TCP/IP). It does not require any root access. + . + This package contains the client (desktop) binary. diff --git a/DEBIAN/md5sums b/DEBIAN/md5sums new file mode 100644 index 0000000..2285a5f --- /dev/null +++ b/DEBIAN/md5sums @@ -0,0 +1,11 @@ +141fab94056e5bcbdd5fecdd6622efa4 usr/bin/scrcpy +bcb1a9711594fb345fb6e63c90dd9591 usr/share/applications/scrcpy-console.desktop +236aae66e805c99cbde850339d97ecb5 usr/share/applications/scrcpy.desktop +8707652b2649f3799ae4be1318c9ead8 usr/share/bash-completion/completions/scrcpy +3eb37f2adf4f01091b422f9906f6daed usr/share/doc/scrcpy/changelog.Debian.amd64.gz +f83fde543210c8cb6dd310113cd67c33 usr/share/doc/scrcpy/changelog.Debian.gz +62fa2452695f764645adda5bf180ff00 usr/share/doc/scrcpy/copyright +9e1ffbd6d2630c3b89be2b9c19c29e8f usr/share/icons/hicolor/256x256/apps/scrcpy.png +7980db345a5089ecfdd6aac626eb5890 usr/share/lintian/overrides/scrcpy +2eee0beff15c7c1acc59a56fb285bb19 usr/share/man/man1/scrcpy.1.gz +51d4bbc4f3ee6950ce6a4bfb58bb1ef7 usr/share/zsh/site-functions/_scrcpy diff --git a/README.md b/README.md index efa286a..68663f0 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # scrcpy-deb + deb file scrcpy tool diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..9e66aae --- /dev/null +++ b/build.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +git clone https://github.com/Genymobile/scrcpy scrcpy-git +cd scrcpy-git +sed -i '21d' install_release.sh +./install_release.sh + +# copy control file +mkdir scrcpy +cp DEBIAN scrcpy/ + +# copy share folder +mkdir scrcpy/usr +cp share scrcpy/usr/ + +# copy scrcpy binary +mkdir scrcpy/bin +cp scrcpy-git/build-auto/app/scrcpy scrcpy/bin/ + +# copy scrcpy server file +mkdir -p /usr/local/share/scrcpy/ +cp scrcpy-git/scrcpy-server /usr/local/share/scrcpy/ + +# build deb file +dpkg -b scrcpy \ No newline at end of file diff --git a/share/applications/scrcpy-console.desktop b/share/applications/scrcpy-console.desktop new file mode 100644 index 0000000..47a63ec --- /dev/null +++ b/share/applications/scrcpy-console.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Name=scrcpy (console) +GenericName=Android Remote Control +Comment=Display and control your Android device +# For some users, the PATH or ADB environment variables are set from the shell +# startup file, like .bashrc or .zshrc… Run an interactive shell to get +# environment correctly initialized. +Exec=/bin/bash --norc --noprofile -i -c '"$SHELL" -i -c scrcpy || read -p "Press any key to quit..."' +Icon=scrcpy +Terminal=true +Type=Application +Categories=Utility;RemoteAccess; +StartupNotify=false diff --git a/share/applications/scrcpy.desktop b/share/applications/scrcpy.desktop new file mode 100644 index 0000000..082b75e --- /dev/null +++ b/share/applications/scrcpy.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Name=scrcpy +GenericName=Android Remote Control +Comment=Display and control your Android device +# For some users, the PATH or ADB environment variables are set from the shell +# startup file, like .bashrc or .zshrc… Run an interactive shell to get +# environment correctly initialized. +Exec=/bin/sh -c '"$SHELL" -i -c scrcpy' +Icon=scrcpy +Terminal=false +Type=Application +Categories=Utility;RemoteAccess; +StartupNotify=false diff --git a/share/bash-completion/completions/scrcpy b/share/bash-completion/completions/scrcpy new file mode 100644 index 0000000..0d3a255 --- /dev/null +++ b/share/bash-completion/completions/scrcpy @@ -0,0 +1,126 @@ +_scrcpy() { + local cur prev words cword + local opts=" + --always-on-top + -b --bit-rate= + --codec-options= + --crop= + -d --select-usb + --disable-screensaver + --display= + --display-buffer= + -e --select-tcpip + --encoder= + --force-adb-forward + --forward-all-clicks + -f --fullscreen + -K --hid-keyboard + -h --help + --legacy-paste + --lock-video-orientation + --lock-video-orientation= + --max-fps= + -M --hid-mouse + -m --max-size= + --no-cleanup + --no-clipboard-on-error + --no-downsize-on-error + -n --no-control + -N --no-display + --no-key-repeat + --no-mipmaps + --no-power-on + --otg + -p --port= + --power-off-on-close + --prefer-text + --print-fps + --push-target= + --raw-key-events + -r --record= + --record-format= + --render-driver= + --rotation= + -s --serial= + --shortcut-mod= + -S --turn-screen-off + -t --show-touches + --tcpip + --tcpip= + --tunnel-host= + --tunnel-port= + --v4l2-buffer= + --v4l2-sink= + -V --verbosity= + -v --version + -w --stay-awake + --window-borderless + --window-title= + --window-x= + --window-y= + --window-width= + --window-height=" + + _init_completion -s || return + + case "$prev" in + --lock-video-orientation) + COMPREPLY=($(compgen -W 'unlocked initial 0 1 2 3' -- "$cur")) + return + ;; + -r|--record) + COMPREPLY=($(compgen -f -- "$cur")) + return + ;; + --record-format) + COMPREPLY=($(compgen -W 'mkv mp4' -- "$cur")) + return + ;; + --render-driver) + COMPREPLY=($(compgen -W 'direct3d opengl opengles2 opengles metal software' -- "$cur")) + return + ;; + --rotation) + COMPREPLY=($(compgen -W '0 1 2 3' -- "$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 + ;; + -s|--serial) + # Use 'adb devices' to list serial numbers + COMPREPLY=($(compgen -W "$("${ADB:-adb}" devices | awk '$2 == "device" {print $1}')" -- ${cur})) + return + ;; + -b|--bitrate \ + |--codec-options \ + |--crop \ + |--display \ + |--display-buffer \ + |--encoder \ + |--max-fps \ + |-m|--max-size \ + |-p|--port \ + |--push-target \ + |--tunnel-host \ + |--tunnel-port \ + |--v4l2-buffer \ + |--v4l2-sink \ + |--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 diff --git a/share/icons/hicolor/256x256/apps/scrcpy.png b/share/icons/hicolor/256x256/apps/scrcpy.png new file mode 100644 index 0000000..b96a1af Binary files /dev/null and b/share/icons/hicolor/256x256/apps/scrcpy.png differ diff --git a/share/zsh/site-functions/_scrcpy b/share/zsh/site-functions/_scrcpy new file mode 100644 index 0000000..56c13fd --- /dev/null +++ b/share/zsh/site-functions/_scrcpy @@ -0,0 +1,70 @@ +#compdef -N scrcpy -N scrcpy.exe +# +# name: scrcpy +# auth: hltdev [hltdev8642@gmail.com] +# desc: completion file for scrcpy (all OSes) +# + +local arguments + +arguments=( + '--always-on-top[Make scrcpy window always on top \(above other windows\)]' + {-b,--bit-rate=}'[Encode the video at the given bit-rate]' + '--codec-options=[Set a list of comma-separated key\:type=value options for the device encoder]' + '--crop=[\[width\:height\:x\:y\] Crop the device screen on the server]' + {-d,--select-usb}'[Use USB device]' + '--disable-screensaver[Disable screensaver while scrcpy is running]' + '--display=[Specify the display id to mirror]' + '--display-buffer=[Add a buffering delay \(in milliseconds\) before displaying]' + {-e,--select-tcpip}'[Use TCP/IP device]' + '--encoder=[Use a specific MediaCodec encoder \(must be a H.264 encoder\)]' + '--force-adb-forward[Do not attempt to use \"adb reverse\" to connect to the device]' + '--forward-all-clicks[Forward clicks to device]' + {-f,--fullscreen}'[Start in fullscreen]' + {-K,--hid-keyboard}'[Simulate a physical keyboard by using HID over AOAv2]' + {-h,--help}'[Print the help]' + '--legacy-paste[Inject computer clipboard text as a sequence of key events on Ctrl+v]' + '--lock-video-orientation=[Lock video orientation]:orientation:(unlocked initial 0 1 2 3)' + '--max-fps=[Limit the frame rate of screen capture]' + {-M,--hid-mouse}'[Simulate a physical mouse by using HID over AOAv2]' + {-m,--max-size=}'[Limit both the width and height of the video to value]' + '--no-cleanup[Disable device cleanup actions on exit]' + '--no-clipboard-autosync[Disable automatic clipboard synchronization]' + '--no-downsize-on-error[Disable lowering definition on MediaCodec error]' + {-n,--no-control}'[Disable device control \(mirror the device in read only\)]' + {-N,--no-display}'[Do not display device \(during screen recording or when V4L2 sink is enabled\)]' + '--no-key-repeat[Do not forward repeated key events when a key is held down]' + '--no-mipmaps[Disable the generation of mipmaps]' + '--no-power-on[Do not power on the device on start]' + '--otg[Run in OTG mode \(simulating physical keyboard and mouse\)]' + {-p,--port=}'[\[port\[\:port\]\] Set the TCP port \(range\) used by the client to listen]' + '--power-off-on-close[Turn the device screen off when closing scrcpy]' + '--prefer-text[Inject alpha characters and space as text events instead of key events]' + '--print-fps[Start FPS counter, to print frame logs to the console]' + '--push-target=[Set the target directory for pushing files to the device by drag and drop]' + '--raw-key-events[Inject key events for all input keys, and ignore text events]' + {-r,--record=}'[Record screen to file]:record file:_files' + '--record-format=[Force recording format]:format:(mp4 mkv)' + '--render-driver=[Request SDL to use the given render driver]:driver name:(direct3d opengl opengles2 opengles metal software)' + '--rotation=[Set the initial display rotation]:rotation values:(0 1 2 3)' + {-s,--serial=}'[The device serial number \(mandatory for multiple devices only\)]:serial:($("${ADB-adb}" devices | awk '\''$2 == "device" {print $1}'\''))' + '--shortcut-mod=[\[key1,key2+key3,...\] Specify the modifiers to use for scrcpy shortcuts]:shortcut mod:(lctrl rctrl lalt ralt lsuper rsuper)' + {-S,--turn-screen-off}'[Turn the device screen off immediately]' + {-t,--show-touches}'[Show physical touches]' + '--tcpip[\(optional \[ip\:port\]\) Configure and connect the device over TCP/IP]' + '--tunnel-host=[Set the IP address of the adb tunnel to reach the scrcpy server]' + '--tunnel-port=[Set the TCP port of the adb tunnel to reach the scrcpy server]' + '--v4l2-buffer=[Add a buffering delay \(in milliseconds\) before pushing frames]' + '--v4l2-sink=[\[\/dev\/videoN\] Output to v4l2loopback device]' + {-V,--verbosity=}'[Set the log level]:verbosity:(verbose debug info warn error)' + {-v,--version}'[Print the version of scrcpy]' + {-w,--stay-awake}'[Keep the device on while scrcpy is running, when the device is plugged in]' + '--window-borderless[Disable window decorations \(display borderless window\)]' + '--window-title=[Set a custom window title]' + '--window-x=[Set the initial window horizontal position]' + '--window-y=[Set the initial window vertical position]' + '--window-width=[Set the initial window width]' + '--window-height=[Set the initial window height]' +) + +_arguments -s $arguments