File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33import os
44
5- from xdg import BaseDirectory , Menu
5+ from xdg import BaseDirectory , Menu , Exceptions
66
77
88class DesktopXDG (object ):
99 """pyxdg Freedesktop desktop implementation"""
1010 def __init__ (self ):
11- menu_entry = Menu .parse ().getMenu ('Office' ).getMenuEntry (
12- 'pybitmessage.desktop' )
13- self .desktop = menu_entry .DesktopEntry if menu_entry else None
11+ try :
12+ self .desktop = Menu .parse ().getMenu ('Office' ).getMenuEntry (
13+ 'pybitmessage.desktop' ).DesktopEntry
14+ except Exceptions .ParsingError :
15+ raise TypeError # TypeError disables startonlogon
1416 appimage = os .getenv ('APPIMAGE' )
1517 if appimage :
1618 self .desktop .set ('Exec' , appimage )
1719
1820 def adjust_startonlogon (self , autostart = False ):
1921 """Configure autostart according to settings"""
20- if not self .desktop :
21- return
22-
2322 autostart_path = os .path .join (
2423 BaseDirectory .xdg_config_home , 'autostart' , 'pybitmessage.desktop' )
2524 if autostart :
You can’t perform that action at this time.
0 commit comments