How to set up openbox

Post tutorials, HOWTO's and other useful resources here.
Post Reply
User avatar
ncmprhnsbl
Full of knowledge
Full of knowledge
Posts: 783
Joined: 20 Mar 2012, 03:42
Distribution: 3.2.2-64bit xfce/openbox
Location: australia
Contact:

How to set up openbox

Post#1 by ncmprhnsbl » 08 Jun 2013, 07:41

Here is a thread to those who wish to use openbox. Feel free to share your techniques and configs.
This post will most likely be edited.(it has)
..and a module built,(here you go) viewtopic.php?f=75&p=16389#p16368 which should make most of this redundant ..but not really..

First, grab Lxde destop, (presently 2.1 RC2)
Install, save changes, magicfolders etc....
Lxde uses openbox to manage windows and virtual desktops.
Heres what i did to use openbox in a /bang sort of way.
Here are 2 possible ways to go.
First, the Lxde way,
1.Edit
/etc/xdg/lxsession/LXDE/autostart), comment out pcmanfm and pcmanfm.

Code: Select all

!@pcmanfm --desktop --profile LXDE
!@lxpanel-porteus

and add ~/.config/lxsession/LXDE/autostart
example:

Code: Select all

imlibsetroot -s ~/.wallpaper/porteuswalppr-2.png
!sh ~/.fehbg 
tint2
conky -q
volumeicon -b
compton --config ~/compton.conf
-note. the'@' symbol forces restart of process if it crashes(necessary?)

2.Copy
your favourite settings/keybinds to ~/.config/openbox/lxde-rc.xml or simply rename rc.xml

Second The openbox-session way..
1.Edit(as root)
/etc/lxdm/lxdm.conf line 10:

Code: Select all

session=/usr/bin/openbox-session
this will log you in to openbox instead of lxde at boot


2.Rightclick Menu -
already got it in /home/guest/.config/openbox/menu.xml plus dynamic applications menu with 'openbox-menu'
**** NOTE since Porteus 3.0, menu entry must be: execute="openbox-menu lxde-applications.menu"

3.rc.xml
mouse, keybinds and window/desktop rules in /home/guest/.config/openbox/rc.xml
copy from /etc/xdg/openbox if necessary

4.Add autostart
in /home/guest/.config/openbox/autostart
example:

Code: Select all

(sleep 3 && /usr/bin/nm-applet --sm-disable) &
sh ~/.fehbg &
tint2 &
conky -q &
volumeicon -b &
xcompmgr &
5.Wallpaper:
feh i wanted conky with transparency so instead of pcmanfm as background setter
file /home/guest/.fehbg =
feh --bg-scale '/path/to/image'
as a bonus you get a cool image viewer and can directly set background from viewer.
or
hsetroot(debian)works fine
autostart line:

Code: Select all

hsetroot -fill /path/to/image
or
imlibsetroot http://robotmonkeys.net/2012/12/30/imlibsetroot-1-6/)
autostart line:

Code: Select all

imlibsetroot -s /path/to/image &
or
xsetroot(default)plain colours or possibly a pattern with '-bitmap <filename>' ? or gradient?
or
pcmanfm or spacefm can also set backgrounds and desktop icons..but if you want this, stick with lxde..

6.Utilities(in PPM):
tint2 for systemtray and pager and other stuff if you want

volumeicon to change volume

scrot set to 'printsrceen' key in rc.xml and/or add menu entr(ies) in menu.xml (now built in to lxde)

conky for coolness.. porteus conky is built with lua and audacious support

spacefm ...nothing against pcmanfm..but..easier to set up(in openbox-session) and has a smaller footprint with more features...

mc :)

