Skip to content

Instantly share code, notes, and snippets.

@mikeyjk
Last active August 29, 2015 14:14
Show Gist options
  • Save mikeyjk/b9c1bc4709d757d740b0 to your computer and use it in GitHub Desktop.
Save mikeyjk/b9c1bc4709d757d740b0 to your computer and use it in GitHub Desktop.
Silent Mode for Android Lollipop (requires root access and Tasker application)
disable = shell("chmod 044 sys/class/timed_output/vibrator/enable", true, 0);
enable = shell("chmod 777 sys/class/timed_output/vibrator/enable", true, 0);
@mikeyjk
Copy link
Author

mikeyjk commented Jan 30, 2015

Can't figure out a good way of invoking it.
Currently the way I am doing this is on any notification being received:

If %SILENT eq vibrate
// suppress vibrate
Else
// enable vibrate

The issue is that there is a race condition between the vibrating notification and the shell chmod command (and the notification will win every time).

I could always just set a timer to check every 2 minutes, or have a widget. But neither of those are very fun!

I haven't googled extensively so this could already have a resolution.

Source: http://a3nm.net/blog/android_cli.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment