Long-time Android user recently switched to Sailfish, thanks to excellent port to Sony Xperia X Compact. As always, my first thoughts turn to hacking and modding, (nothing illegal, just personalization...). So far, I haven't figured out too much, except that the generous devs here do a great job with apps and patches for us, which I've been making use of, but I can't help but want to know more...

With Android, most UI functions are controlled by app packages, (apk files), which are made up of 2 parts: resources, and smali, (code). Apk files can be decompiled, have contents edited, then recompiled, and pushed back to the file system. Resources are pretty easy to mod, and smali is trickier, (different language), and even Java framework files can be modded, to bypass security, etc, if you really know what you're doing, (or have a guide to follow), but all of it is easily accessible in the file system, (with root).

Maybe I just haven't looked hard enough yet, but I haven't found the equivalent of this is Sailfish yet. I've dug around in the file system a bit, and found a few things that seem like they might be in this realm, but I have a feeling I'm missing something, like maybe these types of files are in a different partition, which has to be mounted, or maybe they are only moddable during app building, and not after, or... ???

So, what is the equivalent structure here, if any, for modifying apps, (particularly system apps)? For example, (what really got me started on this), I was wanting to set the time it takes for the power menu to pop up while long-pressing the power button, to be much shorter, (it's about a full 3 seconds - way too long). In android, I might find it in framework-res.apk/res/values..., or maybe in smali code. Where would it be here?

Comments

You can find the qml files in de directory usr/share/.
The names of harbour apps will start with harbour, the official apps will start with jolla or sailfish. Be aware that changes can disappear after each update...
You can find a simple example in this how-to

3 Answers

Update 12/11 - files and folders are a little different with SF3, but most of this can still be used as a general guide. I've done most of these mods on my X Compact running 3.0.0.8.

So, after messing around here and there, I thought maybe a good idea to post some easily-attained examples of helpful discoveries, (probably academic/old news to many here, but maybe some other newbs will appreciate...). Feel free to add other examples.

Since launcher patches don't work on
my community port, (v. 2.1.3.7), I
wanted to tweak my launcher
background, etc. Starting with
/usr/share/lipstick-jolla-home-qt5/launcher/Launcherview.qml, and using Tinyedit Root app from
Openrepos, I found a line that said
'color: (I think the entry was
'black', but can't remember for
sure)'. I changed it to
'#d9121518', which is hex code for a
semi-transparent dark blue-grey.
This is the launcher background, but
there's another layer which
manifests over that, when you open
the app drawer, so to deal with
that,

but now the issue is that, for
whatever reason, when opacity is
removed from launcher layer, it
activates an overlay, which covers
the top row of apps in the launcher
with some kind of Android
back-button rectangle. The overlay
actually doesn't cause any function,
and if you press the space where
your app icon is, (hidden by the
overlay), the app will still launch,
you just have to know where the icon
is.

I discovered the code for this
at the bottom of
/usr/share/lipstick-jolla-home-qt5/launcher/launcher.qml.
There is code for a rectangle which
says a bunch of stuff about 'back'
function, etc. Delete the whole
code for that rectangle, and it
disappears from the launcher.

Update - I Figured out how to get scroll-without-pages:

Go to /usr/share/lipstick-jolla-home-qt5/launcher/launcher.qml, and find 'snapMode: ListView.SnapOneItem' and 'highlightRangeMode: ListView.StrictlyEnforceHighlight', (there were 3 instances of each in mine).

Change them to 'snapMode: ListView.NoSnap', and 'highlightRangeMode: ListView.NoHighlightRange'.
I Think that's all needed. I did also add a line, but I'm pretty sure it didn't do anything. Let me know if not working for you.

Also...

Keyboard/Covers