7.Others:
dmenu a handy run menu (package from slackware)
xcompmgr for some candy (package from slackware)* buggy- gives transparency and fading, no shadows.
compton (from https://github.com/chjj/compton ) gives transparency(window border,unfocused) fading, shadows. includes compton-trans for ondemand window transparency....and more..
openbox-menu gives dynamic menu from lxde http://fabrice.thiroux.free.fr/openbox-menu_en.html (included with lxde)
**** NOTE since Porteus 3.0, menu entry must be: execute="openbox-menu lxde-applications.menu"
obmenu (from http://obmenu.sourceforge.net/ ) gui menu editor *untested *needs python
yampo (from source..?) C based? dynamic pipemenu, requires prebuild configuration
obmenu-generator (from source..?) perl script generates static or dynamic menus, overwrites menu.xml, requires (?),(?) perl modules
obkey (from http://code.google.com/p/obkey/ ) gui keybinds editor *untested *needs python
conkyswitcher script to change between two configs, ~/.conkyrc and .conkyrc1

Code: Select all

#!/bin/bash
#A script to switch conky
## Conkyswitch V.3 ;-) [Credits- genesis300, yoshi314 and combined by sHy ;-D]

pkill -2 -f conky
cp ~/.conkyrc ~/.conkyrc.bak
cp ~/.conkyrc1 ~/.conkyrc
mv ~/.conkyrc.bak ~/.conkyrc1
conky -c ~/.conkyrc -q &
What we don't have:
direct shutdown from menu, only logout to lxdm, then shutdown/reboot(fixed)

General Resources:
http://openbox.org/
http://crunchbang.org/forums/viewtopic.php?id=85
https://wiki.archlinux.org/index.php/Openbox
https://wiki.archlinux.org/index.php/Op ... d_programs
Last edited by ncmprhnsbl on 12 Mar 2014, 03:25, edited 10 times in total.
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44

saneks
White ninja
White ninja
Posts: 23
Joined: 13 Dec 2012, 23:35
Distribution: Porteus 2.0 XFCE, 2.1 Lxde
Location: Germany

Re: How to set up openbox

Post#2 by saneks » 10 Jun 2013, 19:06

yeah, you #!'ed porteus, nice one. was my project to do as well when I had some time.. nice.. can you share some config files for the forum?

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: How to set up openbox

Post#3 by Ahau » 10 Jun 2013, 19:24

It would be pretty cool to get all of this stuff put in a single module that could go in along lxde, so all a user has to do is drop it in /modules, reboot, and there's a configured openbox (hell yeah!).

I believe openbox-menu will go inside the lxde module, I've already written a slackbuild for it, just haven't finished wrapping it into the xml file.

I haven't done anything with this yet, but it seems like it would be pretty easy to add a menu item that runs a a gtkdialog popup to confirm the choice reboot/restart. All I'd need to write that is a CLI command that would allow the 'guest' or other nonpriveleged user to reboot or halt without entering the root password (or, we live with the requirement to enter the root password to reboot/halt). Not sure how to implement that off the top of my head.

EDIT: here we go: http://forums.debian.net/viewtopic.php?p=413941
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
ncmprhnsbl
Full of knowledge
Full of knowledge
Posts: 783
Joined: 20 Mar 2012, 03:42
Distribution: 3.2.2-64bit xfce/openbox
Location: australia
Contact:

Re: How to set up openbox

Post#4 by ncmprhnsbl » 10 Jun 2013, 23:18

@saneks, i,ve had this a while but i thought i,d wait till the new build system arrived with straight lxde.. i'll edit the first post to add rc.xml examples..

@Ahau, i,ve made modules in the past, but they'd need updating anyway :) and my packaging techniques are are bit rough
a lot it is down to personal preference, but a base to start with is handy.
re: shutdown ...this could be used with other(fluxbox,icewm) too?

obmenu-generator might be worth a look, openbox-menu is currently broken in archbang(i still use it, but it doesnt dynamupdate)this might not be relevent to slackware..
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: How to set up openbox

Post#5 by Ahau » 11 Jun 2013, 05:30

I can help with creating the module, what I lack is the time to take on a third DE in a full design/admin/support role (you may have seen I've got my hands pretty busy with LXDE recently lol). Tomorrow morning I'll throw some packages and your config files into a layout and package it up with some instructions for how I do things for xfce and lxde, then you could add packages and other customizations, etc. If you could indicate where you got each of the packages (from slackware, slackbuilds, PPM repository or whatever), that would help out.

Eventually, we'd need to decide if this should continue to piggyback on lxde or if there are enough unique applications that openbox should get its own module...but that split can happen at any time, it's pretty easy to reshuffle.

The shutdown menu I'm envisioning ought to work in any DE that is running inside a dbus session with consolekit support, so it should be extensible to fluxbox and icewm.

I only ran a quick test with openbox-menu and it updated to show a change after I deactivated a module...I've nearly got it implemented, perhaps I ought to post an lxde 2.1 rc1.5 module so folks can get some more testing before rc2 :)
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
ncmprhnsbl
Full of knowledge
Full of knowledge
Posts: 783
Joined: 20 Mar 2012, 03:42
Distribution: 3.2.2-64bit xfce/openbox
Location: australia
Contact:

Re: How to set up openbox

Post#6 by ncmprhnsbl » 11 Jun 2013, 14:14

edited first post: added some links to source.
i,m thinking it might be just as easy to do all this within lxsession....
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: How to set up openbox

Post#7 by Ahau » 11 Jun 2013, 14:56

Thanks :)

Yeah, lxde-session might do the trick. Here's a concept-level script to handle logout/shutdown:

Code: Select all

#!/bin/bash

# this script opens a box with some options to log out, suspend or halt
# the running system.  I wrote it for desktops that don't have this service
# already


. /usr/lib/librokenman

exec 2>/dev/null
  
## Variables
export GLO="/tmp/glo_$$"
export PIXMAPS=/usr/share/pixmaps/porteus
 
mkdir -p $GLO
  
## export functions to perform logout actions:

gtklogout_halt()
{
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
}; export -f gtklogout_halt

gtklogout_reboot()
{
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
}; export -f gtklogout_reboot

gtklogout_suspend()
{
dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend
}; export -f gtklogout_suspend

gtklogout_logout()
{
openbox --exit &
}; export -f gtklogout_logout
  
export GTKLOGOUT='
<window window_position="1" decorated="false" skip_taskbar_hint="true" window_position="1" allow-shrink="true" width-request="225" height-request="285">
  <vbox margin="30">
    <hbox>
      <pixmap><height>32</height><width>32</width><input file icon="lock"></input></pixmap>
      '`txtcolor 100 darkred x-large normal "  Log out"`'
    </hbox>
      '`hsep`'
    
    <hbox>
   	  <button tooltip-text="Shut Down your system" width-request="120">
  	  <variable>HALT</variable>
      <label>Shut Down</label>
	  <input file icon="xfsm-shutdown"></input>
      <action type="function">gtklogout_halt</action>
	  </button>
    </hbox>
    
    <hbox>
   	  <button tooltip-text="Restart your system" width-request="120">
  	  <variable>REBOOT</variable>
      <label>Reboot</label>
	  <input file icon="xfsm-reboot"></input>
      <action type="function">gtklogout_reboot</action>
	  </button>
    </hbox>
    
    <hbox>
   	  <button tooltip-text="Put your system into a low power state" width-request="120">
  	  <variable>SUSPEND</variable>
      <label>Suspend</label>
	  <input file icon="xfsm-suspend"></input>
      <action type="function">gtklogout_suspend</action>
	  </button>
    </hbox>
    
    <hbox>
   	  <button tooltip-text="Log out of openbox" width-request="120">
  	  <variable>LOGOUT</variable>
      <label>Log out</label>
	  <input file icon="xfsm-logout"></input>
      <action type="function">gtklogout_logout</action>
	  </button>
    </hbox>
    
    <hbox>
   	  <button tooltip-text="Cancel" width-request="120">
  	  <variable>CANCEL</variable>
      <label>Cancel</label>
	  <input file icon="gtk-cancel"></input>
      <action>exit:Cancel</action>
	  </button>
    </hbox>
    
  </vbox>
  <action signal="hide">exit:Cancel</action>
</window>
'
gtkdialog -p GTKLOGOUT > /tmp/.glo_dump

## Did user cancel ?
[ `egrep -o "Cancel|abort" /tmp/.glo_dump` ] && rm -rf $GLO && rm /tmp/.glo_* && exit

rm -rf $GLO && rm /tmp/.glo_*

exit
It needs a number of tweaks (kill itself after sending suspend signal so it's gone when you resume, never lose focus, etc) but seems doable. Save it as a text file, make it executable with "chmod +x" and run it. Should be able to call it from a keybinding, no problem.
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: How to set up openbox

Post#8 by Ahau » 11 Jun 2013, 15:46

tarball with some help for building an openbox module: http://porteus-xfce.googlecode.com/files/obox-info.tgz

Ran a little short on time this morning so I only have a few packages and config files present, I'm sure more will need to be added (I didn't even specify a wallpaper), but the layout should be apparent from how this is structured. let me know if you have any questions :)

I did notice that network-manager-applet didn't give a popup window to enter the password for a secured wifi. brokenman had similar problems with razor; first things we'll need to check are that dbus and consolekit are running properly and that gnome-keyring daemon is started (my guess is that's the problem).
Please take a look at our online documentation, here. Suggestions are welcome!

saneks
White ninja
White ninja
Posts: 23
Joined: 13 Dec 2012, 23:35
Distribution: Porteus 2.0 XFCE, 2.1 Lxde
Location: Germany

Re: How to set up openbox

Post#9 by saneks » 11 Jun 2013, 22:05

Since I am on crunchbang linux right now, I let you know how the OB main menu config file looks like in #!

it works great. notice it calls some scripts to pipemenues to show places in /home, recent files and links the most imprtant config files, calls programs to perform actions etc... props again to corenominal, who composed the awesome crunchbang distrisbution.. there's a lot to learn in it.

ofcourse without the cb-scripts and applications some parts do nothing when copying it into porteus. I post it here for you to learn what goodness is possible with OB.

so this is my slightly modified OB menu, situated in home/.config/openbox/menu.xml

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<openbox_menu xmlns="http://openbox.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://openbox.org/                 file:///usr/share/openbox/menu.xsd">
	<menu id="root-menu" label="Openbox 3">
		<item label="Run Program">
			<action name="Execute">
				<command>
					gmrun
				</command>
			</action>
		</item>
		<separator/>
		<item label="Terminal">
			<action name="Execute">
				<command>
					terminator
				</command>
			</action>
		</item>
		<item label="Web Browser">
			<action name="Execute">
				<command>
					x-www-browser
				</command>
			</action>
		</item>
		<item label="File Manager">
			<action name="Execute">
				<command>
					thunar
				</command>
			</action>
		</item>
		<item label="Text Editor">
			<action name="Execute">
				<command>
					geany
				</command>
			</action>
		</item>
		<item label="Media Player">
			<action name="Execute">
				<command>
					vlc
				</command>
			</action>
		</item>
		<separator/>
		<menu id="accessories" label="Accessories">
			<item label="Catfish File Search">
				<action name="Execute">
					<command>
						catfish
					</command>
				</action>
			</item>
			<item label="Archive Manager">
				<action name="Execute">
					<command>
						file-roller
					</command>
				</action>
			</item>
			<item label="Geany Text Editor">
				<action name="Execute">
					<command>
						geany
					</command>
				</action>
			</item>
			<item label="Task Manager (htop)">
				<action name="Execute">
					<command>terminator --command="htop"</command>
				</action>
			</item>
			<item label="Terminator Terminal">
				<action name="Execute">
					<command>
						terminator
					</command>
				</action>
			</item>
			<item label="Thunar File Manager">
				<action name="Execute">
					<command>
						thunar
					</command>
				</action>
			</item>
			<item label="Thunar File Manager (root)">
				<action name="Execute">
					<command>
						gksudo thunar
					</command>
				</action>
			</item>
		</menu>
		<menu id="graphics" label="Graphics">
			<item label="GIMP">
				<action name="Execute">
					<command>
						gimp
					</command>
				</action>
			</item>
			<item label="Pinta">
				<action name="Execute">
					<command>pinta</command>
				</action>
			</item>
			<item label="Scanner">
				<action name="Execute">
					<command>simple-scan</command>
				</action>
			</item>
			<item label="Viewnior Image Viewer">
				<action name="Execute">
					<command>
						viewnior
					</command>
				</action>
			</item>
			<menu id="graphicsScreenshots" label="Take Screenshot">
				<item label="Screenshooter">
					<action name="Execute">
						<command>
							xfce4-screenshooter
						</command>
					</action>
				</item>
				<separator label="scrot"/>
				<item label="Now">
					<action name="Execute">
						<command>
							scrot '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/images/ & viewnior ~/images/$f'
						</command>
					</action>
				</item>
				<item label="In 5 Seconds...">
					<action name="Execute">
						<command>
							scrot -d 5 '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/images/ & viewnior ~/images/$f'
						</command>
					</action>
				</item>
				<item label="In 10 Seconds...">
					<action name="Execute">
						<command>
							scrot -d 10 '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/images/ & viewnior ~/images/$f'
						</command>
					</action>
				</item>
				<item label="Selected Area... (click & drag mouse)">
					<action name="Execute">
						<command>
							scrot -s '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/images/ & viewnior ~/images/$f'
						</command>
					</action>
				</item>
			</menu>
		</menu>
		<menu id="multimedia" label="Multimedia">
			<item label="VLC Player">
				<action name="Execute">
					<command>vlc</command>
				</action>
			</item>
			<item label="Volume Control">
				<action name="Execute">
					<command>
						pavucontrol
					</command>
				</action>
			</item>
			<item label="Xfburn">
				<action name="Execute">
					<command>
						xfburn
					</command>
				</action>
			</item>
		</menu>
		<menu id="network" label="Network">
			<menu execute="cb-x-www-browser-pipemenu" id="wwwbrowsers" label="WWW Browsers"/>
			<item label="gFTP Client">
				<action name="Execute">
					<command>
						gftp
					</command>
				</action>
			</item>
			<item label="Transmission BitTorrent Client">
				<action name="Execute">
					<command>
						transmission-gtk
					</command>
				</action>
			</item>
			<item label="XChat IRC Client">
				<action name="Execute">
					<command>
						xchat
					</command>
				</action>
			</item>
			<item label="Remote Filesystems">
				<action name="Execute">
					<command>
						gigolo
					</command>
				</action>
			</item>
			<menu execute="cb-remote-desktop-pipemenu" id="remotedesktop" label="Remote Desktop"/>
			<menu execute="cb-sshconfig-pipemenu" id="sshconfig" label="SSH"/>
			<separator label="Services"/>
			<menu execute="cb-dropbox-pipemenu" id="dropbox" label="Dropbox"/>
		</menu>
		<menu id="office" label="Office">
			<menu execute="cb-libreoffice-pipemenu" id="libreoffice" label="LibreOffice"/>
			<item label="Google Docs">
				<action name="Execute">
					<command>
						x-www-browser https://drive.google.com/
					</command>
				</action>
			</item>
			<item label="AbiWord Word Processor">
				<action name="Execute">
					<command>
						abiword
					</command>
				</action>
			</item>
			<item label="Gnumeric Spreadsheet">
				<action name="Execute">
					<command>
						gnumeric
					</command>
				</action>
			</item>
			<item label="Calculator">
				<action name="Execute">
					<command>
						galculator
					</command>
				</action>
			</item>
			<item label="Evince PDF Viewer">
				<action name="Execute">
					<command>
						evince
					</command>
				</action>
			</item>
		</menu>
		<separator/>
		<menu execute="cb-places-pipemenu" id="pipe-placesmenu" label="Places"/>
		<menu execute="cb-recent-files-pipemenu" id="pipe-recentfilesmenu" label="Recent Files"/>
		<separator/>
		<menu id="settings" label="Settings">
			<menu execute="cb-compositor" id="CompositingPipeMenu" label="Compositor"/>
			<menu id="conkyconfig" label="Conky">
				<item label="Edit .conkyrc">
					<action name="Execute">
						<command>
							geany ~/.conkyrc
						</command>
					</action>
				</item>
				<item label="Restart Conky">
					<action name="Execute">
						<command>
							conkywonky
						</command>
					</action>
				</item>
				<separator label="Help?"/>
				<item label="man page">
					<action name="Execute">
						<command>
							terminator --command="man conky"
						</command>
					</action>
				</item>
				<item label="Wiki Page">
					<action name="Execute">
						<command>
							x-www-browser http://crunchbanglinux.org/wiki/conky
						</command>
					</action>
				</item>
			</menu>
			<menu id="dmenuconfig" label="dmenu">
				<item label="Edit start-up script">
					<action name="Execute">
						<command>
							geany ~/.config/dmenu/dmenu-bind.sh
						</command>
					</action>
				</item>
				<separator label="Help?"/>
				<item label="man page">
					<action name="Execute">
						<command>
							terminator --command="man dmenu"
						</command>
					</action>
				</item>
			</menu>
			<menu id="gmrunconfig" label="gmrun">
				<item label="Edit config file">
					<action name="Execute">
						<command>
							geany ~/.gmrunrc
						</command>
					</action>
				</item>
				<separator label="Help?"/>
				<item label="man page">
					<action name="Execute">
						<command>
							terminator --command="man gmrun"
						</command>
					</action>
				</item>
			</menu>
			<menu id="obConfig" label="Openbox">
				<item label="Edit menu.xml">
					<action name="Execute">
						<command>
							geany ~/.config/openbox/menu.xml
						</command>
					</action>
				</item>
				<item label="Edit rc.xml">
					<action name="Execute">
						<command>
							geany ~/.config/openbox/rc.xml
						</command>
					</action>
				</item>
				<item label="Edit autostart">
					<action name="Execute">
						<command>
							geany ~/.config/openbox/autostart
						</command>
					</action>
				</item>
				<separator/>
				<item label="GUI Menu Editor">
					<action name="Execute">
						<command>
							obmenu
						</command>
					</action>
				</item>
				<item label="GUI Applications Settings Editor">
					<action name="Execute">
						<command>
							obapps
						</command>
					</action>
				</item>
				<item label="GUI Config Tool">
					<action name="Execute">
						<command>
							obconf
						</command>
					</action>
				</item>
				<separator/>
				<item label="Reconfigure">
					<action name="Reconfigure"/>
				</item>
				<item label="Restart">
					<action name="Restart"/>
				</item>
			</menu>
			<menu id="terminatorconfig" label="Terminator">
				<item label="Edit config file">
					<action name="Execute">
						<command>
							geany ~/.config/terminator/config
						</command>
					</action>
				</item>
				<separator label="Help?"/>
				<item label="man page">
					<action name="Execute">
						<command>
							terminator --command="man terminator_config"
						</command>
					</action>
				</item>
			</menu>
			<menu id="tint2config" label="tint2">
				<item label="Edit config file">
					<action name="Execute">
						<command>
							geany ~/.config/tint2/tint2rc
						</command>
					</action>
				</item>
				<item label="Restart tint2">
					<action name="Execute">
						<command>
							tint2restart
						</command>
					</action>
				</item>
				<separator label="Help?"/>
				<item label="man page">
					<action name="Execute">
						<command>
							terminator --command="man tint2"
						</command>
					</action>
				</item>
				<item label="Online Help">
					<action name="Execute">
						<command>
							x-www-browser http://code.google.com/p/tint2/wiki/Welcome
						</command>
					</action>
				</item>
			</menu>
			<menu id="DisplaySettings" label="Display Settings">
				<item label="ARandR Screen Layout Editor">
					<action name="Execute">
						<command>
						    arandr
					    </command>
					</action>
				</item>
				<separator label="Help?"/>
				<item label="man xrandr">
					<action name="Execute">
						<command>
						    terminator --command="man xrandr"
					    </command>
					</action>
				</item>
			</menu>
			<item label="Edit Default Applications">
				<action name="Execute">
					<command>
						terminator --command="sudo update-alternatives --all"
					</command>
				</action>
			</item>
			<item label="User Interface Settings">
				<action name="Execute">
					<command>
						lxappearance
					</command>
				</action>
			</item>
			<item label="Power Management">
				<action name="Execute">
					<command>
						xfce4-power-manager-settings
					</command>
				</action>
			</item>
			<item label="Screensaver">
				<action name="Execute">
					<command>
						xscreensaver-demo
					</command>
				</action>
			</item>
			<item label="Choose Wallpaper">
				<action name="Execute">
					<command>
						nitrogen ~/images/wallpapers/
					</command>
				</action>
			</item>
		</menu>
		<menu id="system" label="System">
			<menu execute="cb-printing-pipemenu" id="PrintingPipeMenu" label="Printers"/>
			<item label="GParted">
				<action name="Execute">
					<command>
						gksudo gparted
					</command>
				</action>
			</item>
			<item label="Synaptic Package Manager">
				<action name="Execute">
					<command>
						gksudo synaptic
					</command>
				</action>
			</item>
			<item label="User Login Settings">
				<action name="Execute">
					<command>
						gksudo slimconf
					</command>
				</action>
			</item>
		</menu>
		<!--<menu id="help" label="Help" execute="cb-help-pipemenu" />-->
		<separator/>
		<item label="Lock Screen">
			<action name="Execute">
				<command>
					cb-lock
				</command>
			</action>
		</item>
		<item label="Exit">
			<action name="Execute">
				<command>
					cb-exit
				</command>
			</action>
		</item>
	</menu>
</openbox_menu>

User avatar
ncmprhnsbl
Full of knowledge
Full of knowledge
Posts: 783
Joined: 20 Mar 2012, 03:42
Distribution: 3.2.2-64bit xfce/openbox
Location: australia
Contact:

Re: How to set up openbox

Post#10 by ncmprhnsbl » 13 Jun 2013, 05:47

@Ahau, thanks for the module building kit, anyone else who wants to have a go at making a module, feel free
tested logout script, works fine(no surprise) called it 'logoutscript' and put it in /opt/porteus-scripts,.. nice one .... but heres the thing, i'm tending toward lxsession like this...
/etc/xdg/lxsession/autostart

Code: Select all

!@pcmanfm --desktop --profile LXDE
!@lxpanel-porteus
@imlibsetroot -s ~/.wallpaper/porteuswalppr-2.png
!@spacefm --desktop
!@sh ~/.fehbg 
@tint2
@conky -q
@volumeicon -b
@compton --config ~/compton.conf
! are comments, as you can see, i've turned off lxpanel and pcmanfm desktop management(spacefm is similar).
the correct procedure is to make a ~/.config/lxsession/LXDE/autostart , and put your stuff there. and rename your ~/.config/openbox/rc.xml to lxde-rc.xml
this simplifies a number of things, including shutdown etc..
I was having trouble editing openbox-menu into your menu, so i hacked the default from /etc/xdg/openbox
i have that openbox-menu updates in lxde but not openbox? ...havnt tested your package yet tho.....

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<openbox_menu xmlns="http://openbox.org/3.4/menu">
<menu id="desktop-app-menu"
      label="Applications"
      execute="openbox-menu /etc/xdg/menus/lxde-applications.menu" />
<menu id="apps-accessories-menu" label="Utility">
  <item label="Lxtask">
    <action name="Execute">
      <command>lxtask</command>
      <startupnotify><enabled>yes</enabled></startupnotify>
    </action>
  </item>
  <item label="Calculator">
    <action name="Execute">
      <command>galculator</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
  <item label="Evince">
    <action name="Execute">
      <command>evince</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
  <item label="File-Roller">
    <action name="Execute">
      <command>file-roller</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
</menu>
<menu id="apps-editors-menu" label="Editors">
  <item label="Leafpad-W+e">
    <action name="Execute">
      <command>leafpad</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
  <item label="Geany">
    <action name="Execute">
      <command>geany</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
</menu>

<menu id="apps-term-menu" label="Shells">
  <item label="LxTerminal-W+t">
    <action name="Execute">
      <command>lxterminal</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
  <item label="Xterm">
    <action name="Execute"><command>xterm</command></action>
  </item>
  <item label="PCManFM">
    <action name="Execute">
      <command>pcmanfm</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
  <item label="SpaceFM-W+f">
    <action name="Execute">
      <command>spacefm</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
</menu>

<menu id="apps-net-menu" label="Internet">
  <item label="Firefox-W+w">
    <action name="Execute">
      <command>firefox</command>
      <startupnotify>
        <enabled>yes</enabled>
        <wmclass>Firefox</wmclass>
      </startupnotify>
    </action>
  </item>
  <item label="Uget">
    <action name="Execute">
      <command>uget</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
</menu>

<menu id="apps-multimedia-menu" label="Multimedia">
  <item label="Audacious-W+m">
    <action name="Execute">
      <command>audacious</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
  <item label="Gnome-MPlayer">
    <action name="Execute">
      <command>gnome-mplayer</command>
      <startupnotify>
        <enabled>yes</enabled>
        <wmclass>MPlayer</wmclass>
      </startupnotify>
    </action>
  </item>
  <item label="Mixer">
    <action name="Execute">
      <command>lxterminal -e alsamixer</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
</menu>

<menu id="apps-graphics-menu" label="Graphics">
  <item label="Gimp">
    <action name="Execute">
      <command>gimp</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
  <item label="Gpicview">
    <action name="Execute">
      <command>gpicview</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
  <item label="Mtpaint">
    <action name="Execute">
      <command>mtpaint</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
</menu>

<menu id="system-menu" label="Desktop">
  <separator />
  <item label="Reconfigure Openbox">
    <action name="Reconfigure" />
  </item>
  <item label="Lxappearance">
    <action name="Execute">
      <command>lxappearance</command>
      <startupnotify><enabled>yes</enabled></startupnotify>
    </action>
  </item>
  <item label="Configure Openbox ">
    <action name="Execute">
      <command>obconf</command>
      <startupnotify><enabled>yes</enabled></startupnotify>
    </action>
  </item>
  <item label="Edit Keybinds etc">
    <action name="Execute">
      <command>leafpad ~/.config/openbox/lxde-rc.xml</command>
      <startupnotify><enabled>yes</enabled></startupnotify>
    </action>
  </item>
  <separator />
  <item label="ConkySwitcher">
    <action name="Execute">
      <command>/home/guest/conkyswitcher</command>
    </action>
  </item>
  <item label="Edit ~/.conkyrc">
    <action name="Execute">
      <command>leafpad ~/.conkyrc</command>
      <startupnotify><enabled>yes</enabled></startupnotify>
    </action>
  </item>
  <separator />
    <item label="Screenshot in 3secs">
    <action name="Execute">
      <command>scrot -d 3 '%Y-%m-%d--%s_$wx$h_scrot.png'</command>
    </action>
  </item>
    <item label="Screenshot Select">
    <action name="Execute">
      <command>scrot -s '%Y-%m-%d--%s_$wx$h_scrot.png'</command>
    </action>
  </item>
    <item label="Shoot and Edit">
    <action name="Execute">
      <command>mtpaint -s</command>
    </action>
  </item>
  <separator />
  <item label="W+f....spacefm">
  </item>
  <item label="W+w...firefox">
  </item>
  <item label="W+e...leafpad">
  </item>
  <item label="W+t..lxterminal">
  </item>
  <item label="W+a..toggle maximize">
  </item>
  <item label="and so on...">
  </item>
</menu>

<menu id="root-menu" label="Openbox 3">
  <separator label="Porteus2.1"/>
  <menu id="desktop-app-menu" />
  <separator />
  <menu id="apps-term-menu"/>
  <menu id="apps-accessories-menu"/>
  <menu id="apps-editors-menu"/>
  <menu id="apps-graphics-menu"/>
  <menu id="apps-net-menu"/>
  <menu id="apps-office-menu"/>
  <menu id="apps-multimedia-menu"/>
  <menu id="system-menu"/>
  <separator />
  <item label="Run">
    <action name="Execute">
      <execute>dmenu_run</execute>
    </action>
  </item>
  <separator />
  <item label="Leave Openbox">
    <action name="Execute">
      <execute>/opt/porteus-scripts/logoutscript</execute>
    </action>
  </item>
  <item label="Leave Lxde">
    <action name="Execute">
      <execute>lxde-logout</execute>
    </action>
  </item>
</menu>

</openbox_menu>
One problem i notice is the possibility of logging out of openbox while in lxde, which could be a little disconcerting.
i put both logouts in because i switching between DEs...trying figure what the difference is...
thanks saneks, #! is the source of !s
heres my rc.xml(or lxde-rc.xml) in porteus

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not edit this file, it will be overwritten on install.
        Copy the file to $HOME/.config/openbox/ instead. -->
<openbox_config xmlns="http://openbox.org/3.4/rc" xmlns:xi="http://www.w3.org/2001/XInclude">
  <resistance>
    <strength>10</strength>
    <screen_edge_strength>20</screen_edge_strength>
  </resistance>
  <focus>
    <focusNew>yes</focusNew>
    <!-- always try to focus new windows when they appear. other rules do
       apply -->
    <followMouse>no</followMouse>
    <!-- move focus to a window when you move the mouse into it -->
    <focusLast>yes</focusLast>
    <!-- focus the last used window when changing desktops, instead of the one
       under the mouse pointer. when followMouse is enabled -->
    <underMouse>no</underMouse>
    <!-- move focus under the mouse, even when the mouse is not moving -->
    <focusDelay>200</focusDelay>
    <!-- when followMouse is enabled, the mouse must be inside the window for
       this many milliseconds (1000 = 1 sec) before moving focus to it -->
    <raiseOnFocus>no</raiseOnFocus>
    <!-- when followMouse is enabled, and a window is given focus by moving the
       mouse into it, also raise the window -->
  </focus>
  <placement>
    <policy>UnderMouse</policy>
    <!-- 'Smart' or 'UnderMouse' -->
    <center>yes</center>
    <!-- whether to place windows in the center of the free area found or
       the top left corner -->
    <monitor>Any</monitor>
    <!-- with Smart placement on a multi-monitor system, try to place new windows
       on: 'Any' - any monitor, 'Mouse' - where the mouse is, 'Active' - where
       the active window is, 'Primary' - only on the primary monitor -->
    <primaryMonitor>1</primaryMonitor>
    <!-- The monitor where Openbox should place popup dialogs such as the
       focus cycling popup, or the desktop switch popup.  It can be an index
       from 1, specifying a particular monitor.  Or it can be one of the
       following: 'Mouse' - where the mouse is, or
                  'Active' - where the active window is -->
  </placement>
  <theme>
    <name>Onyx</name>
    <titleLayout>LSC</titleLayout>
    <!--
      available characters are NDSLIMC, each can occur at most once.
      N: window icon
      L: window label (AKA title).
      I: iconify
      M: maximize
      C: close
      S: shade (roll up/down)
      D: omnipresent (on all desktops).
  -->
    <keepBorder>yes</keepBorder>
    <animateIconify>yes</animateIconify>
    <font place="ActiveWindow">
      <name>Sans</name>
      <size>9</size>
      <!-- font size in points -->
      <weight>Bold</weight>
      <!-- 'bold' or 'normal' -->
      <slant>Normal</slant>
      <!-- 'italic' or 'normal' -->
    </font>
    <font place="InactiveWindow">
      <name>Sans</name>
      <size>8</size>
      <!-- font size in points -->
      <weight>Normal</weight>
      <!-- 'bold' or 'normal' -->
      <slant>Normal</slant>
      <!-- 'italic' or 'normal' -->
    </font>
    <font place="MenuHeader">
      <name>sans</name>
      <size>9</size>
      <!-- font size in points -->
      <weight>normal</weight>
      <!-- 'bold' or 'normal' -->
      <slant>normal</slant>
      <!-- 'italic' or 'normal' -->
    </font>
    <font place="MenuItem">
      <name>sans</name>
      <size>9</size>
      <!-- font size in points -->
      <weight>normal</weight>
      <!-- 'bold' or 'normal' -->
      <slant>normal</slant>
      <!-- 'italic' or 'normal' -->
    </font>
    <font place="ActiveOnScreenDisplay">
      <name>sans</name>
      <size>9</size>
      <!-- font size in points -->
      <weight>bold</weight>
      <!-- 'bold' or 'normal' -->
      <slant>normal</slant>
      <!-- 'italic' or 'normal' -->
    </font>
    <font place="InactiveOnScreenDisplay">
      <name>sans</name>
      <size>9</size>
      <!-- font size in points -->
      <weight>bold</weight>
      <!-- 'bold' or 'normal' -->
      <slant>normal</slant>
      <!-- 'italic' or 'normal' -->
    </font>
  </theme>
  <desktops>
    <!-- this stuff is only used at startup, pagers allow you to change them
       during a session

       these are default values to use when other ones are not already set
       by other applications, or saved in your session

       use obconf if you want to change these without having to log out
       and back in -->
    <number>4</number>
    <firstdesk>1</firstdesk>
    <names>
      <!-- set names up here if you want to, like this:
    <name>desktop 1</name>
    <name>desktop 2</name>
    -->
    </names>
    <popupTime>875</popupTime>
    <!-- The number of milliseconds to show the popup for when switching
       desktops.  Set this to 0 to disable the popup. -->
  </desktops>
  <resize>
    <drawContents>yes</drawContents>
    <popupShow>Nonpixel</popupShow>
    <!-- 'Always', 'Never', or 'Nonpixel' (xterms and such) -->
    <popupPosition>Center</popupPosition>
    <!-- 'Center', 'Top', or 'Fixed' -->
    <popupFixedPosition>
      <!-- these are used if popupPosition is set to 'Fixed' -->
      <x>10</x>
      <!-- positive number for distance from left edge, negative number for
         distance from right edge, or 'Center' -->
      <y>10</y>
      <!-- positive number for distance from top edge, negative number for
         distance from bottom edge, or 'Center' -->
    </popupFixedPosition>
  </resize>
  <!-- You can reserve a portion of your screen where windows will not cover when
     they are maximized, or when they are initially placed.
     Many programs reserve space automatically, but you can use this in other
     cases. -->
  <margins>
    <top>0</top>
    <bottom>0</bottom>
    <left>0</left>
    <right>33</right>
  </margins>
  <dock>
    <position>TopLeft</position>
    <!-- (Top|Bottom)(Left|Right|)|Top|Bottom|Left|Right|Floating -->
    <floatingX>0</floatingX>
    <floatingY>0</floatingY>
    <noStrut>no</noStrut>
    <stacking>Above</stacking>
    <!-- 'Above', 'Normal', or 'Below' -->
    <direction>Vertical</direction>
    <!-- 'Vertical' or 'Horizontal' -->
    <autoHide>no</autoHide>
    <hideDelay>300</hideDelay>
    <!-- in milliseconds (1000 = 1 second) -->
    <showDelay>300</showDelay>
    <!-- in milliseconds (1000 = 1 second) -->
    <moveButton>Middle</moveButton>
    <!-- 'Left', 'Middle', 'Right' -->
  </dock>
  <keyboard>
    <chainQuitKey>C-g</chainQuitKey>
    <!-- Keybindings for desktop switching -->
    <keybind key="C-A-Left">
      <action name="GoToDesktop">
        <to>left</to>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="C-A-Right">
      <action name="GoToDesktop">
        <to>right</to>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="C-A-Up">
      <action name="GoToDesktop">
        <to>up</to>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="C-A-Down">
      <action name="GoToDesktop">
        <to>down</to>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="S-A-Left">
      <action name="SendToDesktop">
        <to>left</to>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="S-A-Right">
      <action name="SendToDesktop">
        <to>right</to>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="S-A-Up">
      <action name="SendToDesktop">
        <to>up</to>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="S-A-Down">
      <action name="SendToDesktop">
        <to>down</to>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="W-F1">
      <action name="GoToDesktop">
        <to>1</to>
      </action>
    </keybind>
    <keybind key="W-F2">
      <action name="GoToDesktop">
        <to>2</to>
      </action>
    </keybind>
    <keybind key="W-F3">
      <action name="GoToDesktop">
        <to>3</to>
      </action>
    </keybind>
    <keybind key="W-F4">
      <action name="GoToDesktop">
        <to>4</to>
      </action>
    </keybind>
    <keybind key="A-d">
      <action name="ToggleShowDesktop"/>
    </keybind>
    <!-- Keybindings for windows -->
    <keybind key="A-F4">
      <action name="Close"/>
    </keybind>
    <keybind key="W-a">
      <action name="ToggleMaximize"/>
    </keybind>
    <keybind key="A-t">
      <action name="ToggleAlwaysOnTop"/>
    </keybind>
    <keybind key="A-u">
      <action name="ToggleDecorations"/>
    </keybind>
    <keybind key="A-Escape">
      <action name="Lower"/>
      <action name="FocusToBottom"/>
      <action name="Unfocus"/>
    </keybind>
    <keybind key="A-space">
      <action name="ShowMenu">
        <menu>client-menu</menu>
      </action>
    </keybind>
    <!-- Keybindings for window switching -->
    <keybind key="A-Tab">
      <action name="NextWindow">
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>
    <keybind key="A-S-Tab">
      <action name="PreviousWindow">
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>
    <keybind key="C-A-Tab">
      <action name="NextWindow">
        <panels>yes</panels>
        <desktop>yes</desktop>
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>
    <!-- Keybindings for window switching with the arrow keys -->
    <keybind key="W-S-Right">
      <action name="DirectionalCycleWindows">
        <direction>right</direction>
      </action>
    </keybind>
    <keybind key="W-S-Left">
      <action name="DirectionalCycleWindows">
        <direction>left</direction>
      </action>
    </keybind>
    <keybind key="W-S-Up">
      <action name="DirectionalCycleWindows">
        <direction>up</direction>
      </action>
    </keybind>
    <keybind key="W-S-Down">
      <action name="DirectionalCycleWindows">
        <direction>down</direction>
      </action>
    </keybind>
    <!-- Keybindings for running applications -->
    <keybind key="W-f">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>SpaceFM</name>
        </startupnotify>
        <command>spacefm</command>
      </action>
    </keybind>
    <keybind key="W-w">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Firefox</name>
        </startupnotify>
        <command>firefox</command>
      </action>
    </keybind>
    <keybind key="W-d">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>dmenu</name>
        </startupnotify>
        <command>dmenu_run</command>
      </action>
    </keybind>
    <keybind key="W-t">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Lxterminal</name>
        </startupnotify>
        <command>lxterminal</command>
      </action>
    </keybind>
    <keybind key="W-e">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Leafpad</name>
        </startupnotify>
        <command>leafpad</command>
      </action>
    </keybind>
    <keybind key="W-p">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Mypaint</name>
        </startupnotify>
        <command>mypaint</command>
      </action>
    </keybind>
    <keybind key="W-x">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>conkyswitcher</name>
        </startupnotify>
        <command>/home/guest/conkyswitcher</command>
      </action>
    </keybind>
    <keybind key="W-m">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>audacious</name>
        </startupnotify>
        <command>audacious</command>
      </action>
    </keybind>
    <keybind key="Print">
      <action name="Execute">
        <command>scrot '%Y-%m-%d--%s_$wx$h_scrot.png' -e</command>
      </action>
    </keybind>
    <keybind key="W-Print">
      <action name="Execute">
        <command>scrot -s '%Y-%m-%d--%s_$wx$h_scrot.png' -e</command>
      </action>
    </keybind>
    <keybind key="A-x">
      <action name="Execute">
        <command>compton-trans -s -o 70</command>
      </action>
    </keybind>
    <keybind key="A-c">
      <action name="Execute">
        <command>compton-trans -s -o 100</command>
      </action>
    </keybind>
  </keyboard>
  <mouse>
    <dragThreshold>1</dragThreshold>
    <!-- number of pixels the mouse must move before a drag begins -->
    <doubleClickTime>200</doubleClickTime>
    <!-- in milliseconds (1000 = 1 second) -->
    <screenEdgeWarpTime>400</screenEdgeWarpTime>
    <!-- Time before changing desktops when the pointer touches the edge of the
       screen while moving a window, in milliseconds (1000 = 1 second).
       Set this to 0 to disable warping -->
    <screenEdgeWarpMouse>false</screenEdgeWarpMouse>
    <!-- Set this to TRUE to move the mouse pointer across the desktop when
       switching due to hitting the edge of the screen -->
    <context name="Frame">
      <mousebind button="A-Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="A-Left" action="Click">
        <action name="Unshade"/>
      </mousebind>
      <mousebind button="A-Left" action="Drag">
        <action name="Move"/>
      </mousebind>
      <mousebind button="A-Right" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind button="A-Right" action="Drag">
        <action name="Resize"/>
      </mousebind>
      <mousebind button="A-Middle" action="Press">
        <action name="Lower"/>
        <action name="FocusToBottom"/>
        <action name="Unfocus"/>
      </mousebind>
      <mousebind button="A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="C-A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="C-A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="A-S-Up" action="Click">
        <action name="SendToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="A-S-Down" action="Click">
        <action name="SendToDesktop">
          <to>next</to>
        </action>
      </mousebind>
    </context>
    <context name="Titlebar">
      <mousebind button="Left" action="Drag">
        <action name="Move"/>
      </mousebind>
      <mousebind button="Left" action="DoubleClick">
        <action xmlns="http://openbox.org/3.4/rc" name="ToggleMaximize"/>
      </mousebind>
      <mousebind button="Up" action="Click">
        <action name="if">
          <shaded>no</shaded>
          <then>
            <action name="Shade"/>
            <action name="FocusToBottom"/>
            <action name="Unfocus"/>
            <action name="Lower"/>
          </then>
        </action>
      </mousebind>
      <mousebind button="Down" action="Click">
        <action name="if">
          <shaded>yes</shaded>
          <then>
            <action name="Unshade"/>
            <action name="Raise"/>
          </then>
        </action>
      </mousebind>
    </context>
    <context name="Titlebar Top Right Bottom Left TLCorner TRCorner BRCorner BLCorner">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind button="Middle" action="Press">
        <action name="Lower"/>
        <action name="FocusToBottom"/>
        <action name="Unfocus"/>
      </mousebind>
      <mousebind button="Right" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="ShowMenu">
          <menu>client-menu</menu>
        </action>
      </mousebind>
    </context>
    <context name="Top">
      <mousebind button="Left" action="Drag">
        <action name="Resize">
          <edge>top</edge>
        </action>
      </mousebind>
    </context>
    <context name="Left">
      <mousebind button="Left" action="Drag">
        <action name="Resize">
          <edge>left</edge>
        </action>
      </mousebind>
    </context>
    <context name="Right">
      <mousebind button="Left" action="Drag">
        <action name="Resize">
          <edge>right</edge>
        </action>
      </mousebind>
    </context>
    <context name="Bottom">
      <mousebind button="Left" action="Drag">
        <action name="Resize">
          <edge>bottom</edge>
        </action>
      </mousebind>
      <mousebind button="Right" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="ShowMenu">
          <menu>client-menu</menu>
        </action>
      </mousebind>
    </context>
    <context name="TRCorner BRCorner TLCorner BLCorner">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind button="Left" action="Drag">
        <action name="Resize"/>
      </mousebind>
    </context>
    <context name="Client">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="Middle" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="Right" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
    </context>
    <context name="Icon">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
        <action name="ShowMenu">
          <menu>client-menu</menu>
        </action>
      </mousebind>
      <mousebind button="Right" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="ShowMenu">
          <menu>client-menu</menu>
        </action>
      </mousebind>
    </context>
    <context name="AllDesktops">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind button="Left" action="Click">
        <action name="ToggleOmnipresent"/>
      </mousebind>
    </context>
    <context name="Shade">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="Left" action="Click">
        <action name="ToggleShade"/>
      </mousebind>
    </context>
    <context name="Iconify">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="Left" action="Click">
        <action name="Iconify"/>
      </mousebind>
    </context>
    <context name="Maximize">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind button="Middle" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind button="Right" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind button="Left" action="Click">
        <action name="ToggleMaximize"/>
      </mousebind>
      <mousebind button="Middle" action="Click">
        <action name="ToggleMaximize">
          <direction>vertical</direction>
        </action>
      </mousebind>
      <mousebind button="Right" action="Click">
        <action name="ToggleMaximize">
          <direction>horizontal</direction>
        </action>
      </mousebind>
    </context>
    <context name="Close">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind button="Left" action="Click">
        <action name="Close"/>
      </mousebind>
    </context>
    <context name="Desktop">
      <mousebind button="Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="C-A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="C-A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="Right" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
    </context>
    <context name="Root">
      <!-- Menus -->
      <mousebind button="Middle" action="Press">
        <action name="ShowMenu">
          <menu>client-list-combined-menu</menu>
        </action>
      </mousebind>
      <mousebind button="Right" action="Press">
        <action name="ShowMenu">
          <menu>root-menu</menu>
        </action>
      </mousebind>
    </context>
    <context name="MoveResize">
      <mousebind button="Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
    </context>
  </mouse>
  <menu><!-- You can specify more than one menu file in here and they are all loaded,
       just don't make menu ids clash or, well, it'll be kind of pointless --><!-- default menu file (or custom one in $HOME/.config/openbox/) --><file>menu.xml</file><hideDelay>200</hideDelay><!-- if a press-release lasts longer than this setting (in milliseconds), the
       menu is hidden again --><middle>no</middle><!-- center submenus vertically about the parent entry --><submenuShowDelay>100</submenuShowDelay><!-- time to delay before showing a submenu after hovering over the parent
       entry.
       if this is a negative value, then the delay is infinite and the
       submenu will not be shown until it is clicked on --><submenuHideDelay>400</submenuHideDelay><!-- time to delay before hiding a submenu when selecting another
       entry in parent menu -->
       if this is a negative value, then the delay is infinite and the
       submenu will not be hidden until a different submenu is opened -->
  <applicationIcons>yes</applicationIcons>
  <!-- controls if icons appear in the client-list-(combined-)menu -->
  <manageDesktops>yes</manageDesktops>
  <!-- show the manage desktops section in the client-list-(combined-)menu -->
</menu>
  <applications>
    <application class="*">
      <position>
        <monitor>1</monitor>
      </position>
      <focus>yes</focus>
      <maximized>no</maximized>
    </application>
    <application name="lxterminal">
      <decor>no</decor>
    </application>
    <application title="mypaint">
      <decor>no</decor>
      <maximized>yes</maximized>
    </application>
    <application class="Firefox">
      <decor>yes</decor>
      <maximized>yes</maximized>
    </application>
    <application name="galculator">
      <decor>no</decor>
    </application>
    <!--
  # this is an example with comments through out. use these to make your
  # own rules, but without the comments of course.
  # you may use one or more of the name/class/role/title/type rules to specify
  # windows to match

  <application name="the window's _OB_APP_NAME property (see obxprop)"
              class="the window's _OB_APP_CLASS property (see obxprop)"
               role="the window's _OB_APP_ROLE property (see obxprop)"
              title="the window's _OB_APP_TITLE property (see obxprop)"
               type="the window's _OB_APP_TYPE property (see obxprob)..
                      (if unspecified, then it is 'dialog' for child windows)">
  # you may set only one of name/class/role/title/type, or you may use more
  # than one together to restrict your matches.

  # the name, class, role, and title use simple wildcard matching such as those
  # used by a shell. you can use * to match any characters and ? to match
  # any single character.

  # the type is one of: normal, dialog, splash, utility, menu, toolbar, dock,
  #    or desktop

  # when multiple rules match a window, they will all be applied, in the
  # order that they appear in this list


    # each rule element can be left out or set to 'default' to specify to not 
    # change that attribute of the window

    <decor>yes</decor>
    # enable or disable window decorations

    <shade>no</shade>
    # make the window shaded when it appears, or not

    <position force="no">
      # the position is only used if both an x and y coordinate are provided
      # (and not set to 'default')
      # when force is "yes", then the window will be placed here even if it
      # says you want it placed elsewhere.  this is to override buggy
      # applications who refuse to behave
      <x>center</x>
      # a number like 50, or 'center' to center on screen. use a negative number
      # to start from the right (or bottom for <y>), ie -50 is 50 pixels from the
      # right edge (or bottom).
      <y>200</y>
      <monitor>1</monitor>
      # specifies the monitor in a xinerama setup.
      # 1 is the first head, or 'mouse' for wherever the mouse is
    </position>

    <focus>yes</focus>
    # if the window should try be given focus when it appears. if this is set
    # to yes it doesn't guarantee the window will be given focus. some
    # restrictions may apply, but Openbox will try to

    <desktop>1</desktop>
    # 1 is the first desktop, 'all' for all desktops

    <layer>normal</layer>
    # 'above', 'normal', or 'below'

    <iconic>no</iconic>
    # make the window iconified when it appears, or not

    <skip_pager>no</skip_pager>
    # asks to not be shown in pagers

    <skip_taskbar>no</skip_taskbar>
    # asks to not be shown in taskbars. window cycling actions will also
    # skip past such windows

    <fullscreen>yes</fullscreen>
    # make the window in fullscreen mode when it appears

    <maximized>true</maximized>
    # 'Horizontal', 'Vertical' or boolean (yes/no)
  </application>

  # end of the example
-->
  </applications>
</openbox_config>
First Post Edited..
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: How to set up openbox

Post#11 by Ahau » 13 Jun 2013, 15:46

Thanks, guys! Seeing the examples above helps me understand more about pipemenus -- they are really cool!

I'm trying to pull what makes sense into the main lxde xml files, and maybe you can help spot things I should add to it after I put out my next draft. I'm trying to keep it functional but clean. I dislike big menus with duplicative entries.

@saneks -- Do you know where I could download the pipemenus referenced in the .xml file you posted? Do these look correct? https://github.com/corenominal/cb-pipemenus

I don't plan on installing python as a part of lxde, so I won't be adding pipemenus written in python.

I did, however, figure out a neat little trick with openbox-menu. I wrote a script that parses the output by category and pipes it back out. I then edited menu.xml to have a separate entry for each category in the main menu, calling the script. As such, I now have a main menu that has entries for Accessories, Internet, System, Preferences, etc. inside the main body, without having to mouse over an 'Applications' menu and sticking them all inside there. The only drawback is that I'll have to have empty categories for any that may be added by users with other moduels (e.g. Games) and it takes additional processing, which means that on a slower machine it may take some time to open the menu. Hopefully there are some testers out there on slower machines that can comment on it :)

@ncmprhnsbl,

If you run everything inside an lxde session, you can probably just drop the openbox logout script and stick with the lxde one. Another option would be to write a wrapper script that "sniffed" the system to see if the user was running inside an lxde session, run lxde-logout if that was the case, else run my gtkdialog logout script (which could certainly be made prettier as well -- a photo at the top, resize/rearrange buttons, better icons, whatever)

What I've found in limited testing (so I'm not 100% sure on this yet) is that openbox-menu updates when you run 'update-desktop-database'. This is called by the 'activate' script when you are inside of lxde (or xfce, razor, kde) but it is not set up for openbox yet, and would need some tweaking to make sure that command gets run when a module is activated. Another option might be to call update-desktop-database inside the menu itself whenever the menu is run, but that seems like it might also slow things down a bit with redundant processing.
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
ncmprhnsbl
Full of knowledge
Full of knowledge
Posts: 783
Joined: 20 Mar 2012, 03:42
Distribution: 3.2.2-64bit xfce/openbox
Location: australia
Contact:

Re: How to set up openbox

Post#12 by ncmprhnsbl » 19 Jun 2013, 08:29

Heres rc1 openbox addon module, 64bit only so far (edit: Removed-out of date) 3.7mb
package list:
conky-1.9.0
dmenu-xft
feh-2.6.3
giblib-1.2.4
gsimplecal-1.6
imlib2-1.4.5
libid3tag-0.15.1b
lua-5.1.5
openbox-menu-0.3.6.8
parcellite-1.0.2rc5
scrot-0.8
spacefm-0.8.3
tint2-r652-x86
tolua++-1.0.93
volumeicon-0.5.0
xcompmgr-1.1.6

features: defaults to openbox-session, multiple conky and tint2 themes in menu, ( from alphaOS/archpup)
wallpaper switcher in menu(pipe), "places" pipemenu, logout /shutdown, run(dmenu)
screenshot....keybinds .(from archbang) (and originally crunchbang)
....composite effects(limited,mainly real transparency for tint and lxterm)
tested on a fresh download/install lxde 2.1(rc1) from the wizard, no savedchanges
issues: remove/edit temperature entries in 2 conky configs(unless you happen to have nvidia319 ;) )
ditto conky network entry
update-desktop-database' not working for guest
possible issues about placement, permissions, and content of some scripts(conkyrestart/theme, tint2restart/theme, logoutscript)
@ahau
i'd like to try that menu, sounds similar to what alphaos has done using pekwm and porting openbox-menu(in look anyhow)
i plan to make a lxsession version next..
a sniffing wrapper script? why not..
'update-desktop-database' works for me .. except it seems to want to run as root...maybe just a menu entry instead of automatic...
spent some time trying to get some lua stuff going with conky but had no luck...'nill value'...
...maybe this addon module should have its own thread in community or dev....
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
ncmprhnsbl
Full of knowledge
Full of knowledge
Posts: 783
Joined: 20 Mar 2012, 03:42
Distribution: 3.2.2-64bit xfce/openbox
Location: australia
Contact:

Re: How to set up openbox

Post#13 by ncmprhnsbl » 11 Jul 2013, 12:56

version 2 addon modules coming soon..
heres a script for sniffing sessions and using correct logout

Code: Select all

#!/bin/sh
# session sneefer and logger-outer for lxde or openbox-session
# to create a dual desktop menu entry ie 
# <item label="Exit"><action name="Execute"><execute>~/path/to/sneef.sh</execute></action></item>

# sniff LXDE logout:
lxuser=`ps -C lxsession -o user=`
if [ "$lxuser" ]; then
    lxde-logout    
fi

# sniff OpenBox logout:
obuser=`ps -C openbox -o user=`
lxduser=`ps -C lxsession -o user=`
if [ "$lxduser" ]; then
    exit 0
else
    if [ "$obuser"  ]; then
        ~/.config/openbox/logoutscript       
    fi
fi
this works, but then i thought, maybe the 'logoutscript' just has to look out for lxsession and execute lxde-logout if present?
Tho i'm also thinking in this direction:
Rclick mousebind in lxde-rc.xml and rc.xml linked to different desktop specific pipe-menu eg logout commands config etc..
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
ncmprhnsbl
Full of knowledge
Full of knowledge
Posts: 783
Joined: 20 Mar 2012, 03:42
Distribution: 3.2.2-64bit xfce/openbox
Location: australia
Contact:

Re: How to set up openbox

Post#14 by ncmprhnsbl » 12 Mar 2014, 03:29

edited first post re: openbox-menu **** NOTE since Porteus 3.0, menu entry must be: execute="openbox-menu lxde-applications.menu"
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44

Post Reply