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, 2019 in Python by ana1504.k
• 7,890 points
67 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, 2019 by SDeb
• 13,250 points

Related Questions In Python

0 votes
1 answer

Command "python setup.py egg_info" failed with error code 1 in C:\Users\Nadeem\AppData\Local\Temp\

Hi@akhtar, I think you are using previous version ...READ MORE

answered May 4 in Python by MD
• 23,580 points
624 views
0 votes
1 answer

How to Install Python packages from local file system folder to virtualenv with pip?

Hello @kartik, You can try the code below: pip ...READ MORE

answered May 11 in Python by Niroj
• 23,210 points
57 views
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
54 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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 953 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,250 points
199 views