I tend to prefer things dark/dull/flat, so, even though I like the Sailfish UI overall, there are certain things that are just too bright and shiny for me. I found 2 files called GlassBackground.qml - one of them is in /usr/share/lipstick-jolla-home-qt5/compositor/, and one is in /usr/lib/qt5/qml/Sailfish/Silica. I found that if you change any value that says 'highlightBackgroundColor' to 'highlightDimmerColor', you will get dimmer, darker colors. Also changing the opacity levels, (like from 0.7 to 0.1, or something - experiment), helps. This seems to mainly affect the keyboard and the minimized cards, (covers), (so, if you have a blue highlight color set for your ambience, the minimized cards are usually bright blue, but this can make them more like a dark, shadowy color, accented by your wallpaper.

Also, the GlassBackground file uses 2 png files, noise.png, (found in /usr/lib/qt5/qml/Sailfish/Silica), and graphic-shader-effect.png, (found in /usr/share/Themes/Meegotouch/Sailfish-default/icons/). Both of these cause the glassy/blurry type of look in different areas. I replaced both of them with a flat, solid color image. This makes the keyboard solid-looking, and seems to make the general glassy-ui more like a blur-ui, (you can't see the little bumpy marks). Of course this is all varying depending on opacity levels in different files, etc, so...)

Also,

Solid Background for apps, (no glass)

go to /usr/share/lipstick-jolla-home-qt5/compositor/ApplicationWallpaper.qml, and find the line that says '... 0,0,0,0.5)', and change it to '... 0,0,0,1.0). 0.5 indicates opacity halfway to solid, so changing it to 1.0 makes it totally solid. I thought the 0,0,0 would be rgb color, but when I attempted to change it to something else, the whole screen whited-out. Maybe there's only certain allowed range values or something... Update - figured it out... You need the rgb values to have decimals. So my color, hex #121518, is rgb 18,21,24, so I need to enter .18,.21,.24,1.0.

Go to /usr/lib/qt5/qml/Sailfish/Silica/CoverBackground.qml, and change 'transparent: true' to 'transparent: false', and the covers become transparent, (strange but true).

Solid Lock Screen (no vignette)

files are in /usr/share/lipstick-jolla-home-qt5/lockscreen/. Mainly 'lockscreen' and 'vignette' files. Look for value called 'open radius', and change it to 0.0. Also interesting is a value called 'frag color' at the end of 'vignette' file. It says 'vec4', followed by parentheses with 3 rgb decimals inside. Change the values similarly to described above to change the color of the screen lock overlay. Changing vec4 to vec(any other number) results in a solid, hot-pink screen overlay. I'm not sure what that value means.

Totally flat keyboard

Open /usr/share/maliit/plugins/com/jolla/keySeparator.qml, and add 'opacity: 0.0'. Then go to 'functionKey.qml' in the same directory, and change opacity values. See lines 47 and 54 in my screenshot for example.

I was able to get this effect by messing around with /usr/lib/qt5/qml/Sailfish/Silica/opacityRampEffectBase.qml:

Remove highlight color from events pulley

Go to /usr/share/lipstick-jolla-home-qt5/eventsview/EventsView.qml, and change any 'Theme.highlightBackgroundColor' to 'Theme.highlightDimmerColor', then change opacities how you like. For example, in my screenshot you see the '0.4' number- that was originally '0.8', etc...

Like I said, I like dark and dim, but Ambience highlight color is always bright. Change primary and secondary highlight colors with second commands found in @ssahla 's updated answer here- https://together.jolla.com/question/11949/black-and-white-ambiences/ You can use ShellEx app to make a one-click method, so you don't have to type the commands every time, and Google's built-in hex color picker comes in handy for finding color codes. Just type 'hex color' into url bar in a Google search, and it shows up in search result screen.

dark buttons with light text

Go to /usr/lib/qt5/qml/Sailfish/Silica/button.qml. The first entries are a bunch of bool / properties. 3 of them say color. Anything that says 'Theme.(whatever)... change it to 'Theme.highlightDimmerColor'. Then, near the end of the file, is a section called 'label', with an entry of 'color'. Change the color value to 'Theme.primaryColor'.

Bigger cover icons

Go to /usr/share/lipstick-jolla-home-qt5/switcher/SwitcherItem.qml, and down about line 310 or so, you'll see a few code entries called 'image' and 'rectangle' that have values of iconSizeSmall and iconSizeMedium. Change those to iconSizeLarge.

# of columns in events view shortcuts

Go to Go to /usr/share/lipstick-jolla-home-qt5/eventsview/Eventsview.qml, and look for 'columns'. There are 2 of them. One is for shortcuts and one is for actions. I changed mine to 5 and 3.

Replace 2 png files - /usr/share/themes/sailfish-default/meegotouch/icons/graphic-shader-texture.png, and /usr/lib/qt5/qml/Sailfish/Silica/private/noise.png - with the same semi-transparent png image, (easily found in Googke). Adjust appearance by editing 'GlassBackground' and 'OpacityRampEffectBase' files, as described above.

Note: Always have files backed up, and/or know how to get back to where you started if things get messed up.

Handy tips for emergencies:

If the phone boots ok, but your app drawer is gone, go to events page, and click on a Storeman notification. Storeman opens, and go to Fingerterm, and select 'launch' from pulley menu, then use vim with root to edit files. Or, add lock screen shortcuts...

I can add more specific code lines, etc., if anyone wants, but it's just a general example. I think code will probably vary from version-to-version, device-to-device, etc. The idea is that you can poke around, and figure different things out. If you're too unsure to test without specifics, you might want to stay away...

Comments

"I was wanting to set the time it takes for the power menu to pop up while long-pressing the power button"

In this particular case no patching / modding is needed. Power key is handled by mce service and there is a setting for the long-press duration.The setting is not visible in ui, but you can tweak it from command line with mcetool utility. For example down to 250 ms:

mcetool --set-powerkey-long-press-delay=250

The default is 1500 ms. And keep it below well below 5000 ms (another system service "dsme" is also monitoring power key and will initiate shutdown if it is kept pressed > 5 seconds).

The setting can be changed as a regular user, but you need root privileges/developer mode for installing the utility itself:

Comments

Nice, thanks. I think 750 is probably more than enough for me, since I don't use it for anything else but a quick tap for screen-off. That's the kind of stuff I like knowing about; going to install mce tools. By the way, someone here indicated that modding rpms is tricky. Do you find that to be the case? What's the best method?

Good idea... Also, I found an app calles 'rpm repackager' or something. Is it necessary to modify and repackage rpm, then install, or can I just edit already-installed files and reboot? (I'm planning on testing and experimenting either way, but trial and error goes quicker with input from those who know...)
Thanks

Android user lately just moved to Sailfish, thanks to outstanding port to Sony Xperia X Compact.They have this facility of custom essay writing service. Our first thoughts moves to hacking and modding and many people have not sorted out too much, excluding that the generous devs here do a great job with applications and patches for us.