Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Keep desktop file changes on update
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
NyneR
n00b
n00b


Joined: 19 Dec 2020
Posts: 35

PostPosted: Wed Oct 20, 2021 11:42 am    Post subject: [SOLVED] Keep desktop file changes on update Reply with quote

Hello everyone,

I'm trying to use
Code:
media-sound/apulse
with programs like
Code:
net-im/discord-bin
and browsers.
So I edited the desktop files in
Code:
/usr/share/applications
.
When I prepend "apulse" to the "Exec" field it works as expected.

However as soon as I update the program via portage the desktop file gets overwritten again.

Is there a way to keep the changes or at least get a merging dialog like with etc-update?

Thanks in advance,
NyneR


Last edited by NyneR on Wed Oct 20, 2021 12:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
netfab
Veteran
Veteran


Joined: 03 Mar 2005
Posts: 1897
Location: 127.0.0.1

PostPosted: Wed Oct 20, 2021 12:28 pm    Post subject: Reply with quote

Hi,

You should do this instead :
Code:

# mkdir -p /usr/local/share/applications

and copy your modified desktop file to that directory.

Edit: to be more precise, the spec. says :
Quote:

Desktop File ID

Each desktop entry representing an application is identified by its desktop file ID, which is based on its filename.
To determine the ID of a desktop file, make its full path relative to the $XDG_DATA_DIRS component in which the desktop file is installed, remove the "applications/" prefix, and turn '/' into '-'.
For example /usr/share/applications/foo/bar.desktop has the desktop file ID foo-bar.desktop.
If multiple files have the same desktop file ID, the first one in the $XDG_DATA_DIRS precedence order is used.

On my system :
Quote:

$ env | grep DATA_DIRS
XDG_DATA_DIRS=/usr/local/share:/usr/share:/usr/share
Back to top
View user's profile Send private message
NyneR
n00b
n00b


Joined: 19 Dec 2020
Posts: 35

PostPosted: Wed Oct 20, 2021 12:48 pm    Post subject: Reply with quote

Thanks!

I tried it with
Code:
/usr/local/share/applications
but it did not apply the changes on my system.

Instead I used
Code:
~/.local/share/applications
.

It works now.
Back to top
View user's profile Send private message
netfab
Veteran
Veteran


Joined: 03 Mar 2005
Posts: 1897
Location: 127.0.0.1

PostPosted: Wed Oct 20, 2021 12:56 pm    Post subject: Reply with quote

NyneR wrote:

I tried it with
Code:
/usr/local/share/applications
but it did not apply the changes on my system.

I guess it must depend on your desktop.
Here under Xfce it works.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum