Difference between revisions of "Xfce"

(Created a section on how to add a user to the power group)
(3 intermediate revisions by 3 users not shown)
Line 14: Line 14:
  
 
<console>
 
<console>
XFCE profile:
 
 
# ##i## eselect profile add funtoo/1.0/linux-gnu/mix-ins/xfce
 
# ##i## eselect profile add funtoo/1.0/linux-gnu/mix-ins/xfce
 
</console>
 
</console>
Line 39: Line 38:
  
 
<console>
 
<console>
$ ##i##echo "exec ck-launch-session startxfce4" > ~/.xinitrc
+
$ ##i##echo "exec startxfce4 --with-ck-launch" > ~/.xinitrc
 
</console>
 
</console>
  
Note that <tt>ck-launch-session</tt> (from ConsoleKit) is required by Xfce for important tasks such as shutting down, suspending, and automatically mounting removable storage media. Some applications will not work properly without it. Therefore we need to add ConsoleKit to the <tt>default</tt> runlevel, executing the following command as root:
+
Note that <tt>--with-ck-launch</tt> (from ConsoleKit) is required by Xfce for important tasks such as shutting down, suspending, and automatically mounting removable storage media. Some applications will not work properly without it. Therefore we need to add ConsoleKit to the <tt>default</tt> runlevel, executing the following command as root:
  
 
<console>
 
<console>
Line 78: Line 77:
 
# ##i##rc-update add xdm default
 
# ##i##rc-update add xdm default
 
# ##i##/etc/init.d/xdm start
 
# ##i##/etc/init.d/xdm start
 +
</console>
 +
 +
==Power Group==
 +
 +
If you wish to be able to shutdown/reboot/suspend/hibernate using xfce4-logout-session then you will need to add yourself or the user to the power group by:
 +
 +
<console>
 +
# ##i##gpasswd -a <username> power
 +
</console>
 +
 +
If the group does not exist then execute the following and try again:
 +
 +
<console>
 +
# ##i##groupadd power
 +
</console>
 +
 +
Now you need to add the following to /usr/share/polkit-1/actions/org.freedesktop.upower.policy:
 +
 +
<console>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<!DOCTYPE policyconfig PUBLIC
 +
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 +
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
 +
<policyconfig>
 +
  <vendor>The UPower Project</vendor>
 +
  <vendor_url>http://upower.freedesktop.org/</vendor_url>
 +
  <icon_name>system-suspend</icon_name>
 +
 +
  <action id="org.freedesktop.upower.suspend">
 +
    <description>Suspend the system</description>
 +
    <description xml:lang="fr">Mettre le système en veille</description>
 +
    <description xml:lang="it">Sospende il sistema</description>
 +
    <description xml:lang="pl">Wstrzymanie systemu</description>
 +
    <description xml:lang="sv">Försätt systemet i vänteläge</description>
 +
    <message>Authentication is required to suspend the system</message>
 +
    <message xml:lang="fr">Vous devez vous identifier pour mettre le système en veille</message>
 +
    <message xml:lang="it">È richiesto autenticarsi per sospendere il sistema</message>
 +
    <message xml:lang="pl">Wymagane jest uwierzytelnienie, aby wstrzymać system</message>
 +
    <message xml:lang="sv">Autentisering krävs för att försätta systemet i vänteläge</message>
 +
    <defaults>
 +
      <allow_any>yes</allow_any>
 +
      <allow_inactive>no</allow_inactive>
 +
      <allow_active>yes</allow_active>
 +
    </defaults>
 +
  </action>
 +
 +
  <action id="org.freedesktop.upower.hibernate">
 +
    <description>Hibernate the system</description>
 +
    <description xml:lang="fr">Mettre le système en hibernation</description>
 +
    <description xml:lang="it">Iberna il sistema</description>
 +
    <description xml:lang="pl">Hibernacja systemu</description>
 +
    <description xml:lang="sv">Försätt systemet i viloläge</description>
 +
    <message>Authentication is required to hibernate the system</message>
 +
    <message xml:lang="fr">Vous devez vous identifier pour mettre le système en hibernation</message>
 +
    <message xml:lang="it">È richiesto autenticarsi per ibernare il sistema</message>
 +
    <message xml:lang="pl">Wymagane jest uwierzytelnienie, aby zahibernować system</message>
 +
    <message xml:lang="sv">Autentisering krävs för att försätta systemet i viloläge</message>
 +
    <defaults>
 +
      <allow_any>yes</allow_any>
 +
      <allow_inactive>no</allow_inactive>
 +
      <allow_active>yes</allow_active>
 +
    </defaults>
 +
  </action>
 +
 +
