2 # create-desktop-icon.py: Create a Desktop icon
3 # 2016-12-22 Thomas Perl <m@thp.io>
8 from gi
.repository
import GLib
10 BASE
= os
.path
.normpath(os
.path
.abspath(os
.path
.join(os
.path
.dirname(__file__
), '..')))
12 TEMPLATE
= """# Created by %(__file__)s
15 Exec=%(BASE)s/bin/gpodder
16 Icon=%(BASE)s/share/icons/hicolor/scalable/apps/gpodder.svg
21 DESKTOP
= GLib
.get_user_special_dir(GLib
.UserDirectory
.DIRECTORY_DESKTOP
)
23 if not os
.path
.exists(DESKTOP
):
24 print("{} desktop folder doesn't exists, exiting".format(DESKTOP
))
27 DESTINATION
= os
.path
.join(DESKTOP
, 'gpodder-git.desktop')
29 if os
.path
.exists(DESTINATION
):
30 print('{} already exists, not overwriting'.format(DESTINATION
))
33 with
open(DESTINATION
, 'w') as fp
:
35 os
.chmod(DESTINATION
, 0o755)
37 print('Wrote {}'.format(DESTINATION
))