maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   How to update icon on the homescreen without full homescreen refresh or reboot ? (https://talk.maemo.org/showthread.php?t=92633)

Schturman 2014-02-07 19:15

How to update icon on the homescreen without full homescreen refresh or reboot ?
 
Someone know how to update specific icon (.desktop file) on the homescreen.
For example my script change profile -> remove icon -> remove .desktop file -> copy new icon -> create new .desktop file with the same name.
In most cases after changing profile it not show me new icon and the name of the new profile from new .desktop file. It just show me the old name (previous profile) and empty icon :(
How I can cause to show me what I need without full refresh (lipstick) or reboot ?

I found this file: /usr/bin/xdg-desktop-icon
Inside this file it have some nice explanations like:
Quote:

The xdg-desktop-icon program can be used to install an application launcher or
other file on the desktop of the current user.

An application launcher is represented by a *.desktop file. Desktop files are
defined by the freedesktop.org Desktop Entry Specification. The most important
aspects of *.desktop files are summarized below

install
Installs FILE to the desktop of the current user. FILE can be a *.desktop
file or any other type of file.
Already tried:
Code:

xdg-desktop-icon install /path/to/new(same_name).desktop
xdg-desktop-icon install [/path/to/new_icon.png

It don't do nothing...

Any advice ?

Thanks

coderus 2014-02-07 19:19

Re: How to update icon on the homescreen without full homescreen refresh or reboot ?
 
delete desktop, call desktop-file-install, create desktop, call desktop-file-install is the only way.

Schturman 2014-02-07 19:32

Re: How to update icon on the homescreen without full homescreen refresh or reboot ?
 
Hmmm but how I will "call desktop-file-install" if in this moment desktop file already deleted ?
Or your don't mean to this command "xdg-desktop-icon install" ? If not, what the exactly command your mean ?
Thanks

EDIT: you mean to this one: /usr/bin/desktop-file-install
I will try and report.

Schturman 2014-02-07 20:43

Re: How to update icon on the homescreen without full homescreen refresh or reboot ?
 
Andrey, big thanks! It work exactly like I need it :)

solbrit 2015-02-20 22:20

Re: How to update icon on the homescreen without full homescreen refresh or reboot ?
 
If I create a desktop file that updates correctly the way you describe, and I put it into a folder in the app menu along with some other apps, when executed it'll update but reappear outside the folder. I was looking around for somewhere to define it's location to keep it inside the folder (something in the .desktop files or… wasn't there .folder or .directory files in Fremantle?) but I can't see anything. Any ideas?

Schturman 2015-02-21 05:43

Re: How to update icon on the homescreen without full homescreen refresh or reboot ?
 
Quote:

Originally Posted by solbrit (Post 1461534)
If I create a desktop file that updates correctly the way you describe, and I put it into a folder in the app menu along with some other apps, when executed it'll update but reappear outside the folder. I was looking around for somewhere to define it's location to keep it inside the folder (something in the .desktop files or… wasn't there .folder or .directory files in Fremantle?) but I can't see anything. Any ideas?

Yes, known problem.. Sometimes icon jump, sometimes not..
Check this two files:
Code:

/home/nemo/.config/lipstick/applications.menu
/home/nemo/.config/nemomobile/lipstick.conf

them have order of your apps. Maybe if you will copy them and restore after refreshing your icon, it will leave your icon in your place..
I didn't try it yet..

solbrit 2015-02-21 07:39

Re: How to update icon on the homescreen without full homescreen refresh or reboot ?
 
Quote:

Originally Posted by Schturman (Post 1461552)
Yes, known problem.. Sometimes icon jump, sometimes not..
Check this two files:
Code:

/home/nemo/.config/lipstick/applications.menu
/home/nemo/.config/nemomobile/lipstick.conf

them have order of your apps. Maybe if you will copy them and restore after refreshing your icon, it will leave your icon in your place..
I didn't try it yet..

In /home/nemo/.config/lipstick/applications.menu the folder name, position and contents show. I'll try recreating that entry when updating desktop file and see if that works. Thanks!

solbrit 2015-02-21 09:43

Re: How to update icon on the homescreen without full homescreen refresh or reboot ?
 
Nope, that didn't work… :(

Edit: After editing ~/.config/lipstick/applications.menu I tried restarting lipstick with 'systemctl-user restart lipstick.service' which gave a blank screen, blinking green LED and the app in the desired place, in that order, haha! Not a very smooth solution...

Schturman 2015-02-21 10:36

Re: How to update icon on the homescreen without full homescreen refresh or reboot ?
 
How you tried this ?
try:
1. copy both files
2. update icon like coderus wrote
3. restore both files.

Create simple script for this.

solbrit 2015-02-21 10:55

Re: How to update icon on the homescreen without full homescreen refresh or reboot ?
 
Quote:

Originally Posted by Schturman (Post 1461568)
How you tried this ?
try:
1. copy both files
2. update icon like coderus wrote
3. restore both files.

Create simple script for this.

Yes, but restoring the files has no effect unless I restart lipstick. Which has the aforementioned drawbacks (along with closing all open apps).


All times are GMT. The time now is 18:40.

vBulletin® Version 3.8.8