Openbox exit

Hi, I was playing around with some different themes, so I just attempted to use the regular openbox Exit menu using the exit action, or the openbox --exit command. This does stop openbox, but not the x server, and the x server continues running. Before, I could use this and it would do as I had it set up, and logout and restart my login manager, SLiM. I have just noticed this happening recently, possibly after a update. I cannot provide a specific action after which this began to happen, as I just noticed it yesterday. I can confirm that it is not the theme causing this. Any help would be appreciated! Thanks.
Last edited by Multimoon (2012-10-28 02:58:04)

I am having the same problem, so perhaps my information will be helpful. I am not sure if this started with yesterday's removal of ConsoleKit from the official repositories, since I've been using i3 recently.
I am not in [testing] and am running Openbox 3.5.0-7. It's started by Slim using this line in ~/.xinitrc:
exec dbus-launch openbox-session
The only lines in /var/log/slim.log read:
slim: waiting for X server to shut down
slim: waiting for X server to begin accepting connections.
This error also happens if try exiting Openbox after starting it from another tty with "startx".
I have looked through most of the logs in /var/log/ and couldn't find anything timestamped remotely close to the last failed Openbox exit attempt. Nothing registers in the Journal immediately after trying to exit either. Finally, running "openbox --exit" in a terminal does not return any output. So at this point, I am at a loss as to where to look for useful information.
As Gusar suggested in the other thread, exiting of Openbox with "pkill -KILL openbox" does seem to work, but are there any disadvantages to doing it this way?
Last edited by n125 (2012-10-31 07:42:39)

