Customization the functionality of the Moments switch on FP6?

Is there or will there be a more customization on what the Fairphone Moments switch does, or will it just switch between environments?

Example what i what i would customize my Moments switch to do:
When I toggle on the switch it will enable VPN and toggle off the switch to disable VPN
Taking an screenshot when it is toggled on

1 Like

Yes, it is configurable. It has been discussed in other posts here on the forum:

6 Likes

Is there an option/app to fully customize what the switch can do?

Instead of turning on/off “Do Not Disturb”, I would appreciate an option to just switch between normal and vibration.

3 Likes

Hi and welcome to the community forum!

I’ve moved your post here, it’s the same question and here is all we know.

2 Likes

This would really be great. I used the mute switch all the time on my old OnePlus that I replaced with the FP6. I hoped, the FP6 would allow this as well, as it has the necessary hardware. It’s great that you can configure it to DnD and other functions, just a few more options would be appreciated.

thank you - I have missed this thread

1 Like

I would appreciate more options or even a way to fully customize it.

I would use that switch to toggle screen rotation (enable/lock screen rotation … or even to switch between portrait/landscape mode without any automatic rotation)

1 Like

Are there maybe any third-party-solutions available? An app to customize hardware buttons?

Have a look at button Mapper

I just tried. Button couldn’t be detected.

Did someone successfully use button mapper on this button? Maybe it just needs some special settings somewhere?

I also tried keymapper (open source), which also couldn’t detect the switch button.

I even gave them (keymapper) a report about it. Someone already replied that it sounds like an interesting button and they will look forward to have it included, but that will take a while to get it coded into the app.

1 Like

[REQUIRES ROOT]

Hi I came up with a way to integrate the switch with tasker, it’s a little long winded but its still working really well for me:

1: Set the switch to use Fairphone moments in settings

2: Disable the Fairphone moments app, this is needed or it will do your tasker action and open the Fairphone moments app which isn’t very helpful

3: Create a file named switchlisten.sh, I placed it in /data/local/tmp but other locations should work fine. Contents of the file:

#!/system/bin/sh
getevent -l /dev/input/event0 | while read -r line; do
if echo “$line” | grep -q “SW_PEN_INSERTED.*00000001”; then
am broadcast -a com.odgebodge.switch_up
elif echo “$line” | grep -q “SW_PEN_INSERTED.*00000000”; then
am broadcast -a com.odgebodge.switch_down
fi
done

This will listen for the switch’s events (for some reason it’s the pen events, not sure why) you can also change “com.odgebodge” to whatever you want, just make sure it matches in step 5.

4: Set this script to run on boot in tasker, your action should be a run shell action with the following command: '“sh /data/local/tmp/switchlisten.sh” (change this to the path of your script). this MUST be set to use root.

5: create a tasker profile for the up and down action, the profile should be an intent received (in event → search for intent received) with the action set to com.odgebodge.switch_up for up, and com.odgebodge.switch_down for down.

6: reboot your phone to set the script going

7: you can now set the intent received profiles to whatever task you want, in my case I’m using it to enable and disable the mic and cameras

The only problem I can find with this solution is that tasker won’t be able to run other shell commands, but if you aren’t doing that or can set it running using something else then that is fine.

good luck :slight_smile: please let me know how it goes if you try it and if you need any more info

4 Likes