The Wayback Machine - https://web.archive.org/web/20200803125647/https://github.com/Genymobile/scrcpy/pull/296
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop entry file for Linux app launchers (resolves #295) #296

Open
wants to merge 1 commit into
base: master
from

Conversation

@asnelling
Copy link

asnelling commented Oct 14, 2018

Adds the ability to launch scrcpy using your preferred application launcher on Linux.

See: https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

Copy link
Collaborator

rom1v left a comment

Cool 👍 Comments inline.

One small drawback is that scrcpy uses the terminal to output info and error, and there is no terminal when started from the menu (but it's like on Windows then).

@@ -143,6 +143,12 @@ endif

executable('scrcpy', src, dependencies: dependencies, include_directories: src_dir, install: true, c_args: c_args, link_args: link_args)

# Desktop entry file for application launchers
if host_machine.system() == 'linux'
# -> /usr/share/applications/scrcpy.desktop

This comment has been minimized.

Copy link
@rom1v

rom1v Oct 14, 2018

Collaborator

(by default /usr/local/share/applications/scrcpy.desktop, but you can keep this comment as is, it's explicit enough)

GenericName=Android Remote Control
Comment=Display and control your Android device
Exec=scrcpy
Icon=gparted

This comment has been minimized.

Copy link
@rom1v

rom1v Oct 14, 2018

Collaborator

scrcpy

gparted icon does not really fit scrcpy. Unfortunately, I didn't find any existing icon that could fit. Maybe we should add an Android icon?

This comment has been minimized.

Copy link
@srevinsaju

srevinsaju Aug 27, 2019

You can use this icon guiscrcpy, which I created for guiscrcpy. I licensed it under Creative Commons Attributions 4.0, so you can easily reuse it.

Name=scrcpy
GenericName=Android Remote Control
Comment=Display and control your Android device
Exec=scrcpy

This comment has been minimized.

Copy link
@rom1v

rom1v Oct 14, 2018

Collaborator

At first, it did not work for me.

To get the error, I changed to:

Exec=bash -c "scrcpy &> /tmp/log"

And /tmp/log contained:

exec: No such file or directory
ERROR: 'adb' command not found (make it accessible from your PATH or define its full path in the ADB environment variable)
ERROR: Could not execute "adb push"

In fact, the adb directory is added in PATH in my .bashrc, so it's not in PATH when the session is started, so starting it for the menu does not work in that case.

In practice, do you use the android-tools-adb package, or did you put your adb directory in PATH from somewhere else?

This comment has been minimized.

Copy link
@npes87184

npes87184 Jan 19, 2019

Contributor

I add the file in /usr/share/applications/scrcpy.desktop with content:

[Desktop Entry]
Name=scrcpy
GenericName=Android Remote Control
Comment=Display and control your Android device
Exec=scrcpy
Icon=gparted
Terminal=false
Type=Application
Categories=Utility;RemoteAccess;
StartupNotify=false

After it, click the icon from menu. Scrcpy starts as expected.

This comment has been minimized.

Copy link
@npes87184

npes87184 Jan 24, 2019

Contributor

@rom1v

Maybe you can try to change Exec to echo $PATH > /tmp/path_out and execute again to get more info for debugging.

@srevinsaju
Copy link

srevinsaju commented Aug 27, 2019

If you add this code as scrcpy.VisualElements.xml, you can get that customized Windows Start Menu Effect, as you see for OneNote Tiles etc..

This is the one I used for the Windows version of guiscrcpy
<?xml version="1.0" encoding="utf-8"?> <Application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > <VisualElements ShowNameOnSquare150x150Logo="off" Square150x150Logo="VisualElements\MediumIconguiscrcpy.png" Square70x70Logo="VisualElements\SmallIconguiscrcpy.png" ForegroundText="light" BackgroundColor="#00FED0" />

Hope it helps..

@unclehowell
Copy link

unclehowell commented Oct 16, 2019

In my experience its better to have the .Desktop run a script which resets network adaptors and establishes connection with the android first. In the script the correct screen size and connection speed can be set and appropriate sleep times between commands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.