예제 #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