FreeBSD 11.0 i386, XDM 1.1.11_6, XFCE 4.12_1 -- How to enable GUI shutdown and restart?

David Christensen dpchrist at holgerdanske.com
Sat Dec 31 05:48:24 UTC 2016


On 12/30/16 03:38, Bernt Hansson wrote:
> Dbus is installed? Think it comes with xfce but not sure.

It looks like dbus is installed:

2016-12-30 20:12:12 toor at t7400 ~
# pkg info | grep -i dbus
dbus-1.8.20                    Message bus system for inter-application 
communication
dbus-glib-0.104                GLib bindings for the D-BUS messaging system


> If it does not work you have to work some magic with devd i think.

STFW I see:

http://docs.xfce.org/xfce/xfce4-panel/applicationsmenu

https://wiki.xfce.org/howto/customize-menu


Taking some hints from the latter:

root at t7400:~ # head -n 29 
/usr/local/etc/xdg/menus/xfce-applications.menu | tail -n 15
     <Layout>
         <Filename>xfce4-run.desktop</Filename>
         <Separator/>
         <Filename>exo-terminal-emulator.desktop</Filename>
         <Filename>exo-file-manager.desktop</Filename>
         <Filename>exo-mail-reader.desktop</Filename>
         <Filename>exo-web-browser.desktop</Filename>
         <Separator/>
         <Menuname>Settings</Menuname>
         <Separator/>
         <Merge type="all"/>
         <Separator/>
         <Filename>xfce4-about.desktop</Filename>
         <Filename>xfce4-session-logout.desktop</Filename>
     </Layout>

root at t7400:~ # head 
/usr/local/share/applications/xfce4-session-logout.desktop
[Desktop Entry]
Version=1.0
Type=Application
Exec=xfce4-session-logout
Icon=system-log-out
StartupNotify=false
Terminal=false
Categories=System;X-XFCE;X-Xfce-Toplevel;
OnlyShowIn=XFCE;
Name=Log Out

root at t7400:~ # which xfce4-session-logout
/usr/local/bin/xfce4-session-logout

root at t7400:~ # apropos xfce4-session-logout
xfce4-session-logout(1) - Logs out from Xfce

root at t7400:~ # cd /usr/ports/x11-wm/xfce4-session/

root at t7400:/usr/ports/x11-wm/xfce4-session # make fetch
<snip>

root at t7400:/usr/ports/x11-wm/xfce4-session # make patch
<snip>

root at t7400:/usr/ports/x11-wm/xfce4-session # make configure
<snip>


Here is the source code for xfce4-session-logout:

/usr/ports/x11-wm/xfce4-session/work/xfce4-session-4.12.1/xfce4-session-logout/main.c


I don't know GTK or dbus programming, but it looks like 
xfce4-session-logout displays the dialog box and then sends a message to 
dbus depending upon what the user clicks (?).  I don't know how GTK 
decides which buttons are enabled and which are disabled, or how dbug 
processes messages.


David



More information about the freebsd-questions mailing list