</policyconfig>
 +
</console>
 +
 +
and also add the following to /usr/share/polkit-1/actions/org.freedesktop.consolekit.policy:
 +
 +
<console>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<!DOCTYPE policyconfig PUBLIC
 +
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 +
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
 +
 +
<!--
 +
Policy definitions for ConsoleKit
 +
-->
 +
 +
<policyconfig>
 +
 +
  <action id="org.freedesktop.consolekit.system.stop">
 +
    <description>Stop the system</description>
 +
    <message>System policy prevents stopping the system</message>
 +
    <defaults>
 +
      <allow_any>yes</allow_any>
 +
      <allow_inactive>no</allow_inactive>
 +
      <allow_active>yes</allow_active>
 +
    </defaults>
 +
  </action>
 +
 +
  <action id="org.freedesktop.consolekit.system.stop-multiple-users">
 +
    <description>Stop the system when multiple users are logged in</description>
 +
    <message>System policy prevents stopping the system when other users are logged in</message>
 +
    <defaults>
 +
      <allow_any>yes</allow_any>
 +
      <allow_inactive>no</allow_inactive>
 +
      <allow_active>yes</allow_active>
 +
    </defaults>
 +
  </action>
 +
 +
  <action id="org.freedesktop.consolekit.system.restart">
 +
    <description>Restart the system</description>
 +
    <message>System policy prevents restarting the system</message>
 +
    <defaults>
 +
      <allow_any>yes</allow_any>
 +
      <allow_inactive>no</allow_inactive>
 +
      <allow_active>yes</allow_active>
 +
    </defaults>
 +
  </action>
 +
 +
  <action id="org.freedesktop.consolekit.system.restart-multiple-users">
 +
    <description>Restart the system when multiple users are logged in</description>
 +
    <message>System policy prevents restarting the system when other users are logged in</message>
 +
    <defaults>
 +
      <allow_any>yes</allow_any>
 +
      <allow_inactive>no</allow_inactive>
 +
      <allow_active>yes</allow_active>
 +
    </defaults>
 +
  </action>
 +
 +
</policyconfig>
 
</console>
 
</console>
  

Revision as of 14:48, 28 March 2014

About Xfce

Xfce is a lightweight desktop environment for UNIX-like operating systems. It aims to be fast and low on system resources, while still being visually appealing and user friendly.

Xfce embodies the traditional UNIX philosophy of modularity and re-usability. It consists of a number of components that provide the full functionality one can expect of a modern desktop environment. They are packaged separately and you can pick among the available packages to create the optimal personal working environment.

Another priority of Xfce is adhereance to standards, specifically those defined at freedesktop.org. <ref>http://www.xfce.org/about/</ref>

Installation

Before emerging Xfce you need to:

#  eselect profile add funtoo/1.0/linux-gnu/mix-ins/xfce

We are now ready to install Xfce. Install the meta-package, which pulls in all of the components you need for a minimal Xfce installation:

# emerge xfce4-meta

Running Xfce

There are several different ways to start Xfce:

  • Editing the .xinitrc file in your user's home directory and using startx from a text console.
  • Using a display manager (e.g. SLiM, GDM, and KDM).
  • Configuring your shell profile to automatically start Xfce upon a successful login.

.xinitrc

The most common way to start the environment is to configure ~/.xinitrc to launch an Xfce session. The proper way to launch Xfce from the terminal is by using startxfce4 combined with ck-launch-session.

$ echo "exec startxfce4 --with-ck-launch" > ~/.xinitrc

Note that --with-ck-launch (from ConsoleKit) is required by Xfce for important tasks such as shutting down, suspending, and automatically mounting removable storage media. Some applications will not work properly without it. Therefore we need to add ConsoleKit to the default runlevel, executing the following command as root:

# rc-update add consolekit default

Finally, to start the graphical environment, run startx from a login shell:

$ startx

Display Manager

