Sunday 13 September 2015

Customizing Sailfish OS - mce tools by Nokia

Below the deck: Introducing Linux terminal and MCE Tools by Nokia, available for Sailfish OS, Meego and Nemo mobile devices

Now that the user interface is changing from Sailfish OS 1.0 to Sailfish OS 2.0 it's time to introduce mce tools by Nokia. It's pretty easy to install Linux terminal on Jolla, and with mce tools you can tune up your user experience.

Customizing Sailfish OS - Jolla and MCE Tools by Nokia


Worth a read? Please share:



Having Jolla Tablet or Jolla phone, or any other device running on Sailfish OS, Meego (Nokia N9) or Nemo Mobile OS gives you an easy opportunity to go below the deck. Let's make it yours!

Disclaimer: Using developer tools on your device might void your warranty and brick your device. If you break something, it's yours to fix.

Note: The availability and usage of the listed commands, and actions in the end of the commands, are dependent on the device hardware and the operating system in use. System and tool updates might add or remove available actions, and for example if the device doesn't have a LED, there's no use for commands regarding that. Commands introduced are tested on Jolla Phone running on Sailfish OS 1.1.7.28. Commands to be written on terminal are shown with yellow text background. You need to be accurate with all the capital letters, characters and spaces between words. After each command, check your writing once again and press enter to execute.

1. Install Linux terminal on Sailfish OS

  • Make sure you're connected to the internet and you have an active Jolla account set up on your device.
  • Navigate to Settings > System > Developer Mode and enable developer mode
  • Enter your new password, either writing it yourself or letting the system create one for you. Write that password down!
  • You can now find a new app Terminal in your app launcher. Launch the app and enjoy! (reboot the device if not visible in the launcher right away)
Additionally, if you want to control your device via a computer:
  • Enable remote connection in the developer mode, and check your device IP (different for WLAN and USB connection)
  • Open terminal in your computer (on Windows, install for example Putty), and configure the connection: Use the correct device IP, port 22 and connection type SSH
  • Login with username "nemo" and your password
  • That's it! You're commanding your phone

2. Install mce tools (required for topics 3-8)


Mce tools enables customizing your device with easy one line commands. Before you can use the tools, they need to be installed. For this, you need to command your device with some more rights, but still not as a fully privileged Linux root user. Let's stay on a safer path, write in your terminal:
  • devel-su
  • write your password when asked (hidden writing) and press enter
If you've entered the password correctly, you can notice $ changing to # in your command line, meaning you're now talking to your device as a developer superuser. This mode enables for example installing new software packages:
  • pkcon refresh
  • pkcon install mce-tools
  • wait until the tools are installed
  • exit
The exit gets you away from the superuser mode, and you can see # changing back to $. 2nd exit would close the terminal. All the following commands are entered in normal user mode ($). So, now that the tools are there, let's take them into use.
Subtopics 3-8: You can pick any of the customization options listed below as subtopics. These can be done in any order, or you can skip any. Previous subtopic commands are not needed to start another one.

3. Double Tap gesture - to the Lock screen, or directly to Home?


Would you like to customize what happens when you double tap on a blank screen? Default action for this is to wake up the device and open your lock screen. If you've just used your device within the last 30 seconds, it takes you to previous screen instead. How about:
  • Set double tap to always take you home:
    mcetool --set-doubletap-mode=unlock
  • Set double tap to take you to lock screen (default):
    mcetool --set-doubletap-mode=show-unlock-screen
NOTE: The first command above won't let you pass your lock code. If you always want to enter the Home screen with double tap, you must disable the lock code on your device Settings

4. Glance screen - Showing time with simply uncovering the device


On devices equipped with light sensor, you can use this command to show time when your device is revealed to light (e.g. after opening a case, or taking the phone out of your pocket). When enabled, the display can show you some information quickly without any gestures or buttons needed
  • Set glance screen on:
    mcetool --set-low-power-mode=enabled
  • Set glance screen off (default):
    mcetool --set-low-power-mode=disabled

5. Power button - Single press, Double press and Long press actions


Default actions are quite intuitive: Short press wake up / shut down the display. Long press power up / shut down the whole device. Double press takes you to Home screen (via lock code, if set, when the display is off). But you might want these actions to do something else. Examples:
  • When display is OFF, set SINGLE tap to turn on display and vibrate
    mcetool --set-display-off-single-powerkey-press-actions=unblank,vibrate
  • When display is ON, set DOUBLE tap to do nothing
    mcetool --set-display-on-double-powerkey-press-actions=
  • When display is ON, set LONG tap to power off device (default)
    mcetool --set-display-on-long-powerkey-press-actions=shutdown
