From 66714445d637251e28e2a6283e88a80b838bf91f Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 7 Feb 2017 18:36:00 +0800 Subject: Add unix/ck-unlock-sessions.sh to unlock ConsoleKit sessions This script works like systemd's `loginctl unlock-sessions` --- unix/ck-unlock-sessions.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 unix/ck-unlock-sessions.sh (limited to 'unix/ck-unlock-sessions.sh') diff --git a/unix/ck-unlock-sessions.sh b/unix/ck-unlock-sessions.sh new file mode 100755 index 0000000..05c4477 --- /dev/null +++ b/unix/ck-unlock-sessions.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# +# Unlock the user sessions when the screen locker failed/crashed +# (e.g., during an upgrade). +# +# This is the solution for ConsoleKit (e.g., on Gentoo Linux). +# As for the `systemd` case, simply run: +# $ loginctl unlock-sessions +# +# NOTE: +# Root privilege is required. +# +# Reference: +# * KDE bugs: #360489 +# https://bugs.kde.org/show_bug.cgi?id=360489 +# +# Aaron LI +# 2017-02-07 +# + +for session in $(ck-list-sessions | grep '^Session' | tr -d ':'); do + echo "* Unlock ConsoleKit session: ${session} ..." + sudo dbus-send --system --print-reply \ + --dest="org.freedesktop.ConsoleKit" \ + /org/freedesktop/ConsoleKit/Session2 \ + org.freedesktop.ConsoleKit.Session.Unlock +done + +echo "Done! Unlocked all ConsoleKit sessions!" -- cgit v1.2.2