A display manager is a program that manages sessions and acts as a login screen. Here's a short list of a few of the display managers available in Funtoo:

  • XDM (x11-apps/xdm): X.Org's standard display manager.
  • LightDM (x11-misc/lightdm): A lightweight, but highly configurable display manager.
  • SLiM (x11-misc/slim): Simple Login Manager -- a lightweight display manager. Not very configurable.

Any of these would make a fine choice. After you've chosen which display manager to use, install it:

# emerge lightdm

All that's left to do now is to add the name of the display manager to /etc/conf.d/xdm, add the xdm service to the default runlevel, and start the service:

DISPLAYMANAGER="lightdm"
# rc-update add xdm default
# /etc/init.d/xdm start

Power Group

If you wish to be able to shutdown/reboot/suspend/hibernate using xfce4-logout-session then you will need to add yourself or the user to the power group by:

# gpasswd -a <username> power

If the group does not exist then execute the following and try again:

# groupadd power

Now you need to add the following to /usr/share/polkit-1/actions/org.freedesktop.upower.policy:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
<policyconfig>
  <vendor>The UPower Project</vendor>
  <vendor_url>http://upower.freedesktop.org/</vendor_url>
  <icon_name>system-suspend</icon_name>

  <action id="org.freedesktop.upower.suspend">
    <description>Suspend the system</description>
    <description xml:lang="fr">Mettre le système en veille</description>
    <description xml:lang="it">Sospende il sistema</description>
    <description xml:lang="pl">Wstrzymanie systemu</description>
    <description xml:lang="sv">Försätt systemet i vänteläge</description>
    <message>Authentication is required to suspend the system</message>
    <message xml:lang="fr">Vous devez vous identifier pour mettre le système en veille</message>
    <message xml:lang="it">È richiesto autenticarsi per sospendere il sistema</message>
    <message xml:lang="pl">Wymagane jest uwierzytelnienie, aby wstrzymać system</message>
    <message xml:lang="sv">Autentisering krävs för att försätta systemet i vänteläge</message>
    <defaults>
      <allow_any>yes</allow_any>
      <allow_inactive>no</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>

  <action id="org.freedesktop.upower.hibernate">
    <description>Hibernate the system</description>
    <description xml:lang="fr">Mettre le système en hibernation</description>
    <description xml:lang="it">Iberna il sistema</description>
    <description xml:lang="pl">Hibernacja systemu</description>
    <description xml:lang="sv">Försätt systemet i viloläge</description>
    <message>Authentication is required to hibernate the system</message>
    <message xml:lang="fr">Vous devez vous identifier pour mettre le système en hibernation</message>
    <message xml:lang="it">È richiesto autenticarsi per ibernare il sistema</message>
    <message xml:lang="pl">Wymagane jest uwierzytelnienie, aby zahibernować system</message>
    <message xml:lang="sv">Autentisering krävs för att försätta systemet i viloläge</message>
    <defaults>
      <allow_any>yes</allow_any>
      <allow_inactive>no</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>

</policyconfig>

and also add the following to /usr/share/polkit-1/actions/org.freedesktop.consolekit.policy:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">

<!--
Policy definitions for ConsoleKit
-->

<policyconfig>

  <action id="org.freedesktop.consolekit.system.stop">
    <description>Stop the system</description>
    <message>System policy prevents stopping the system</message>
    <defaults>
      <allow_any>yes</allow_any>
      <allow_inactive>no</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>

  <action id="org.freedesktop.consolekit.system.stop-multiple-users">
    <description>Stop the system when multiple users are logged in</description>
    <message>System policy prevents stopping the system when other users are logged in</message>
    <defaults>
      <allow_any>yes</allow_any>
      <allow_inactive>no</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>

  <action id="org.freedesktop.consolekit.system.restart">
    <description>Restart the system</description>
    <message>System policy prevents restarting the system</message>
    <defaults>
      <allow_any>yes</allow_any>
      <allow_inactive>no</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>

  <action id="org.freedesktop.consolekit.system.restart-multiple-users">
    <description>Restart the system when multiple users are logged in</description>
    <message>System policy prevents restarting the system when other users are logged in</message>
    <defaults>
      <allow_any>yes</allow_any>
      <allow_inactive>no</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>

</policyconfig>