CentOS7.xとGNOME3 Shellは、デフォルトで*.desktop
の下にAutostartCondition
キーを持つ次の/etc/xdg/autostart/
ファイルを提供します。
# 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
#...
私の質問:
AutostartCondition
キーは、起動時に/etc/xdg/autostart/*.desktop
ファイルを読み取った後、Exec
キーの値がGNOME3(または別のXDG準拠のデスクトップまたはセッションマネージャー)によって実行されるかどうかを決定すると考えるのは正しいですか? ?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 ~]$
ありがとう。
セッションマネージャーは、すべてのスタートアップアプリの.desktop
ファイルを読み取ります。これらのファイルのいずれかでAutostartCondition
キーが見つかった場合は、その値を確認します。条件が満たされていない場合、その特定のアプリはスタートアップアプリのリストから削除されます。自動開始条件は、 freedesktopメーリングリスト の非常に古い投稿で説明されています。
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
が存在しないことです。