Similar Messages

  • Openbox exit command

    Hello. I'm playing around with GIMP and Idesk. I'm making icons and would like to know the actual exit command for openbox to put in an Idesktop lnk-file so I only have to click on an icon to exit openbox.
    Last edited by jai134 (2009-04-08 19:14:53)

    i have no idea if there's an actual command.  i always use `pkill openbox`

  • Openbox Exit Issue [SOLVED]

    I recently did a new Arch install by following the steps in the Wiki.  This is my second time doing this.  My first time around was a successful install using KDE but I wanted to start fresh with a lighter load so I went with LXDE/Openbox (I installed the LXDE package group but removed lxpanel and am using tint2 instead).  Everything boots OK, LXDM starts, then in to Openbox OK.  My problem is when I choose Exit from the Openbox menu, I am not sent back to LXDM but instead the system kind of freezes.  My wallpaper and tint2 panel are still present but the Openbox menu does not function and I'm forced to Ctrl-Alt-F12 or bang on my keyboard hoping to get to a terminal window.  Does anyone know what might be causing this?
    Last edited by Plus (2011-10-02 04:29:54)

    I'd have to ask are you looking to:
    a) logout [ exit ] back to tty1 for some reason or
    b) do you just need a quick method to have the options to shutdown / reboot your system without installing additional software?
    If your looking for b you can use my method if you like. In all the examples obviously replace "photek" with your username.
    1. Create a new menu entry [ I use obmenu ] called System Power. Create two sub headers with commands on the right:
        Label:               Command:
        Reboot              /home/photek/.startup/reboot.sh
        Shutdown         /home/photek/.startup/shutdown.sh
    Now create these dead simple scripts in a new directory ".startup" in your home folder.
    reboot.sh
    #!/bin/bash
    sudo reboot
    shutdown.sh
    #!/bin/bash
    sudo shutdown -hP 0
    I know the scripts are ridiculously simple but this method you can add commands like "play ~/.startup/shutdown.ogg && sudo shutdown -hP 0" if you want sox to play an outro sample or whatever. I used to use startup and shutdown sounds but they began to grate over time!
    Last thing is to make sure you have the scripts as executable and you then just need a simple edit visudo "User alias" and "Cmnd Alias". Respectively as such:
    photek ALL=(ALL) NOPASSWD: SHUTDOWN_CMDS
    Cmnd_Alias SHUTDOWN_CMDS = /sbin/shutdown, /sbin/halt, /sbin/reboot
    I've attached a copy of my visudo for reference. Anyhow, hope this helps a little with your new Openbox Arch install. Excellent WM choice BTW
    ## sudoers file.
    ## This file MUST be edited with the 'visudo' command as root.
    ## Failure to use 'visudo' may result in syntax or file permission errors
    ## that prevent sudo from running.
    ## See the sudoers man page for the details on how to write a sudoers file.
    ## Host alias specification
    ## Groups of machines. These may include host names (optionally with wildcards),
    ## IP addresses, network numbers or netgroups.
    # Host_Alias WEBSERVERS = www1, www2, www3
    ## User alias specification
    ## Groups of users. These may consist of user names, uids, Unix groups,
    ## or netgroups.
    # User_Alias ADMINS = millert, dowdy, mikef
    photek ALL=(ALL) NOPASSWD: SHUTDOWN_CMDS
    ## Cmnd alias specification
    ## Groups of commands. Often used to group related commands together.
    # Cmnd_Alias PROCESSES = /usr/bin/nice, /bin/kill, /usr/bin/renice, \
    # /usr/bin/pkill, /usr/bin/top
    Cmnd_Alias SHUTDOWN_CMDS = /sbin/shutdown, /sbin/halt, /sbin/reboot
    ## Defaults specification
    ## Defaults specification
    ## You may wish to keep some of the following environment variables
    ## when running commands via sudo.
    ## Locale settings
    # Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
    ## Run X applications through sudo; HOME is used to find the
    ## .Xauthority file. Note that other programs use HOME to find
    ## configuration files and this may lead to privilege escalation!
    # Defaults env_keep += "HOME"
    ## X11 resource path settings
    # Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH"
    ## Desktop path settings
    # Defaults env_keep += "QTDIR KDEDIR"
    ## Allow sudo-run commands to inherit the callers' ConsoleKit session
    # Defaults env_keep += "XDG_SESSION_COOKIE"
    ## when running commands via sudo.
    ## Locale settings
    # Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
    ## Run X applications through sudo; HOME is used to find the
    ## .Xauthority file. Note that other programs use HOME to find
    ## configuration files and this may lead to privilege escalation!
    # Defaults env_keep += "HOME"
    ## X11 resource path settings
    # Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH"
    ## Desktop path settings
    # Defaults env_keep += "QTDIR KDEDIR"
    ## Allow sudo-run commands to inherit the callers' ConsoleKit session
    # Defaults env_keep += "XDG_SESSION_COOKIE"
    ## Uncomment to enable special input methods. Care should be taken as
    ## this may allow users to subvert the command being run via sudo.
    # Defaults env_keep += "XMODIFIERS GTK_IM_MODULE QT_IM_MODULE QT_IM_SWITCHER"
    ## Uncomment to enable logging of a command's output, except for
    ## sudoreplay and reboot. Use sudoreplay to play back logged sessions.
    # Defaults log_output
    # Defaults!/usr/bin/sudoreplay !log_output
    # Defaults!/usr/local/bin/sudoreplay !log_output
    # Defaults!/sbin/reboot !log_output
    ## Runas alias specification
    ## User privilege specification
    root ALL=(ALL) ALL
    ## Uncomment to allow members of group wheel to execute any command
    %wheel ALL=(ALL) ALL
    ## Same thing without a password
    # %wheel ALL=(ALL) NOPASSWD: ALL
    photek ALL=(ALL) NOPASSWD: SHUTDOWN_CMDS
    ## Uncomment to allow members of group sudo to execute any command
    # %sudo ALL=(ALL) ALL
    ## Uncomment to allow any user to run sudo if they know the password
    ## of the user they are running the command as (root by default).
    # Defaults targetpw # Ask for the password of the target user
    # ALL ALL=(ALL) ALL # WARNING: only use this together with 'Defaults targetpw'
    ## Read drop-in files from /etc/sudoers.d
    ## Read drop-in files from /etc/sudoers.d
    ## (the '#' here does not indicate a comment)
    #includedir /etc/sudoers.d
    Last edited by gshroc (2011-09-24 18:58:25)

  • Proper way to exit openbox

    Hi,
    I'm running latest Arch with native systemd + slim +openbox.
    I think that a recent change has changed the way that slim + openbox is working.
    slim.service is working and I can log in
    openbox is started via .xinitrc using exec openbox-session
    in a terminal I see that
    $ loginctl --no-pager show-session $XDG_SESSION_ID | grep Active
    Active=yes
    so session management with systemd-logind appears to be working. However, I can only logout once from openbox using openbox --exit.
    The first time I do this slim reappears and I can log back in. The second time  logout gets bumped to the console; I can restart slim.service to get back in.
    How should I be starting openbox ie do I need ck-launch-session / dbus-launch any longer?
    How should I be exiting openbox? Is openbox --exit the right way?
    Is this the same issue as https://bbs.archlinux.org/viewtopic.php?id=151304

    Hi.
    With systemd-logind as session manager, you should not use console kit and the 'ck-launch-session' which comes with it.
    If you created your ~/.xinitrc from the '/etc/skel/.xinitrc' template and so have these lines in it:
    if [ -d /etc/X11/xinit/xinitrc.d ]; then
    for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
    done
    unset f
    fi
    you don't need to use the dbus-launch command either, as a session dbus instance is already existing.
    Personally I don't use slim but only startx, and I want to return to a console prompt when I exit openbox.
    I use the 'Exit' action in the main menu (I don't see the command line --exit parameter in the doc).
    In your case, you want to return to the slim login screen, and if it doesn't return to it, I tend to think it is a problem with the slim service file.
    Is there a 'Restart=always' in it?
    Last edited by berbae (2013-04-26 16:02:12)

  • [Solved] Openbox fails to exit back to prompt after upgrade

    I don't use any login manager so I simply boot to a console and start openbox manually via xinit.
    However, after upgrade OpenBox fails to exit back to the login console. Anyone experiencing the same? Any idea on how to fix it?
    Several programs got updated recently, xinit, openbox,... so I don't know what exactly is causing the problem...
    I also have xmonad but that still works fine. So if I have to guess it's openbox's (3.5.0) issue.
    Last edited by pingpong (2012-11-01 03:33:29)

    Hm, here's a backtrace after running openbox --exit:
    #0 0xb76e0424 in __kernel_vsyscall ()
    #1 0xb70ba422 in __lll_lock_wait () from /usr/lib/libpthread.so.0
    #2 0xb70b5e82 in _L_lock_675 () from /usr/lib/libpthread.so.0
    #3 0xb70b5e17 in pthread_mutex_lock () from /usr/lib/libpthread.so.0
    #4 0xb7231cf4 in pthread_mutex_lock () from /usr/lib/libc.so.6
    #5 0xb7634c10 in g_mutex_lock () from /usr/lib/libglib-2.0.so.0
    #6 0xb6fe8348 in ?? () from /usr/lib/libpangoxft-1.0.so.0
    #7 0xb6fe87a7 in pango_xft_shutdown_display () from /usr/lib/libpangoxft-1.0.so.0
    #8 0xb6fe8887 in ?? () from /usr/lib/libpangoxft-1.0.so.0
    #9 0xb748d0f3 in XCloseDisplay () from /usr/lib/libX11.so.6
    #10 0xb72e5d86 in obt_display_close () from /usr/lib/libobt.so.0
    #11 0x0805487e in main ()
    So openbox is calling XCloseDisplay() but it never returns because Pango is stuck trying to clean up?!
    Edit: Others noticed it too: https://bugzilla.redhat.com/show_bug.cgi?id=802086#c6
    Edit 2: Are there any programmers here? Does this look OK to you? close_display_cb() gets called when the X connection is closed, and it calls pango_xft_shutdown_display() while holding a lock on fontmaps. Then pango_xft_shutdown_display() immediately calls pango_xft_find_font_map(), which also tries to acquire a lock on the already locked fontmaps. Bang!
    Last edited by ma (2012-11-02 16:12:05)

  • [SOLVED] Closing Openbox doesn't close X

    Hey guys, I'm not sure if this is specifically a [testing] problem or not, but:
    Whenever I close openbox or run openbox restart, it drops me to a simple x session with no window management and doesn't close X. As a result of this, I've had no way to restart openbox without rebooting my computer completely.
    CTRL+ALT+F1 and CTRL+C doesn't work, as it did in the past, since it seems X now starts on VT1, which I think is a side-effect of systemd but I'm not sure.
    If anyone has experienced this, or has advice on how to restore this behavior to normal, I would appreciate it.
    Last edited by ndt (2012-11-02 18:29:33)

    I see exactly the same problem. It appears that 'openbox --exit' kills the WM, but does not fully exit openbox, hence the session remains. In my logout script, I now need an extra line after the exit, eg. 'openbox --exit; pkill -9 openbox'.
    The issue also affects oblogout.
    [EDIT}: I didn't notice that this is on [testing]. I do not use testing. This affects me on non-testing repos. I noticed it today (Oct 30).
    Last edited by mervinb (2012-11-01 02:08:08)

  • Shutting down, restarting computer from within openbox

    I got openbox+slim working great on a testing machine. The only problem is is that I have to drop to console to shutdown or reboot the computer. How would I set up restarting/shutdown without having to drop to the shell?

    I use this script.
    #!/usr/bin/env python
    import pygtk
    pygtk.require('2.0')
    import gtk
    import os
    class DoTheLogOut:
    # Cancel/exit
    def delete_event(self, widget, event, data=None):
    gtk.main_quit()
    return False
    # Logout
    def logout(self, widget):
    os.system("openbox --exit")
    # Reboot
    def reboot(self, widget):
    os.system("sudo shutdown -r now && openbox --exit")
    # Shutdown
    def shutdown(self, widget):
    os.system("sudo shutdown -h now && openbox --exit")
    def __init__(self):
    # Create a new window
    self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
    self.window.set_title("Exit? Choose an option:")
    self.window.set_resizable(False)
    self.window.set_position(1)
    self.window.connect("delete_event", self.delete_event)
    self.window.set_border_width(20)
    # Create a box to pack widgets into
    self.box1 = gtk.HBox(False, 0)
    self.window.add(self.box1)
    # Create cancel button
    self.button1 = gtk.Button("Cancel")
    self.button1.set_border_width(10)
    self.button1.connect("clicked", self.delete_event, "Changed me mind :)")
    self.box1.pack_start(self.button1, True, True, 0)
    self.button1.show()
    # Create logout button
    self.button2 = gtk.Button("Log out")
    self.button2.set_border_width(10)
    self.button2.connect("clicked", self.logout)
    self.box1.pack_start(self.button2, True, True, 0)
    self.button2.show()
    # Create reboot button
    self.button3 = gtk.Button("Reboot")
    self.button3.set_border_width(10)
    self.button3.connect("clicked", self.reboot)
    self.box1.pack_start(self.button3, True, True, 0)
    self.button3.show()
    # Create shutdown button
    self.button4 = gtk.Button("Shutdown")
    self.button4.set_border_width(10)
    self.button4.connect("clicked", self.shutdown)
    self.box1.pack_start(self.button4, True, True, 0)
    self.button4.show()
    self.box1.show()
    self.window.show()
    def main():
    gtk.main()
    if __name__ == "__main__":
    gogogo = DoTheLogOut()
    main()
    Also I edited the sudoers file so I could run shutdown without password:
    %wheel ALL=(ALL) NOPASSWD: /sbin/shutdown
    Last edited by anonymous_user (2009-11-11 16:55:51)

  • Xfce4 and Openbox

    Okay all,
    I tried searching, didn't have any luck, so here goes:
    I'm following along with the Wiki here to configure Xfce to run with Openbox.  The Wiki says:
    Log into a normal Xfce4 session. From your terminal, type:
    $ killall xfwm4 ; openbox & exit
    This kills xfwm4, runs Openbox, and closes the terminal. Log out, being sure to check the "Save session for future logins" box. On your next login, Xfce4 should use Openbox as its window manager.
    When I do this, Xfce flickers for a moment as the terminal closes and sends me back to the desktop, but nothing has changed.  I then proceed to log out, checking the box as instructed, and log back in.  However, Xfce does not use Openbox as the window manager when I do this.
    When I run:
    $ ps aux | grep -E '(openbox|xfwm4)'
    It returns:
    username 2210 1.5 0.2 137084 9204 tty1 S 02:12 0:00 xfwm4 --display :0.0 --sm-client-id ...
    I've tried this several times without luck.  I have ObConf installed already, and also installed Xfce4 (and was able to get it to load properly using startxfce4, naturally) as well as Openbox (the installation order went Xfce4, Openbox, ObConf in case it matters.)
    Any idea what the issue might be?
    If I run just
    $ killall xfwm4 ; openbox
    (ie, without the exit), I receive the message
    A window manager is already running on screen 0
    Last edited by Brukhar (2012-03-01 04:30:13)

    I have tried both of your above methods, here's the results:
    openbox --replace
    When I do this, it doesn't return control to me in the terminal, so I have to CTRL-C out of it, at which point Openbox isn't running anymore.
    So, I modified it to:
    openbox --replace &
    Now, when I do this, it starts Openbox (the window styling changes obviously), and returns:
    [1] 1687
    Then, running
    ps aux | grep -E '(openbox|xfwm4)'
    returns
    eric 1687 0.0 0.1 96800 7940 pts/0 S 20:09 0:00 openbox --replace
    which indicates Openbox is now running properly.
    So, then I proceed to logout using the menu option, and I check the box for "Save session for future use.".  Upon logout, I see the following warnings:
    // typical X.org startup information
    (xfce4-panel:1660): Wnck-WARNING **: Unhandled action type _OB_WM_ACTION_UNDECORATE
    (xfce4-session:1653): Wnck-WARNING **: Unhandled action type _OB_WM_ACTION_UNDECORATE
    Upon running
    startxfce4
    again, my desktop returns, however my cursor has turned to a black X, and the desktop icon for Home is now partially covered by the top toolbar.  Additionally, when I start a terminal, the top of the terminal is actually overlapping with the menu and part of it is off the screen to the top.
    Running
    ps aux | grep -E '(openbox|xfwm4)'
    reveals that neither xfwm4 nor openbox is running.
    So, then if I run
    openbox &
    I can then at least click the top menu bar and move the terminal back fully onto the screen.  If I click "X" for the terminal, it hides the terminal but it does not disappear from the application bar.  If I then logout, I see the following warnings:
    // typical X.org startup information
    xfdesktop[1661]: starting up
    xfce4-settings-helper: Another instance is already running. Leaving...
    (xfce4-settings-helper:1663): xfce4-settings-helper-WARNING **: Failed to get the _NET_NUMBER_OF_DESKTOPS property.
    xfce4-panel: No window manager registered on screen 0. To start the panel without this check, run with --disable-wm-check.
    (xfce4-panel:1660): Wnck-WARNING **: Unhandled action type _OB_WM_ACTION_UNDECORATE
    (xfce4-session:1653): Wnck-WARNING **: Unhandled action type _OB_WM_ACTION_UNDECORATE
    When I run
    startxfce4
    again, it returns to the previous issue where my desktop shows but the cursor is a black X and the icons and toolbar overlap, and neither xfwm4 nor openbox is running.
    If, instead of running
    openbox &
    when I have no window manager, I instead run
    xfwm4
    it returns to normal (terminal closes properly, nothing is overlapping), and when I logout, I see the following warnings:
    // typical X.org startup information
    xfdesktop[1661]: starting up
    xfce4-settings-helper: Another instance is already running. Leaving...
    (xfce4-settings-helper:1663): xfce4-settings-helper-WARNING **: Failed to get the _NET_NUMBER_OF_DESKTOPS property.
    xfce4-panel: No window manager registered on screen 0. To start the panel without this check, run with --disable-wm-check.
    When I next run
    startxfce4
    everything loads properly (read, it loads normally as it did before I replaced xfwm4 with Openbox, so there are no errors with overlapping icons and menu bars and the terminal actually closes), and there are no warning messages displayed on logout.
    So, what gives?
    Last edited by Brukhar (2012-03-01 02:39:32)

  • Enter login manager and X respawn issue

    Wondering if anyone else has this. I have a login for myself and one for my wife and 'normal' people who don't want/know how to use a tiling WM and firefox-pentadacytl, and want to have a graphical login manager. SLiM caused too many hard crashes where I'd lose the keyboard. GDM and KDM have too much cruft and LXDM is even less stable. Enter looked good, but on logout from openbox (not ScrotWM), tty7 locks up and I'll get the "X respawning too fast: disabled for 5 minutes message" in my logs/tty1.
    With SLiM it looks like this is an auth. file and/or xorg.conf error from what I've read. I've been relying on X to auto-config and don't have an xorg.conf.
    Where do I want to start to work around this?
    I'll post my initab and Xorg logs in a second or two.
    Relevant inittab lines:
    # Boot to console
    #id:3:initdefault:
    # Boot to X11
    id:5:initdefault:
    rc::sysinit:/etc/rc.sysinit
    rs:S1:wait:/etc/rc.single
    rm:2345:wait:/etc/rc.multi
    rh:06:wait:/etc/rc.shutdown
    su:S:wait:/sbin/sulogin -p
    # -8 options fixes umlauts problem on login
    c1:2345:respawn:/sbin/agetty -i -8 38400 tty1 linux
    c2:2345:respawn:/sbin/agetty -8 -s 38400 tty2 linux
    c3:2345:respawn:/sbin/agetty -8 -s 38400 tty3 linux
    c4:2345:respawn:/sbin/agetty -8 -s 38400 tty4 linux
    c5:2345:respawn:/sbin/agetty -8 -s 38400 tty5 linux
    c6:2345:respawn:/sbin/agetty -8 -s 38400 tty6 linux
    ca::ctrlaltdel:/sbin/shutdown -t3 -r now
    x:5:respawn:/usr/bin/enter >/dev/null 2>&1
    Xorg.0.log:
    Oct 23 15:53:35 thimkbrick init: Switching to runlevel: 5
    ...skipping...
    Oct 29 19:14:00 thimkbrick dhcpcd[621]: wlan0: leased 192.168.5.11 for infinity
    Oct 29 19:14:00 thimkbrick dhcpcd[621]: forked to background, child pid 645
    Oct 29 19:18:12 thimkbrick init: Switching to runlevel: 5
    Oct 29 19:18:12 thimkbrick enter: Starting X server. [...x7 more]
    Oct 29 19:18:12 thimkbrick init: Id "x" respawning too fast: disabled for 5 minutes
    Oct 29 19:18:12 thimkbrick enter: Starting X server.
    Oct 29 19:18:18 thimkbrick enter: Server timed out [...x8 more]
    Oct 29 19:18:23 thimkbrick enter: Logging in user
    Oct 29 19:23:13 thimkbrick enter: Starting X server. [...x8 more]
    Oct 29 19:23:13 thimkbrick init: Id "x" respawning too fast: disabled for 5 minutes
    Oct 29 19:23:13 thimkbrick enter: Starting X server.
    Oct 29 19:23:19 thimkbrick enter: Server timed out [...x8 more]
    Last edited by nathan28 (2011-10-29 23:28:56)

    Took another pass at the login manager thing again today. Just tried to re-install xorg-xkbcomp, to little apparent effect.
    Logging out of ScrotWM works. Logging into Openbox (via my other user's login) works. Attempting to log out of openbox, either with the r-click logout or with $ openbox --exit, drops me to an X root window and enter does not reappear without # killall X or #telinit 3 followed by #telinit 5.
    Is is possible that this is a result of the
    exec ck-launch-session dbus-launch --exit-with-session openbox-session
    line in the regular user .xinitrc? Otherwise I'm at a loss for ideas besides hacking the Enter code.
    Mostly giving up on this for now.
    Last edited by nathan28 (2011-12-26 19:04:48)

  • Is there a DE independent program like lxde-logout? [solved]

    The title says pretty much everything. I am setting up e16.
    Using e16, thunar, parcellite, gvolwheel and wbar I have a wonderful desktop. The only complain is I cannot reboot or turn off with a specific program like lxde-logout.
    I know I can just use sudo to allow users of the group power to use halt and reboot... but it seems so ancient...
    So, is there a program like lxde-logout that detects if the user can turn off or reboot the machine and allows to make it with ease?
    Thanks
    Solved! Yes there is at least oblogout and exitx-polkit-git.
    Last edited by ezzetabi (2011-05-26 21:20:18)

    Try with this, it depends only on pygtk
    #!/usr/bin/env python2
    # -*- coding: UTF-8 -*-
    __license__ = """
    Copyright 2008 Pável Varela Rodríguez <[email protected]>
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the Free
    Software Foundation; either version 2 of the License, or (at your option)
    any later version.
    __author__ = "Pável Varela Rodríguez <[email protected]>"
    __version__ = "0.1"
    import os
    try:
    import pygtk
    pygtk.require('2.0')
    import gtk
    except:
    print "Fatal error! PyGTK>=2.0 not found!!!"
    os.sys.exit(1)
    icon_size = gtk.icon_size_register("64x64", 64, 64)
    class ActionButton(gtk.Button):
    def __init__(self, icon_name, label):
    super(ActionButton, self).__init__()
    self.__name = icon_name
    self.set_focus_on_click(False)
    self.set_relief(gtk.RELIEF_NONE)
    self.set_label(label)
    ico = gtk.Image()
    ico.set_from_icon_name(icon_name, icon_size)
    self.set_image(ico)
    self.set_image_position(gtk.POS_TOP)
    def __str__(self):
    return self.__name
    class ShutdownDialog(gtk.Window):
    def __init__(self):
    super(ShutdownDialog, self).__init__()
    self.set_decorated(False)
    self.set_keep_above(True)
    self.set_skip_taskbar_hint(True)
    self.__config()
    self.__initButtonsMap()
    self.__construct()
    self.show_all()
    def __config(self):
    self.set_default_size(240, 80)
    self.set_icon_name("gnome-session-logout")
    self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
    self.set_keep_above(True)
    self.set_resizable(False)
    self.set_title("Exit")
    self.connect("delete-event", self.__quit)
    self.connect("key-press-event", self.__onKeyPress)
    def __construct(self):
    hbox = gtk.HBox()
    for idx in range(len(self.__buttonsMap.keys())):
    ID = str(idx)
    icon_name = self.__buttonsMap[ID]["icon"]
    label = self.__buttonsMap[ID]["label"]
    name = icon_name.split("-")[-1]
    button = ActionButton(icon_name, label)
    setattr(self, "__%s" % name, button)
    button.connect("clicked", self.__doAction)
    hbox.pack_start(button)
    bottombox = gtk.HBox()
    btnCancel = gtk.Button("Cancel", gtk.STOCK_CANCEL)
    btnCancel.connect("clicked", self.__quit)
    btnCancel.set_relief(gtk.RELIEF_NONE)
    bottombox.pack_start(btnCancel)
    vbox = gtk.VBox()
    vbox.pack_start(hbox, True)
    vbox.pack_start(gtk.HSeparator(), False)
    vbox.pack_start(bottombox, False)
    self.add(vbox)
    def __doAction(self, w):
    for ID in self.__buttonsMap.keys():
    if self.__buttonsMap[ID]["icon"] == w.__str__():
    os.system(self.__buttonsMap[ID]["action"])
    def __initButtonsMap(self):
    self.__buttonsMap = {}
    self.__buttonsMap["0"] = {
    "icon": "gnome-session-logout",
    "action": "openbox --exit",
    "label": "Logout"
    self.__buttonsMap["1"] = {
    "icon": "gnome-session-reboot",
    "action": "sudo /sbin/reboot",
    "label": "Reboot"
    self.__buttonsMap["2"] = {
    "icon": "gnome-session-halt",
    "action": "sudo /sbin/halt",
    "label": "Shutdown"
    def __onKeyPress(self, widget, event):
    if event.keyval == gtk.keysyms.Escape:
    self.__quit()
    def __quit(self, widget=None):
    gtk.main_quit()
    if __name__ == "__main__":
    ShutdownDialog()
    gtk.main()
    Last edited by hermes (2011-05-26 16:34:50)

  • [SOLVED] Looking for a terminal command or key binding to exit Openbox

    I've searched the forums and googled, but I haven't been able to find the answer.  I'm sure I've missed it somewhere...
    I start my openbox session with 'startx' from the command line. I would like a terminal command or a key-binding to be able to exit openbox and return to the command line. I just don't like using the menu with my notebooks touchpad.  I just can't seem to figure out what command is used. The menu.xml file lists the command as "Exit", but typing that in a terminal just exits the terminal.
    Any help appreciated.
    Last edited by badfrog88 (2010-09-05 19:08:43)

    gorky wrote:ctrl-alt-backspace won't do the job?
    IIRC, it's disabled by default in xorg-server 1.7 and newer.
    @ badfrog88
    Ctrl + C will kill (almost) any running app you point it to.
    Last edited by karol (2010-09-05 19:17:29)

  • [SOLVED] Messages (errors?) when exiting openbox

    I start openbox from the command line with the startx command. My .xinitrc consists of:
    exec openbox.session
    After exiting I have the following two lines on my console that I don't understand:
    which: no hsetroot (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl)
    which: no esetroot (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl)
    Last edited by kfrazier (2011-10-14 16:45:15)

    Do you have hsetroot installed?
    esetroot is in the AUR: https://aur.archlinux.org/packages.php?ID=4537
    Last edited by karol (2011-10-14 16:07:48)

  • [SOLVED] Autostarted programs not exiting on logout with openbox

    Hi,
    I'm pretty sure I'm just overlooking something obvious, but I simply can't find a solution to the following basic problem. I'm using a simple openbox session started from xdm (also tried lightdm with the same results). In case of xdm, I'm using a .xsession file to start openbox like this:
    exec dbus-launch --exit-with-session openbox-session
    In case of lightdm, it also works without a .xsession or .xinitrc file.
    I'm using "~/.config/openbox/autostart" to start some tools upon login. Until now, I have only started programs which exit right away which worked fine. But now I'd like to use autostart to start a (non-X11) program which should continue to run until I log out. For testing this, I used a simple infinite loop script, let's call it "loop.sh". When I start loop.sh in autostart using "loop.sh &", this script continues to run even if I log out of openbox using the openbox menu. In fact, if I log out and log in multiple times, multiple instances will keep running forever. When I start loop.sh simply using "loop.sh", also the parent processes, namely "/bin/sh /usr/lib/openbox/openbox-autostart OPENBOX" and "sh /home/ochi/.config/openbox/autostart" continue to run.
    What is the correct way to have all processes spawned during the X session killed upon logout?
    For reference, this is the loop script I use:
    #!/bin/bash
    while true; do
    # If you like, you can also play a sound for feedback.
    #paplay /usr/share/sounds/freedesktop/stereo/complete.oga &
    sleep 1
    done
    Update: Using gdm seems to "fix" the problem, i.e. all programs started by the autostart script seem to get killed correctly. However, gdm pulls a LOT of dependencies I don't want to have. I wonder what gdm does differently...
    Last edited by Ochi (2015-04-18 23:38:21)

    I continued to study this subject, and here is what I found at this time.
    First I precise again that I use openbox launched by startx at login in tty.
    When I exit openbox, I return to a -bash prompt, and I then can log out of tty.
    After logging in into openbox, I have:
    └─user.slice
    └─user-1000.slice
    ├─[email protected]
    │ ├─1421 /usr/lib/systemd/systemd --user
    │ └─1422 (sd-pam)
    └─session-c1.scope
    ├─1414 login -- berbae
    ├─1425 -bash
    ├─1432 /bin/sh /usr/bin/startx
    ├─1454 xinit /home/berbae/.xinitrc -- /etc/X11/xinit/xserverrc :0 vt1 -auth /tmp/serverauth.xxxxxxxxxx
    ├─1455 /usr/lib/xorg-server/Xorg -nolisten tcp :0 vt1 -auth /tmp/serverauth.xxxxxxxxxx
    ├─1459 /usr/bin/openbox --startup /usr/lib/openbox/openbox-autostart OPENBOX
    ├─1464 dbus-launch --sh-syntax --exit-with-session
    ├─1465 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
    etc...
    When I exit openbox, without logging out, I have:
    └─user.slice
    └─user-1000.slice
    ├─[email protected]
    │ ├─1421 /usr/lib/systemd/systemd --user
    │ └─1422 (sd-pam)
    └─session-c1.scope
    ├─1414 login -- berbae
    └─1425 -bash
    If I ran something in background from konsole, when in openbox, this is not killed:
    └─user.slice
    └─user-1000.slice
    ├─[email protected]
    │ ├─1421 /usr/lib/systemd/systemd --user
    │ └─1422 (sd-pam)
    └─session-c1.scope
    ├─1414 login -- berbae
    ├─1425 -bash
    ├─1296 /bin/bash /home/berbae/bin/loop.sh
    └─1338 sleep 60
    If I log out, the process is still not killed!
    └─user.slice
    ├─user-1000.slice
    │ ├─[email protected]
    │ │ ├─517 /usr/lib/systemd/systemd --user
    │ │ └─519 (sd-pam)
    │ └─session-c1.scope
    │ ├─1296 /bin/bash /home/berbae/bin/loop.sh
    │ └─1338 sleep 60
    As seen the '[email protected]' with the 'systemd --user' process is not ended too, even after logging out.
    Edit: This is due to the session c1 still active; see next post.
    I don't know if this is intentional, maybe it is a feature.
    Now I found and propose a way to change this apparently default behavior, if it is not wanted.
    First to end the 'systemd --user' process at logout, it is easy; just run:
    $ systemctl --user enable exit.target
    Edit: This is useless, sorry; see next post
    Then to run a process in background, which should end when logging out, just launch it like this:
    $ systemd-run --user loop.sh
    This will launch the command 'loop.sh' as a service in the 'systemd --user' manager, instead of the 'session-c1.scope';
    and it will be ended at logout, because the manager is now ended at logout, with the normal end of the manager.
    Edit: see next post
    I will continue studying this matter, to see if something else interesting can be found.
    Edit: See the 'Edit:' lines above for the modifications, before the explanations in the next post.
    Last edited by berbae (2015-04-16 14:38:35)

  • Openbox + lxpanel - how to exit?

    Hi there,
    After some hours, I finally succeed in basic setup for my archlinux system.
    One more item to solve nevertheless.
    graphics session is done with openbox, I installed too lxpanel.
    The detail is regarding the logout item of lxpanel menu, which one I have to launch?
    Thank you

    Not quite sure exactly what you mean, but when I want to logout i usually just run:
    pkill -u $(whoami)
    where you can replace "$(whoami)" with your username in a script. There is probably a better way to do it. I also have a menu entry in menu.xml
    <item label="Log Out">
    <action name="Exit">
    <prompt>yes</prompt>
    </action>
    </item>
    So when I right click on the desktop there is a "Log Out" option (which is probably the better way of doing it).

  • HOWTO: Startup/Shutdown Sounds in Openbox

    In this tutorial, I will show you how to add startup and shutdown sounds with Openbox, a light-weight window manager. In theory, this should work with any window manager that uses a startup script (or, if you use the startx command, .xinitrc could be used for the same effect); however, I will be focusing on Openbox, so you will have to adapt these instructions for use with other window managers.
    We'll start with a quick background story: I was in a "tweaking" mood a few days ago, and I figured I'd try to set up some startup and shutdown noises for use with Openbox. After a few minutes of messing around, I got it working. I searched to see if there were any tutorials like this, and since there weren't, I figured I would share my knowledge--that's what tutorials are for, right?
    NOTE: I originally posted this on ubuntuforums.org; therefore, there may be some differences (I tried to fix most of them). Even though I did this on Arch originally, I wrote it targeted toward Ubuntu users. I didn't get much of a response--there must not have been too many Ubuntu/Openbox users looking for that. Please point out any inconsistencies, and I'll fix them as soon as possible.
    Now that we have that out of the way, let's get started.
    Step 1: Installing the necessary application(s).
    First off, we will be using a commandline program called play. It is part of the sox package, so let's install that first (you likely have most of its dependancies already).
    # pacman -S sox
    If you'd like, you can cd to a directory with music in it and type play name-of-sound-file.extension to test that it is working. If you don't have any files to try it on, you can do this later after downloading your desired sound files in step 3.
    I also have sudo set up; you will need to set this up to run the shutdown commands from a script as I have them. There is a section in the ArchWiki that will help in setting it up if you want. As for the commands with sudo in them, you can just run them in a root terminal.
    In addition to that, I will be working with obmenu, a program for editing Openbox's menu from a GUI; however, it will work just as well to edit the menu by hand. I assume you already have a preferred method of editing your menu, but if you want to try obmenu, it's only a pacman command away:
    # pacman -S obmenu
    Step 2: Setting up shutdown privileges.
    For this section, I will be adapting a section from a great guide written by urukrama here. We're going to be running a shutdown command from a script, so we need to have it set up to work without any interaction--in this case, that means removing the need for a password for the shutdown command.
    To do this, type in the following command into the terminal:
    sudo visudo
    This will open up the sudoers file, which is used to specifiy user permissions for actions that require root priveleges. For those of you unfamiliar with Vim (I'm with you ), just press i on your keyboard to enter interactive mode, which allows you to edit the file. Then, enter the following line at the end of the file:
    %wheel ALL=NOPASSWD:/sbin/shutdown
    Then press escape to exit interactive mode. Lastly, type in :wq followed by pressing enter to save and exit. Now you can use the sudo shutdown command without entering a password.
    Step 3: Getting the desired sound files.
    Now we come to the fun part of the guide--finding the sounds that we want.
    There are plenty of startup and shutdown noises floating around the web; I went to gnome- and kde-look to check out theirs (the same are available at both sites). Here's a link to the System Sounds section at gnome-look. You can look through and download the ones that interest you; once you have listened to a few and found one that you like, go on. Just for reference, I chose the Dream pack. It fits very nicely with my current setup and theme.
    Step 4: Setting up the shutdown/startup scripts.
    If you haven't already (in the last step), extract the sound files from the package that they downloaded in. Then, look through the files and find the startup and shutdown noises. For me, they were titled Dream Intro.ogg and shutdown.ogg, respectively. Move these files into their own folder. I chose ~/.startup--on my Arch install, it was empty. You may want to put it into a different folder/sub-folder, preferably somewhere in your home folder. You can now remove all the other sound files--hypothetically speaking, it probably wouldn't be too hard to get other sounds (such as minimize, maximize, etc., if provided in the sounds package you chose) working with Openbox, but that is beyond the scope of this tutorial. Now, go to the folder in which you placed the startup and shutdown noises. For simplicity's sake, we're going to place the scripts in this same folder.
    We're going to be making two scripts here--one for reboot and one for shutdown. Open up your text editor of choice here and enter the following line (replacing the "/path/to/file.extension" with the path to your shutdown sound):
    play /path/to/file.extension && sudo shutdown -r now
    For me, it looked like this:
    play ~/.startup/shutdown.ogg && sudo shutdown -r now
    What this does is play the sound file specified and, once that is done, moves on to the reboot process (that's what && does). Save this as reboot.sh. Now make a new file, this time for the actual shutdown. It will be the same as the first except the shutdown command will now be sudo shutdown -h now. Here's what mine looks like:
    play ~/.startup/shutdown.ogg && sudo shutdown -h now
    Save that one as shutdown.sh. At this point, we have completed the scripts for both shutdown commands. Next, open up your Openbox autostart script (should be in /home/<user>/.config/openbox/autostart.sh, where <user> is your username) with the text editor of your choice. You probably already have a few different things in here; if not, it doesn't really matter. Just add the following line to your autostart file (as you can see, I used quotes around this one because this file had a space in its name--you'll want to do the same. You can also use a backslash before the space):
    play "/home/<user>/.startup/Dream Intro.ogg"&
    Make sure you keep the ampersand (&) in tact; otherwise, the script will wait until the sound is done playing before completing the rest of the processes. I recommend that you place the sound file at the beginning of the script so that it starts first--the way I have it set up, everything is ready to go by the time the login sound ends (sooner, actually). Now that we've come this far, we're almost done.
    Step 5: Adding the shutdown options to the Openbox menu.
    At this point, the login sound will be working; however, we still need to set up the shutdown sounds. To do this, we will add a section to the Openbox menu that runs the two scripts we made in the last step.
    Either open up obmenu or use your preferred text editor and open up menu.xml (should be in ~/.config/openbox/menu.xml). As I said, we will be adding two items: one for rebooting and another for shutting down. In obmenu, you can add a new submenu wherever you want (I chose the bottom of the menu) and name it Power (or whatever else you'd like). The first we'll add is named Restart. For the execute line, add the following:
    bash /path/to/reboot.sh
    For me, this path is ~/.startup/reboot.sh. As for the second, name it Shut Down and for the execute command put the following:
    bash /path/to/shutdown.sh
    Again, for me this is ~/.startup/shutdown.sh. Here is what the section in my obmenu looks like:
    As for the pure XML, here it is (I replaced my name with <user> ):
    <item label="Restart">
    <action name="Execute">
    <execute>bash /home/<user>/.startup/reboot.sh</execute>
    </action>
    </item>
    <item label="Shut Down">
    <action name="Execute">
    <execute>bash /home/<user>/.startup/shutdown.sh</execute>
    </action>
    </item>
    With obmenu, just save it, and your menu will be refreshed. When hand-editing the menu.xml file, you have to remember to Reconfigure Openbox (it will be in your menu unless you've removed it).
    And with that, you should have working startup and shutdown sounds. You can test it by right clicking on your desktop and selecting one of your new shutdown options. You should have a sound play followed by the normal shutdown routine. Then when your computer starts back up, you will have a pleasant noise after logging on.
    I hope that helped you! Please point out any errors that you see, and I'll correct them as soon as possible.

    Nice tutorial. I was wondering, I noticed you have a games tab. Do you know how to properly execute games. I am trying to get steam games working also Call of duty 4 as tabs under obmenu. Could you help me out?
    Thanks!

Maybe you are looking for