Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Dec 2016 16:31:07 +0100
From:      Polytropon <freebsd@edvax.de>
To:        David Christensen <dpchrist@holgerdanske.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: FreeBSD 11.0 i386, XDM 1.1.11_6, XFCE 4.12_1 -- How to enable GUI shutdown and restart?
Message-ID:  <20161231163107.64b0582d.freebsd@edvax.de>
In-Reply-To: <bca9e1b0-f298-e5da-d583-134ad0bd18b7@holgerdanske.com>
References:  <e721fc89-46b0-ea8c-9ed3-ad6c0df58c29@holgerdanske.com> <e0b1bd9a-dbe0-31cb-ee70-0cfe87da694b@bananmonarki.se> <2c0d9213-1adc-48b7-bdf6-a6b4a577d726@bananmonarki.se> <622bd615-48b9-031a-65d8-3c7daf663cb9@holgerdanske.com> <09d1385a-6356-b732-ddd4-ebd678c25419@bananmonarki.se> <507828f7-6621-15f8-f55d-0ad172857fc1@holgerdanske.com> <e4100f12-b37d-3e0b-2d5e-5cb65f5c49a5@bananmonarki.se> <20161230154841.7d2561e2.freebsd@edvax.de> <bca9e1b0-f298-e5da-d583-134ad0bd18b7@holgerdanske.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 30 Dec 2016 22:05:52 -0800, David Christensen wrote:
> On 12/30/16 06:48, Polytropon wrote:
> > Or with system provided commands: add yourself to the
> > required groups (wheel, operator),
> 
> Already done:
> 
> 2016-12-30 21:58:34 dpchrist@t7400 ~
> $ grep dpchrist /etc/group
> wheel:*:0:root,dpchrist
> operator:*:5:root,dpchrist
> video:*:44:dpchrist
> dpchrist:*:<redacted>:
> 
> 
> > then add a menu entry
> > for "System Shutdown" (shutdown -p now) and "System Reboot"
> > (shutdown -r now);
> 
> How?

There is some XML file you can edit, and I assume that there
is some kind of "menu editor" (similar to what Gnome inclused)
where you can manually specify a program that will then be
indluced in the menu - or on one of the bars.

This has been super-easy in XFCE 3, "Add icon". :-(

For comparison: I use the same approach in WindowMaker: There
is a submenu I called "Functions" where I never chose anything
from, but have key combinations assigned. It contains an entry
named "System shutdown" with the key combination Control+Mod1+F27
which is Ctrl+Alt+Moon on my Sun type 7 USB keyboard. It simply
executes the following command:

	xterm -class SHUTDOWN -fg black -bg red -e "shutdown -p now ; read DUMMY"

With the membership in the required groups, this is permitted
from my user account.

It looks so simple and easy, why shouldn't it be possible to
implement something similar with a state-of-the-art desktop
environment?



> > You need DBus,
> 
> I believe I have it:
> 
> 2016-12-30 21:59:33 dpchrist@t7400 ~
> $ pkg info | grep dbus
> dbus-1.8.20                    Message bus system for inter-application 
> communication
> dbus-glib-0.104                GLib bindings for the D-BUS messaging system
> 
> 
> > PolicyKit
> 
> I believe I have it:
> 
> 2016-12-30 21:51:54 toor@t7400 ~
> # pkg info | grep policykit
> policykit-0.9_10               Framework for controlling access to 
> system-wide components
> policykit-gnome-0.9.2_7        GNOME frontend to the PolicyKit framework
> 
> 
> > and ConsoleKit installed, if I
> > remember correctly,
> 
> I believe I have it:
> 
> 2016-12-30 21:51:59 toor@t7400 ~
> # pkg info | grep consolekit
> consolekit-0.4.5_4             Framework for defining and tracking users
> 
> 
> > and _maybe_ even HAL (but check that
> > again with the current documentation).
> 
> I believe I have it:
> 
> 2016-12-30 21:52:41 toor@t7400 ~
> # pkg info | grep hal
> hal-0.5.14_31                  Hardware Abstraction Layer for 
> simplifying device access
> 
> 
> > Those services must be running.
> 
> It looks like dbus is running:
> 
> 2016-12-30 22:01:25 toor@t7400 ~
> # ps -A | egrep -i 'dbus|policykit|consolekit|hal'
>    763  -  I       0:00.00 /usr/local/bin/dbus-launch --sh-syntax 
> --exit-with-se
>    764  -  Is      0:00.21 /usr/local/bin/dbus-daemon --fork --print-pid 
> 4 --pri
>    785  -  I       0:00.01 /usr/local/libexec/gvfs-hal-volume-monitor
> 74843  3  S+      0:00.00 egrep -i dbus|policykit|consolekit|hal
> 
> 
> How do I start policykit, consolekit, and hal?

PolicyKit is started by Xfce (the --with-ck-launch options will
enable it), and HAL is started by adding

	hald_enable="YES"

to /etc/rc.conf.



> > Check if "startxfce4" requires some of
> > the "--with-ck-something" options.
> 
> 2016-12-30 21:57:26 dpchrist@t7400 ~
> $ cat .xsession
> #!/bin/sh
> exec /usr/local/bin/startxfce4 --with-ck-launch

That looks fully correct.



> startxfce4 does not appear to have a man page or provide command-line 
> help (?).

Modern X programs do not have manpages. They _sometimes_ have
documentation scattered across the web, in project pages,
Github notes, wikis, user pages, and discussion forums. ;-)



> Where are startxfce4 options documented?

Honestly? I have no idea. I got the --with-ck-launch simply
by web search...



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161231163107.64b0582d.freebsd>