Difference between revisions of "ConsoleKit"

From ArchWiki
Jump to navigation Jump to search
(Warn of nested session. Show how test, whether a session is running)
Line 8: Line 8:
  
 
=== ck-launch-session ===
 
=== ck-launch-session ===
 +
{{Note|Do not nest consolekit sessions by calling one from another or you break consolekit.}}
 
To launch an X session with consolekit, using a [[display manager]] like [[SLiM]], append the following to the {{Codeline|exec}} statement in {{Filename|~/.xinitrc}} e.g.:
 
To launch an X session with consolekit, using a [[display manager]] like [[SLiM]], append the following to the {{Codeline|exec}} statement in {{Filename|~/.xinitrc}} e.g.:
  
Line 15: Line 16:
  
 
=== Running several applications from ~/.xinitrc ===
 
=== Running several applications from ~/.xinitrc ===
 +
 
If several applications are to be executed from {{Filename|~/.xinitrc}}, not all of these will have consolekit environment variables set. In the following example, only children of compiz will be able to properly use conosolekit, but children of xterm won't.
 
If several applications are to be executed from {{Filename|~/.xinitrc}}, not all of these will have consolekit environment variables set. In the following example, only children of compiz will be able to properly use conosolekit, but children of xterm won't.
  
Line 35: Line 37:
 
Don't forget to make .xstart executable:
 
Don't forget to make .xstart executable:
 
  chmod +x ~/.xstart
 
  chmod +x ~/.xstart
 +
 +
To see whether everything is started right:
 +
ck-list-sessions
 +
It should show at least one session like this one
 +
Session18:
 +
        unix-user = '1000'
 +
        realname = 'Your Name'
 +
        seat = 'Seat1'
 +
        session-type = ''
 +
        active = TRUE
 +
        x11-display = ':0'
 +
        x11-display-device = '/dev/tty2'
 +
        display-device = '/dev/tty1'
 +
        remote-host-name = ''
 +
        is-local = TRUE
 +
        on-since = '2011-11-16T12:01:50.104764Z'
 +
        login-session-id = '7'
  
 
== More resources ==
 
== More resources ==
 
*[https://bbs.archlinux.org/viewtopic.php?id=116853  ck-launch-session, compiz and mounting in thunar/udisks]
 
*[https://bbs.archlinux.org/viewtopic.php?id=116853  ck-launch-session, compiz and mounting in thunar/udisks]

Revision as of 15:08, 16 November 2011

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

ConsoleKit is a framework for managing user sessions and permissions. Some of the most common usages of consolekit is allowing non-root users to mount removable media and suspending/shutting down the computer through common desktop applications (ie: thunar, nautilus, the gnome shutdown menu, etc).

Display manager usage

ck-launch-session

Note: Do not nest consolekit sessions by calling one from another or you break consolekit.

To launch an X session with consolekit, using a display manager like SLiM, append the following to the Template:Codeline statement in Template:Filename e.g.:

exec ck-launch-session startxfce4

This starts xfce with proper enviroment variables so it and it's children are able to use consolekit. Display managers like KDM, GDM and LXDM starts consolekit automatically with each X session.

Running several applications from ~/.xinitrc

If several applications are to be executed from Template:Filename, not all of these will have consolekit environment variables set. In the following example, only children of compiz will be able to properly use conosolekit, but children of xterm won't.

xterm &
exec ck-launch-session compiz ccp

Typically, this can be an issue when for example using compiz standalone and some other application launchers, (gnome-do, kupfer, gmrun, xbindkeys, etc.) since children of the application launcher won't be able to use consolekit. A dirty workaround is to have the entire session started by a second script, e.g. Template:Filename. Don't forget dbus-launch, it's likely you need it too:

Template:File


Template:File

Don't forget to make .xstart executable:

chmod +x ~/.xstart

To see whether everything is started right:

ck-list-sessions

It should show at least one session like this one

Session18:
       unix-user = '1000'
       realname = 'Your Name'
       seat = 'Seat1'
       session-type = 
       active = TRUE
       x11-display = ':0'
       x11-display-device = '/dev/tty2'
       display-device = '/dev/tty1'
       remote-host-name = 
       is-local = TRUE
       on-since = '2011-11-16T12:01:50.104764Z'
       login-session-id = '7'

More resources