To make up for it a bit, I have proposed a pull request to Jolla.
I added it for my personal use at GitHub - RikudouSage/sailfish-os-patched-mce: Mce patched for SailfishOS to make use of the assistant hardware key but everyone feel free to use it. Itās automatically built using GitHub Actions and downloadable in the Artifacts section of every build (example: Remove arm version Ā· RikudouSage/sailfish-os-patched-mce@b806b59 Ā· GitHub).
As nephros said, donāt just download system stuff without knowing what youāre doing, at the very least check that the build script (sailfish-os-patched-mce/build.yaml at master Ā· RikudouSage/sailfish-os-patched-mce Ā· GitHub) doesnāt do anything shady.
Edit: Added a patchmanager patch that enables using the button as a flashlight toggle.
can this but just be configurable?
One would set it for camera, other one for flashligt, another for that guest account.
It is, unless you enable the patch in patchmanager it works simply as home button.
That would be a nice app or settings menu entry
The patched mce has been updated for latest SFOS version (4.5.0.16). Download for example here.
What I havenāt seen here is an option to immediately start the camera while the phone is on. Or is there a way to?
Also, imho the swipe from lockscreen is too slow for when you really need to get a quick shot.
Can it produce a stripped version? The current non-stripped version boosts the binary by +300 kB or so.
Not sure itās worth the time to lower the size by 300 kB, but if you know how to feel free to create a pull request.
The problem is that for now I actually donāt know how to as I am totally not familiar with all these online tools. Anyway, the non-stripped binary seems to work perfectly fine, so maybe indeed itās not worth the hassleā¦
As mentioned above, there is a PR, and some discussion has happened, and the groundwork of a solution has been laid.
That solution does not need/use MCE, and it can be done on a running device by editing and replacing three files.
After that you have a Camera button, like proposed in the original post.
UPDATE 2: Added process_name
in cfg to handle a pid check to avoid duplicate processes from running. Requires correct cmdline; cfg updated below.
UPDATE: Fixed issue where command will launch immediately after closing if the button was pressed. requires full cmdline.
Hereās a ātestā solution that doesnāt require having a holder and could be run as an independent service: GitHub - Logic-gate/Keymapper at testing. You will need to build libconfig
yourself.
Demo: One Time File
Assist button config; keymap.conf
command; keymapper -s /dev/input/event3
// Not recommended to run keymapper as root,
// Provide full correct-cmdline e.g /usr/bin/invoker -s -n -d 5 --type=silica-media,silica-qt5 -A -- /usr/bin/jolla-camera
// Otherwise the process will never die
name = "TEST CONFING";
keymap = {
assist_button = {
proc = "Camera Starting...";
trigger = 457;
process_name = "/usr/bin/jolla-camera"
cmd = "/usr/bin/invoker -s -n -d 5 --type=silica-media,silica-qt5 -A -- /usr/bin/jolla-camera";
};
};
Hereās an arch64 build of libconfig: 295.8 KB folder on MEGA I am just waiting for @pamoedo to respond before pushing it openrepos.
Hereās the official package: Keymapper | OpenRepos.net ā Community Repository System.
Libconfig has also been added to openrepos here: libconfig ā C/C++ Configuration File Library | OpenRepos.net ā Community Repository System
It works
By the way, how to start flashlight with the button?
You could try something like this
// Not recommended to run keymapper as root,
// Provide full correct-cmdline e.g /usr/bin/invoker -s -n -d 5 --type=silica-media,silica-qt5 -A -- /usr/bin/jolla-camera
// Otherwise the process will never die
name = "TEST CONFING";
keymap = {
assist_button = {
proc = "";
trigger = 457;
process_name = ""
cmd = "dbus-send --type=method_call --print-reply --dest=com.jolla.settings.system.flashlight /com/jolla/settings/system/flashlight com.jolla.settings.system.flashlight.toggleFlashlight";
};
};
Keep in mind that you need to state the process_name if you want to launch applications; the example I used with camera has /usr/bin/jolla-camera
as the process_name yet the actual command to run is from .desktop
. The reason being that we want to block duplicate processes from starting based on the process_name. As for dbus-calls I am not entirely sure.
Nice!!
Also would be good to have systemd .service file ready to enable.
Yeah. I just wanted more people to test it first. I also thought of adding some sort of gui to set the config.
btw, an idea - react to multiple (e.g. 3) subsequent presses in 2-3 seconds (kind of 2nd function for the button)
PS I imagine lots of people would want to have it binded to fingerprint daemon restart.
Time and sequential based triggers are already in TODO