Be careful! You don't want to disable powering on your device. But you can tune up six different power button actions (3 when display off, 3 when display on) and it's easy to figure out these words in the command. For example the 2nd example, read as:

--set (set something)
-display-on (when display is on)
-double-powerkey-press (and power key is double pressed)
-actions= (list of things to be done)

last part after "=" can be left empty (example 2), have just one action (example 3) or have a comma separated list (example 1) including any of the following actions:
  • blank (turn display off)
  • unblank (turn display on)
  • tklock (lock user interface)
  • tkunlock (unlock user interface)
  • devlock (lock the device)
  • shutdown (power off the device)
  • vibrate (play vibrate)

6. Display on while charging?


The following command controls your display depending on if the charger is connected. It won't work on lock screen, as from there the display always shuts down after a short while, but from anywhere else you can keep your display on if you want:
  • Stay on (with the brightness on settings):
    mcetool --set-inhibit-mode=stay-on-with-charger
  • Stay on dimmed (with minimum brightness)
    mcetool --set-inhibit-mode=stay-dim-with-charger
  • Let the display shut down in predefined time (default)
    mcetool --set-inhibit-mode=disable

7. Display always on?

  • Stay on (with the brightness by Settings)
    mcetool --set-demo-mode=on
  • Let the display follow your settings (default)
    mcetool --set-demo-mode=off

8. Annoyed by blinking/burning LED?

  • Disable LED on incoming email notifications:
    mcetool --disable-led-pattern=PatternCommunicationEmail
  • Disable LED for power on (by default, shown when the device boots):
    mcetool --disable-led-pattern=PatternPowerOn
As you can see, the command remains the same, only the last part changing. You can use any of the following as the last part:
  • PatternBatteryChargingFlat
  • PatternBatteryLow
  • PatternBatteryCharging
  • PatternBatteryFull
  • PatternDeviceOn
  • PatternPowerOff
  • PatternPowerOn
  • PatternWebcamActive
  • PatternCommunication
  • PatternCommunicationAndBatteryFull
  • PatternCommunicationCall
  • PatternCommunicationEmail
  • PatternCommunicationIM
  • PatternCommunicationSMS
  • PatternCommonNotification
  • PatternDisplayDimmed
  • PatternDisplayBlankFailed
  • PatternDisplayUnblankFailed
  • PatternDisplaySuspendFailed
  • PatternDisplayResumeFailed
  • PatternKillingLipstick
  • PatternTouchInputBlocked
And to enable, just change the "--disable" to "--enable" in the command itself. You'll figure it out!

9. Some extra tips


The following terminal commands doesn't require installing the mce tools. These are basic Linux commands, usually pre-installed on all Linux devices.
  • Check your device storage and memory:
    free -m
    (learn about the output and other options here)
  • Check your CPU/RAM and follow the running processes:
    top
    (you can sort the output using left and right arrow. Exit using CTRL+C)
  • Check your battery / power:
    upower -d
  •  Follow your charging / discharging:
    upower --monitor-detail
    (exit using CTRL+C)

10. Remember the basic tuning options via Settings


The easiest part, no need for terminal. If you still have that active, write another exit and the Terminal app closes. Or you can close the app from your Home screen using long hold gesture.

But hey, why would you need to enter Home screen to close apps? There are some tuning options for gestures also in the Settings, available on Sailfish OS 1.1.9.28 and later. You can:
  • enter Events screen from everywhere with swipe-from-left
    Settings > System > Gestures
  • enable closing apps with swipe-from-top
    Settings > System > Gestures
Unfortunately, an option for locking the device with single swipe is not available  via the Settings, not even with mce tools. You would need a patch for that:

Even More tuning with patches


Patching enables for example modifying the swipe-from-top to lock the device, like it did on Sailfish OS earlier versions (until 1.1.7.28). Patching is for experienced users, and the topic is actually long enough to post another dedicated post later. There are some great ones written, definitely worth testing - so follow up for more!

Leave a comment if you know another useful tip for Sailfish OS users. Let's get our devices to work how we want them to work!

Even more MCE Tools commands


There are plenty, and you can list them all with command mcetool --help

However, the command often ends with a set of possible actions which you must also know, like shown on subtopics 5 and 8. If there's one special you need to know more of, just ask in a comment here, or write a question on TJC


Share and Shout! Your friends might read it.


By: Review Jolla
Sources: TJC (search for mce), Github (nemomobile, mce)
Published: 2015-09-13 10:20 UTC
Updated: 2015-09-13 18:40 UTC

1 comment:

  1. Thank you for taking your time to post this, it's very useful, now I can bypass the lockscreen animation (left and right arrows) and get straight to desktop, not forgetting enabling LPM.

    Regards,

    ReplyDelete