Install .desktop file with setup.py

0 votes
I have a python application that is supposed to be launchable via GUI so it has to have a .desktop file in /usr/share/applications/. The application only supports Linux. Normally, pip installs all files in one directory but it is possible to specify other locations (e.g. the .desktop file) in the setup.py using data_files=[].

Is this a good solution in this case or is this something that should only happen in a distribution specific package (like .rpm/.deb/.ebuild)? Can anyone help me with this?
Jun 27 in Python by ana1504.k
• 7,890 points
40 views

1 answer to this question.

0 votes
This looks like a good approach but perhaps instead of placing the .desktop file in the system wide /usr/share/applications/ folder, you could place the file in the users applications folder at ~/.local/share/applications.

This would also not require elevated permissions to access the root owned /user directory and it's sub-directories.
answered Jun 27 by SDeb
• 13,210 points

Related Questions In Python

0 votes
1 answer

Python Setup file

 setup.py tells you that the module or the ...READ MORE

answered May 14, 2018 in Python by Nietzsche's daemon
• 4,260 points
43 views
0 votes
1 answer

init.py file

It is used to denote directories on ...READ MORE

answered Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
43 views
0 votes
1 answer

How to read Pandas csv file with no header?

You can set the header option to ...READ MORE

answered Apr 3 in Python by Shri
2,254 views
0 votes
0 answers

Copy file with metadata - python

I would like to copy a file ...READ MORE

Jun 20 in Python by Trisha
36 views
0 votes
1 answer
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 409 views
0 votes
11 answers
0 votes
1 answer

In Python, how do I read a file line-by-line into a list?

with open(fname) as f:     content = f.readlines() # you ...READ MORE

answered Oct 9, 2018 in Python by SDeb
• 13,210 points
142 views