Elogind: Difference between revisions

From Alpine Linux
m (Add see also / gentoo wiki)
(added to Desktop category, minor style changes)
Line 6: Line 6:
== Installation ==
== Installation ==


<pre>
{{Cmd|# apk add {{Pkg|elogind}} {{Pkg|polkit-elogind}}
# apk add elogind polkit-elogind
# rc-update add elogind
# rc-update add elogind
# rc-service elogind start
# rc-service elogind start}}
</pre>


== Configuration ==
== Configuration ==
Line 16: Line 14:
=== logind.conf ===
=== logind.conf ===


Edit <code>/etc/elogind/logind.conf</code> to configure handling of power events, such as suspending the computer when power button is pressed:
Edit {{Path|/etc/elogind/logind.conf}} to configure handling of power events, such as suspending the computer when power button is pressed:


<pre>
{{Cmd|<nowiki># sed -i 's|#HandlePowerKey=poweroff|HandlePowerKey=suspend|' /etc/elogind/logind.conf</nowiki>}}
sed -i 's|#HandlePowerKey=poweroff|HandlePowerKey=suspend|' /etc/elogind/logind.conf
</pre>


=== Working with Desktop Environments ===
=== Working with Desktop Environments ===


If using a Window Manager or Desktop Environment, such as [[Sway]], the user must ensure that login session is correctly configured.  When correctly configured, loginctl command should output the following:
If using a Window Manager or Desktop Environment, such as [[Sway]], the user must ensure that login session is correctly configured.  When correctly configured, the <code>loginctl</code> command should output the following:
 
'''Using [[Sway]] and [[SDDM]]'''
 
<p style="background-color:#f9f9f9; border:1px dashed #2f6fab; line-height:1.1em; padding:1em; font-family:monospace; font-size:10pt; white-space:pre; overflow:auto;"><span style="color:green;">~</span>'''$''' loginctl


<pre>
# using sway and sddm
localhost:~$ loginctl
SESSION  UID USER SEAT  TTY  
SESSION  UID USER SEAT  TTY  
     c1  105 sddm seat0     
     c1  105 sddm seat0     
Line 34: Line 31:


2 sessions listed.
2 sessions listed.
</pre>
</p>


If the output is <code>No session available.</code>, such as in the case of launching Sway from tty, suspend and many other functionality will not work.  The user then must configure a display manager such as greetd, sddm or lightdm.
If the output is <code>No session available.</code>, such as in the case of launching Sway from tty, suspend and many other functionality will not work.  The user then must configure a display manager such as {{Pkg|greetd}}, [[SDDM]] or {{Pkg|lightdm|LightDM}}.


== See also ==
== See also ==


* [https://wiki.gentoo.org/wiki/Elogind elogind - Gentoo Wiki]
* [https://wiki.gentoo.org/wiki/Elogind elogind - Gentoo Wiki]
[[Category:Desktop]]

Revision as of 19:41, 1 June 2023

elogind is a login manager and provides support for

  • setting up necessary permissions for the desktop environment or window manager
  • handling poweroff, reboot, suspend and hibernate via loginctl command

Installation

# apk add elogind polkit-elogind

  1. rc-update add elogind
  2. rc-service elogind start

Configuration

logind.conf

Edit /etc/elogind/logind.conf to configure handling of power events, such as suspending the computer when power button is pressed:

# sed -i 's|#HandlePowerKey=poweroff|HandlePowerKey=suspend|' /etc/elogind/logind.conf

Working with Desktop Environments

If using a Window Manager or Desktop Environment, such as Sway, the user must ensure that login session is correctly configured. When correctly configured, the loginctl command should output the following:

Using Sway and SDDM

~$ loginctl SESSION UID USER SEAT TTY c1 105 sddm seat0 c2 1000 User seat0 tty8 2 sessions listed.

If the output is No session available., such as in the case of launching Sway from tty, suspend and many other functionality will not work. The user then must configure a display manager such as greetd, SDDM or lightdm.

See also