From owner-freebsd-questions@freebsd.org Sat Dec 31 15:31:15 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A146C98924 for ; Sat, 31 Dec 2016 15:31:15 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mailrelay13.qsc.de (mailrelay13.qsc.de [212.99.187.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.antispameurope.com", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A43631FAD for ; Sat, 31 Dec 2016 15:31:14 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de ([213.148.129.14]) by mailrelay13.qsc.de; Sat, 31 Dec 2016 16:32:48 +0100 Received: from r56.edvax.de (port-92-195-83-137.dynamic.qsc.de [92.195.83.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id 41D1E3CC3F; Sat, 31 Dec 2016 16:31:08 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id uBVFV7YM001946; Sat, 31 Dec 2016 16:31:07 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Sat, 31 Dec 2016 16:31:07 +0100 From: Polytropon To: David Christensen 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: References: <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> <20161230154841.7d2561e2.freebsd@edvax.de> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-cloud-security-sender: freebsd@edvax.de X-cloud-security-recipient: freebsd-questions@freebsd.org X-cloud-security-Virusscan: CLEAN X-cloud-security-disclaimer: This E-Mail was scanned by E-Mailservice on mailrelay13.qsc.de with D599A683496 X-cloud-security-connect: mx01.qsc.de[213.148.129.14], TLS=1, IP=213.148.129.14 X-cloud-security: scantime:.2577 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 15:31:15 -0000 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:*:: > > > > 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, ...