![]() |
Vibration feedback on-demand with wrapper scripts?
I apologize for asking this when I could probably read through the docs^Wsource and find out for myself, but I'm in the middle of exams, and this has been bugging me for a while. I generally keep screen vibration feedback turned off for both power reasons and the annoyance of it, but it is really useful for calculator apps, such as Free42 and ATI85, which I use in many classes. What I'm wondering is if there's a script-friendly way (e.g. D-Bus call or something) to enable and disable that feedback feature, so that I could launch certain apps through a wrapper script that enables it on program start, and disables it when I close the program.
Any pointers would be appreciated. Thanks, |
Re: Vibration feedback on-demand with wrapper scripts?
"gconftool -t bool /system/osso/dsm/vibra/touchscreen_vibra_enabled -s true" works for me to enable the vibration when touching the screen. And, of course, setting it to false to disable it works. :)
|
Re: Vibration feedback on-demand with wrapper scripts?
Awesome! That's exactly what I was looking for, but I didn't know where it was configured, or which component controlled it. Thanks a lot - now back to studying ;)
|
Re: Vibration feedback on-demand with wrapper scripts?
I finally got around to trying this while waiting for pizza at a friend's birthday dinner. :)
Anyhow, I made a simple wrapper script, which essentially calls the gconf commands to enable vibra, runs the command passed to it, and then switches off vibra similarly. I then edited the .desktop files for ATI85 and Free42 so that the Exec lines ran the wrapper (placed in /usr/bin with appropriate permissions) with the original command line (quoted if necessary) as the first argument. However, it does not work properly, for some reason. If I launch it from the menu (Catorize), it will run the application, but vibration feedback will not be enabled; if I run the identical command as the Exec line manually from the shell, it works perfectly. I can post the exact code here a bit later if needed, but the script is trivial. I was curious if Catorize or the .desktop tools are doing some voodoo in the background that I'm not aware of. Specifically, does the Exec command get executed in the same environment, and as the same user, as when I run it manually from X-Terminal/Ash? Assuming that the .desktop file is being parsed and handled as it should be, then the gconf commands should be executed. If that is the case, then I'm not entirely sure why they are ineffective. Any ideas? |
Re: Vibration feedback on-demand with wrapper scripts?
Quote:
|
Re: Vibration feedback on-demand with wrapper scripts?
Quote:
Free42's says "=com.tajuma.freefourtwo", and ATI85's says "=com.fms.ati85" I assume these are D-Bus bus names? |
Re: Vibration feedback on-demand with wrapper scripts?
Quote:
If that doesn't work, you have two options:
|
Re: Vibration feedback on-demand with wrapper scripts?
Quote:
Awesome - I'll post back when I get it working... or not. ;) |
Re: Vibration feedback on-demand with wrapper scripts?
Editing the .service files works perfectly. Thanks.
For others' reference, here is the wrapper script I used: Code:
#!/bin/sh Now, I would note that this script is pretty poor in that exiting one application called through it while running another similarly launched application will disable the vibration feedback. I don't have the time to improve it right now, but I'd encourage someone else to do so, and post it here. :) Cheers, |
All times are GMT. The time now is 16:34. |
vBulletin® Version 3.8.8