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

Separate action for longtap when phone is locked #5

Open
equeim opened this issue Aug 23, 2014 · 4 comments
Open

Separate action for longtap when phone is locked #5

equeim opened this issue Aug 23, 2014 · 4 comments

Comments

@equeim
Copy link

equeim commented Aug 23, 2014

In cyanogenmod there is an option to pause the music player on power button long tap. I can write .desktop file, but I want to execute it only when screen is off.

@CODeRUS
Copy link
Owner

CODeRUS commented Aug 23, 2014

i can only make separate application when phone is locked and when it's not locked, not separate action itself

@equeim
Copy link
Author

equeim commented Aug 23, 2014

Do you mean check if the phone is locked in bash script (and set .desktop file as application)?

@equeim
Copy link
Author

equeim commented Aug 23, 2014

It seems that I've solved this issue :D
This script for longtap action will pause music if screen is off or show power menu of screen is on.

#!/bin/bash
status=$(cat /sys/power/wait_for_fb_status)
if [ "$status" == "off" ]; then
    dbus-send --session --type=method_call --dest=com.jolla.mediaplayer.remotecontrol /com/jolla/mediaplayer/remotecontrol com.jolla.mediaplayer.remotecontrol.Interface.executeCommand string:"toggle_pause"
else
    dbus-send --session --type=method_call --dest=com.jolla.lipstick.PowerMenuDialog /org/coderus/powermenu com.jolla.lipstick.PowerMenuDialogIf.openDialog
fi

Could you add possibility to set actions for volume buttons long tap (e.g. to change tracks)?

@CODeRUS
Copy link
Owner

CODeRUS commented Aug 24, 2014

No, volume butons can't be overriden this way :)

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

No branches or pull requests

2 participants