示例#1
0
def add_application_entry() -> None:
    desktop_parser = DesktopParser(str(APPLICATION_ENTRY_FILE_PATH))

    for k, v in DESKTOP_ENTRY.items():
        desktop_parser.set(k, v)
    desktop_parser.set(DESKTOP_ENTRY_ICON, get_data_path(APP_ICON_NAME))
    desktop_parser.set(DESKTOP_ENTRY_EXEC, APP_PACKAGE_NAME)
    desktop_parser.write()
示例#2
0
def set_autostart_entry(is_enabled: bool) -> None:
    desktop_parser = DesktopParser(str(AUTOSTART_FILE_PATH))

    if not AUTOSTART_FILE_PATH.is_file():
        for k, v in DESKTOP_ENTRY.items():
            desktop_parser.set(k, v)
        desktop_parser.set(DESKTOP_ENTRY_ICON, get_data_path(APP_ICON_NAME))
        desktop_parser.set(DESKTOP_ENTRY_EXEC,
                           '%s --hide-window' % APP_PACKAGE_NAME)

    desktop_parser.set(AUTOSTART_FLAG, str(is_enabled).lower())
    desktop_parser.write()
示例#3
0
文件: main.py 项目: Raiu/gkraken
 def _init_app_indicator(self) -> None:
     if AppIndicator3:
         self._app_indicator = AppIndicator3.Indicator \
             .new(APP_ID, get_data_path('gkraken-symbolic.svg'), AppIndicator3.IndicatorCategory.HARDWARE)
         if self._settings_interactor.get_bool(
                 'settings_show_app_indicator'):
             self._app_indicator.set_status(
                 AppIndicator3.IndicatorStatus.ACTIVE)
         else:
             self._app_indicator.set_status(
                 AppIndicator3.IndicatorStatus.PASSIVE)
         self._app_indicator.set_menu(self._main_menu)
示例#4
0
文件: di.py 项目: Raiu/gkraken
 def provide_preferences_builder(self) -> PreferencesBuilder:
     LOG.debug("provide Gtk.Builder")
     builder = Gtk.Builder()
     builder.set_translation_domain(APP_PACKAGE_NAME)
     builder.add_from_file(get_data_path(APP_PREFERENCES_UI_NAME))
     return builder
示例#5
0
文件: di.py 项目: Raiu/gkraken
 def provide_edit_speed_profile_builder(self) -> EditSpeedProfileBuilder:
     LOG.debug("provide Gtk.Builder")
     builder = Gtk.Builder()
     builder.set_translation_domain(APP_PACKAGE_NAME)
     builder.add_from_file(get_data_path(APP_EDIT_SPEED_PROFILE_UI_NAME))
     return builder
示例#6
0
文件: di.py 项目: Raiu/gkraken
 def provide_main_builder(self) -> MainBuilder:
     LOG.debug("provide Gtk.Builder")
     builder = Gtk.Builder()
     builder.set_translation_domain(APP_PACKAGE_NAME)
     builder.add_from_file(get_data_path(APP_MAIN_UI_NAME))
     return builder