Setting default apps

I have two quetions pretty much related to each other.

  1. How do I set an app to always open with for a specific type of links? For example, everytime I click on a post in the Twitter feed on the notification page I have to pick an app from a list. I want it to always open with the same one.

  2. Where can I find the configuration for what camera app to use by default? For example I want Advanced Camera instead of the original app to open when launching the camera by swiping on the lock screen.

Thank you for your time!

/klarre

3 Likes

I’m afraid neither of those things are supported out-of-the-box, and have no have user-visible settings or configurations.

If you’re willing to do some risky hacking some files on the device, they might be achievable.

For camera app from lock screen, the actions below will achieve that, HOWEVER launching a camera app this way will still require entering the lock code. Which means you get the same behaviour as with adding the Camera app to the “Lock Screen Shortcuts” in Settings.
So doing the latter is recommended as it doesn’t change system files.

To replace the app that is launched by swiping up on the lock screen, replace:

/usr/share/applications/jolla-camera-lockscreen.desktop

with the .desktop file for the app you want, and set the key NoDisplay=true in the .desktop file (this avoids having two icons in the Launcher).
Do keep a backup of any files you change, and revert if it does not work.

2 Likes

@klarre Don’t hesitate to ask here in the forum if you want to know something or if something doesn’t work as it should. With SFOS you can do a lot of things that are not obvious at the first glance. You can adjust a lot of things to your personal flavour doing minor edits by CLI.

1 Like

BTW, How does the stock “before unlock” camera app do to bypass the lock?

Can you give an example? CLI work isis programming and that requires a basic useruser to understand scripting and I don’t recall seeing a programmers reference guild any Where .

with the N9 there use to be a tweaking program that allowed you to do alot of neat things. Does something like that exisfor sailfish os?

If so can you point us less skilled users to such a tool?

Thanks

Here’s a one-line hack for launching something other than the default camera from lockscreen.

Navigate to: /usr/share/lipstick-jolla-home-qt5/layers/CameraLayer.qml and look to the bottom of the page to the following ‘hunk’ of text;

LauncherItem {
    id: cameraLauncher

    //filePath: "/usr/share/applications/jolla-camera-lockscreen.desktop"
    filePath: "/usr/share/applications/mission-control.desktop"
}

As you can see, I have substituted for an app of my choice, my home automation app. Admittedly, the camera icon is the same, but my app is launched and quickly too…quicker than from the launcher icon it seems…maybe not.

I found the camera icon and changed it to something more fitting to my app.

The camera icon is found at Line 355 in;

/usr/share/lipstick-jolla-home-qt5/lockscreen/LockItem.qml

I chose;

icon-m-add-to-grid

4 Likes

Actually no, I only restarted lipstick to apply changes. I rarely reboot or turn off the device. I should try it really and see if I face the same problem you did. Can’t see why it should have gone that way though.

I will reluctantly reboot a bit later, I need to eat something first.

I made the change. I restarted the home screen using the Utilities app, but nothing happened. After a reboot it worked like a charm. Thanks!

1 Like

Seems like I did the exact same thing as you did, but to me it worked. Maybe it will hit me in the future when I least expect it. I will keep the change and we will see. :slight_smile:

Found two things which is good to be aware of.

  1. If Advanced Camera is set to store GPS data in the meta data of the picture, the GPS will be always on. The GPS indicator is always visible in the top bar. May drain the battery?

  2. I cannot start the Advanced Camera application the usual way anymore. It starts loading and after 10 seconds it disappears (before entering fullscreen).

@edz Great, lots of thanks for sharing and sorry for reporting failed first try.
I did EXACTLY the same mod on the file and it’s now working. Strange things happen sometimes.
(deleting my prev. posts to avoid confusion)

1 Like

Right. I can now start Advanced Camera from the lock-screen but no more from the app-grid.
Tried to copy the double .desktop files “lockscreen” thing used for stock cam but it’s not working. Duplicating+renaming the executable in /usr/bin isn’t working either.

@klarre, about GPS, a special reason for not simply disabling it in AC prefs?

I prefer storing the data in the file so that is simply why I want it on. But it is not a deal breaker and I have now turned it off to verify that the discharge curve is flattening, which so far it seems it does, as expected. :slight_smile:

Ok, I see.
Quiet new to sfos. What do you use to monitor the discharge curve?

I use SysMon. Neat little tool.

2 Likes

System monitor from 2021 through Openrepos?

Yes, that seems to be the proper name. :slight_smile:

2 Likes

Ooh, yeah, didn’t quite think that one through, my so called one-line hack…Oops. not sure if it is connected, but I plugged the USB into my device and the green LED lit but no UI, the LED turned red for a while and still was unresponsive. Fortunately, it booted again, normally.

With regard to the original app not starting (meaning the app we chose as our alternative), I see this as well, 10 seconds of cover and pop, gone. I need to look back at the file in layers/CameraLayer.qml of lockscreen as I recall there was an image file for camera that stated ‘camera-camera’ in its url…more discovery needed!!

@ric9k - no need for apologies, it’s all good as long as we accept the inherent dangers of playing with system files. I no longer say it, it should be obvious there are potential pitfalls of following “what some bloke said on a forum”, I’ve been tinkering with SFOS for 8 years and still know very little (clearly!) :smiley:

1 Like

Very nice, thanks for adding this.

Are you saying that you don’t need to enter the lock code when launching things this way?

Because in my brief test with replacing just the .desktop file instead of modifying the QML, the launched app would always require a lock code on launch.

OT: @808 I can tell you what I have done until now with the help of the community. Alone, I wouldn’t be able to do this, because I’m also not a coder but I like experiments. I have fun with having a nice looking smartphone and not having to be on the leash of one of the big A’s.

Until now, I did the following tweaks:

Remove blurring background (opacity),
Change the ‘charger unplugged’ message into another one,
Change tethering address range,
LED hack - LED doesn’t flash anymore if battery is full charged,
suppress flickering of bottom bar in PDF reader,
Remove annoying hints on unlock,
change system ringtones to selfmade ones,

… with the help of the community here!!! Alone I could never do all this.

You are surely right in one point:
Jollas homepage gives the impression of a wonderful, well engineered and beautiful OS and doesn’t communicate to a customer, who is not familiar with it, that it is a community project in perpetual evolution and that not yet everything is working at present time.

IMHO Jolla should better clarify that.

Programming reference: There is one, somewhere… I forgot where because I didn’t understand it…

1 Like