21.5. 自動ログアウトの設定
特定の期間アイドル状態であったユーザーセッションは自動的に終了できます。対応する GSettings キーを設定してからこれをロックし、マシンがバッテリーまたは主電源を使用しているかに応じて異なる動作を設定できます。
アイドルセッションが自動的に終了する場合は、ユーザーが保存していないデータは削除される可能性があります。
電源搭載マシンの自動ログアウトを設定するには、以下を行います。
手順
マシン全体の設定用に、ローカルデータベースを
/etc/dconf/db/local.d/00-autologout
ファイルに作成します。[org/gnome/settings-daemon/plugins/power] # Set the timeout to 900 seconds when on mains power sleep-inactive-ac-timeout=900 # Set action after timeout to be logout when on mains power sleep-inactive-ac-type='logout'
ユーザーの設定を上書きし、ユーザーが
/etc/dconf/db/local.d/locks/autologout
ファイルで設定を変更できないようにします。# Lock automatic logout settings /org/gnome/settings-daemon/plugins/power/sleep-inactive-ac-timeout /org/gnome/settings-daemon/plugins/power/sleep-inactive-ac-type
システムデータベースを更新します。
# dconf update
- システム全体の設定に変更を適用するために、ユーザーは、一度ログアウトしてログインし直す必要があります。
関連する GSettings キーは以下のとおりです。
org.gnome.settings-daemon.plugins.power.sleep-inactive-ac-timeout
コンピューターが AC 電源から実行している場合にスリープ状態に切り替わる前に非アクティブな状態にする必要がある秒数です。
org.gnome.settings-daemon.plugins.power.sleep-inactive-ac-type
コンピューターが AC 電源から実行している場合にタイムアウトが経過するとどうなるかを設定します。
org.gnome.settings-daemon.plugins.power.sleep-inactive-battery-timeout
コンピューターが電源から実行している場合にスリープ状態に切り替わる前に非アクティブな状態にする必要のある秒数です。
org.gnome.settings-daemon.plugins.power.sleep-inactive-battery-type
コンピューターがバッテリー電源から実行している場合にタイムアウトが経過したらどうなるかを設定します。
利用可能なキーの値をリスト表示するには、以下の手順に従います。
手順
-
必要なキーで
gsettings range
コマンドを実行します。以下に例を示します。
$ gsettings range org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type enum 'blank' 'suspend' 'shutdown' 'hibernate' 'interactive' 'nothing' 'logout'