.desktop 파일의 AutostartCondition 키 이해

.desktop 파일의 AutostartCondition 키 이해

기본적으로 GNOME 3 Shell이 ​​포함된 CentOS 7.x는 key 아래에 다음 파일을 제공합니다 *.desktop./etc/xdg/autostart/AutostartCondition

# gnome-welcome-tour.desktop
[Desktop Entry]
Type=Application
Name=Welcome
Exec=/usr/libexec/gnome-welcome-tour
AutostartCondition=if-exists run-welcome-tour
OnlyShowIn=GNOME;
NoDisplay=true

그리고

# gnome-initial-setup-first-login.desktop
[Desktop Entry]
Name=Initial Setup
#...
Icon=preferences-system
Exec=/usr/libexec/gnome-initial-setup --existing-user
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;System;
OnlyShowIn=GNOME;
NoDisplay=true
AutostartCondition=unless-exists gnome-initial-setup-done
#...

내 질문:

  1. key가 시작 시 파일을 읽은 후 GNOME 3(또는 다른 XDG 호환 데스크탑 또는 세션 관리자)에 의해 AutostartConditionkey 값이 실행되는지 여부를 결정한다고 생각하는 것이 맞습니까 ?Exec/etc/xdg/autostart/*.desktop
  2. 현재 값을 쿼리하는 방법은 무엇입니까 AutostartCondition?

질문 #2 관련: 다음을 시도했지만 성공하지 못했습니다. (gnome-welcome-tour와 gnome-initial-setup을 모두 수행했는데 로그인 시 메시지가 표시되지 않습니다.)

[user@user-centos-7 ~]$ gconftool-2 --recursive-list / | grep gnome-initial-setup-done
[user@user-centos-7 ~]$ gsettings list-schemas | while read -r SCHEMA; do gsettings list-recursively $SCHEMA; done | grep gnome-initial-setup-done
[user@user-centos-7 ~]$ 
[user@user-centos-7 ~]$ gconftool-2 --recursive-list / | grep run-welcome-tour
[user@user-centos-7 ~]$ gsettings list-schemas | while read -r SCHEMA; do gsettings list-recursively $SCHEMA; done | grep run-welcome-tour
[user@user-centos-7 ~]$ 

답변1

세션 관리자는 .desktop애플리케이션을 시작하는 모든 파일을 읽습니다. 이러한 파일 중 하나에서 키가 발견 되면 AutostartCondition해당 값을 확인합니다. 조건이 충족되지 않으면 해당 특정 응용 프로그램이 시작 응용 프로그램 목록에서 제거됩니다. 자동 시작 조건은 아주 오래된 게시물에 설명되어 있습니다.무료 데스크탑메일링 리스트:

The Autostart-Condition Key

The Autostart-Condition key gives a condition which should be tested before
autostarting the application; if the condition is not met, then the application
MUST NOT be autostarted. The condition can be in one of the following forms:

    if-exists FILE

        The application should only be autostarted if FILE exists
        (relative to $XDG_CONFIG_HOME).

    unless-exists FILE

        The application should only be autostarted if FILE *doesn't* exist
        (relative to $XDG_CONFIG_HOME).

    DESKTOP-ENVIRONMENT-NAME [DESKTOP-SPECIFIC-TEST]

        The application should only be autostarted under the named desktop environment
        (as with OnlyShowIn). If DESKTOP-SPECIFIC-TEST is also given, the desktop
        environment will evaluate it in some manner specific to that desktop to
        determine whether or not the application should be autostarted.


which would end up being used like:

Name=kgpg
# start only under KDE, and only if the given kconfig key is set
Autostart-Condition=KDE kgpgrc:User Interface:AutoStart:false

Name=vino
# start only under GNOME, and only if the given gconf key is set
Autostart-Condition=GNOME /desktop/gnome/remote_access/enabled

Name=beagled
# start under any desktop environment, unless
# ~/.config/beagle/disable-autostart exists
Autostart-Condition=unless-exists beagle/disable-autostart

따라서 귀하의 특별한 경우에는 자동 시작 조건이 ./config/run-welcome-tour각각 존재하거나 ./config/gnome-initial-setup-done존재하지 않습니다 .

관련 정보