You are not logged in.

#26 2010-04-11 17:02:54

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: [Openbox] Hacks and Configs Thread!

Thank you all for the great tips.  I now have pseudo-tiling in Openbox.

I anchor the tiles to the desktop edges and set the window sizes so there's a small gap between them.  This allows me to see if I've any windows hiding below the tiled windows.

I had to adjust tile sizes for the horizontal tint2 appearing at the desktop base.  With my 1280x1024 desktop, the quarter-screen tile size is 636x474.  The vertical half-screen tile is 636x974 and the horizontal is 1280x474.

Keybindings:
    Win-F5 through Win-F8:  quarter-screens top-left, top-right, bottom-right, bottom-left.
    Shift-Win-F5 and Shift-Win-F6:  left and right vertical half-screens.
    Shift-Win-F7 and Shift-Win-F8:  top and bottom horizontal half-screens.

I also appreciated the suggestion to use the menu key. I've bound it with various modifier keys to bring up the Openbox root-menu, the client-menu and dmenu.

Offline

#27 2010-04-11 17:30:56

pokraka
Member
From: Brussels
Registered: 2009-01-15
Posts: 63

Re: [Openbox] Hacks and Configs Thread!

I use this mouse binding which I find useful :

<mousebind button="A-Middle" action="Press">
    <action name="ResizeRelative">
        <left>-48</left>
        <right>-48</right>
        <top>-48</top>
        <bottom>-48</bottom>
    </action>
    <action name="GrowToEdgeNorth"/>
    <action name="GrowToEdgeSouth"/>
    <action name="GrowToEdgeEast"/>
    <action name="GrowToEdgeWest"/>
</mousebind>

When you middle-click on a window with the alt key pressed it will make it grow to the edges of windows surrounding it.
It first shrinks every edge by 48 pixels, so in case your window is a little bit covering the surounding ones it will not grow over them.

Last edited by pokraka (2010-04-11 17:32:36)

Offline

#28 2010-05-07 18:34:14

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: [Openbox] Hacks and Configs Thread!

Added one very useful keybind to toggle a window on the top layer:

    <keybind key="W-A-space">
      <action name="ToggleAlwaysOnTop"/>
    </keybind>

It is very useful when you need to constantly have a look at your terminal while browsing for example. wink

Last edited by rent0n (2010-05-08 09:48:56)


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#29 2010-05-08 09:39:17

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: [Openbox] Hacks and Configs Thread!

I'm sorry, wanted to edit, not to quote! roll

Last edited by rent0n (2010-05-08 09:48:46)


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#30 2010-05-23 08:34:09

doby
Member
From: Paris, France
Registered: 2009-06-27
Posts: 25

Re: [Openbox] Hacks and Configs Thread!

@rent0n : In your volumeNotify.sh, you could also use amixer set Master toggle to toggle the mute flag of your mixer tongue
@all : Here is my config

<!-- Desktop keys -->
    <keybind key="C-A-Left">
      <action name="DesktopPrevious">
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="C-A-Right">
      <action name="DesktopNext">
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="S-A-Left">
      <action name="SendToDesktopPrevious">
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="S-A-Right">
      <action name="SendToDesktopNext">
        <wrap>no</wrap>
      </action>
    </keybind>
    <!-- Window keys -->
    <keybind key="A-space">
      <action name="ShowMenu">
        <menu>client-menu</menu>
      </action>
    </keybind>
    <keybind key="A-Tab">
      <action name="NextWindow"/>
    </keybind>
    <keybind key="A-S-Tab">
      <action name="PreviousWindow"/>
    </keybind>
    <keybind key="W-c">
      <action name="Close"/>
    </keybind>
    <keybind key="W-m">
      <action name="ToggleMaximizeFull"/>
    </keybind>
    <keybind key="W-i">
      <action name="Iconify"/>
    </keybind>
    <keybind key="W-Left">
      <action name="GrowToEdgeWest"/>
    </keybind>
    <keybind key="W-Right">
      <action name="GrowToEdgeEast"/>
    </keybind>
    <keybind key="W-Up">
      <action name="GrowToEdgeNorth"/>
    </keybind>
    <keybind key="W-Down">
      <action name="GrowToEdgeSouth"/>
    </keybind>
    <keybind key="W-S-Left">
      <action name="MoveToEdgeWest"/>
    </keybind>
    <keybind key="W-S-Right">
      <action name="MoveToEdgeEast"/>
    </keybind>
    <keybind key="W-S-Up">
      <action name="MoveToEdgeNorth"/>
    </keybind>
    <keybind key="W-S-Down">
      <action name="MoveToEdgeSouth"/>
    </keybind>
    <!-- Applications launcher -->
    <keybind key="A-F2">
      <action name="Execute">
        <execute>gmrun</execute>
      </action>
    </keybind>

For multimedia keys, I use xbindkeys with this config file

# volume handling
"/home/doby/scripts/volume/volume.sh toggle"
    m:0x0 + c:121
"/home/doby/scripts/volume/volume.sh increase"
    m:0x0 + c:123
"/home/doby/scripts/volume/volume.sh decrease"
    m:0x0 + c:122

# music handling
"/home/doby/scripts/music/music.sh play"
    m:0x0 + c:172
"/home/doby/scripts/music/music.sh prev"
    m:0x0 + c:173
"/home/doby/scripts/music/music.sh next"
    m:0x0 + c:171
"/home/doby/scripts/music/music.sh stop"
    m:0x0 + c:174

# miscellaneous handling
"/home/doby/scripts/eject/eject.sh"
    m:0x0 + c:170
"/home/doby/scripts/battery/battery.sh"
    m:0x0 + c:244
"/home/doby/scripts/display/display.sh"
    m:0x0 + c:235

# suspend handling
"sudo /home/doby/scripts/suspend/suspend.sh"
    m:0x0 + c:213

# network handling
"sudo /home/doby/scripts/network/network.sh"
    m:0x0 + c:246

And finally some scripts like volume, music and network

#!/bin/bash
#
# Volume script for OpenBox
#

function toggle(){
    amixer set Master toggle
}

function increase(){
    amixer set Master 2+
}

function decrease(){
    amixer set Master 2-
}

case $1 in
    "toggle")
    toggle;;
    "increase")
    increase;;
    "decrease")
    decrease;;
esac    



#!/bin/bash
#
# Music script for OpenBox
#

function play(){
    # check moc player status
    state=`mocp -i | grep "State: " | cut -d" " -f2`
    if [[ "$state" != "STOP" ]]
    then
    mocp --toggle-pause
    else
    mocp --play
    fi
}

function stop(){
    mocp --stop
}

function next(){
    mocp --next
}

function prev(){
    mocp --previous
}

case $1 in
    "play")
    play;;
    "prev")
    prev;;
    "next")
    next;;
    "stop")
    stop;;
esac


#!/bin/bash
#
# Network script for OpenBox
#
OFF=0; ON=1;

function flags(){
    FLG=$1

    for IDX in `ls /sys/class/rfkill`
    do
    echo "$FLG" > /sys/class/rfkill/"$IDX"/state
    done
}

function status(){
    STATUS="wired"
    if [[ `ifconfig | grep "^eth0"` == "" ]]
    then
    STATUS="wireless"
    fi
}

function toggle(){
    if [[ "$STATUS" == "wired" ]]
    then
    wireless
    else
    wired
    fi
}

function wireless(){
    WIRELESS="wlan0"; WIRED="eth0"
    ADDRESS="192.168.0.4"; NETMASK="255.255.0.0"; GATEWAY="192.168.0.254"; 
    SSID="RezoWIFI"; CHANNEL="1"; MODE="ad-Hoc"

    echo "+ Wireless connection configuration"
    echo " - Close wired and wireless"
    ifconfig "$WIRED" down 1> /dev/null 2> /dev/null
    ifconfig "$WIRELESS" down 1> /dev/null 2> /dev/null
    flags "$ON"
    sleep 2
    echo " - Clear already running wpa and dhcp"
    killall -9 dhclient 1> /dev/null 2> /dev/null
    rm -rf /var/run/wpa_supplicant/wlan0 1> /dev/null 2> /dev/null
    sleep 2
    echo " - Close wired and open wireless"
    ifconfig "$WIRED" down 1> /dev/null 2> /dev/null
    ifconfig "$WIRELESS" up 1> /dev/null 2> /dev/null
    sleep 2
    echo " - Configure wireless with static ip"
    iwconfig "$WIRELESS" mode "$MODE" 1> /dev/null 2> /dev/null
    iwconfig "$WIRELESS" essid "$SSID" channel "$CHANNEL" 1 > /dev/null 2> /dev/null
    wpa_supplicant -B -Dwext -i "$WIRELESS" -c /etc/wpa_supplicant.conf 1> /dev/null 2> /dev/null
    sleep 2
    ifconfig "$WIRELESS" "$ADDRESS" netmask "$NETMASK" 1> /dev/null 2> /dev/null
    route add default gw "$GATEWAY" 1> /dev/null 2>/dev/null
}

function wired(){
    WIRELESS="wlan0"; WIRED="eth0"
    ADDRESS="192.168.0.4"; NETMASK="255.255.0.0"; GATEWAY="192.168.0.254"

    echo "+ Wired connection configuration"
    echo " - Close wired and wireless"
    ifconfig "$WIRED" down 1> /dev/null 2> /dev/null
    fconfig "$WIRELESS" down 1> /dev/null 2> /dev/null
    flags "$OFF"
    sleep 2
    echo " - Clear already running wpa and dhcp"
    killall -9 dhclient 1> /dev/null 2> /dev/null
    rm -rf /var/run/wpa_supplicant/wlan0 1> /dev/null 2> /dev/null
    sleep 2
    echo " - Close wireless and open wired"
    ifconfig "$WIRED" up 1> /dev/null 2>/dev/null
    ifconfig "$WIRELESS" down 1> /dev/null 2> /dev/null
    sleep 2
    echo " - Configure wired with static ip"
    ifconfig "$WIRED" "$ADDRESS" netmask "$NETMASK" 1> /dev/null 2> /dev/null
    route add default gw "$GATEWAY" 1> /dev/null 2>/dev/null
}

status
case $1 in
    "--wired")
    wired;;
    "--wireless")
    wireless;;
    *)
    toggle;;
esac

Last edited by doby (2010-05-23 08:34:32)


Software is like sex, it's better when it's free - L. Torvalds

Offline

#31 2010-05-23 18:22:32

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: [Openbox] Hacks and Configs Thread!

I find stiler to be great in combination with Openbox. It doesn't have to run in the background and doesn' tile windows constantly but instead the different tiling actions can be invoked via hotkeys:

<keybind key="A-a">
  <action name="Execute">
    <execute>stiler left</execute>
  </action>
</keybind>
<keybind key="A-d">
  <action name="Execute">
    <execute>stiler right</execute>
  </action>
</keybind>
<keybind key="A-e">
  <action name="Execute">
    <execute>stiler cycle</execute>
  </action>
</keybind>
<keybind key="A-q">
  <action name="Execute">
    <execute>stiler swap</execute>
  </action>
</keybind>
<keybind key="A-r">
  <action name="Execute">
    <execute>stiler horizontal</execute>
  </action>
</keybind>
<keybind key="A-v">
  <action name="Execute">
    <execute>stiler max_all</execute>
  </action>
</keybind>
<keybind key="A-w">
  <action name="Execute">
    <execute>stiler vertical</execute>
  </action>
</keybind>

Also, i found this mousebind a while ago:

      <mousebind button="A-Up" action="Click">
        <action name="Execute">
          <execute>transset-df -p --inc 0.2 </execute>
        </action>
      </mousebind>
      <mousebind button="A-Down" action="Click">
        <action name="Execute">
          <execute>transset-df -p --min 0.2 --dec 0.2</execute>
        </action>
      </mousebind>

Alt + Mousewheel down decreases the transparency of a window. Scrolling up increases it again. It's not very practical but it looks pretty tongue.

Other than that, I'm using a lot of hotkeys for resizing. I've got one set with Alt/Super_L + {1,2,3,4,5} and Alt/Super_L+Shift + {1,2,3,4,5} since I'm using different resolutions with my laptop.
By far the most useful hotkeys are the stiler swap and left right ones though. Totally love them.

Here's the whole rc.xml: http://github.com/mikar/config/blob/mas … box/rc.xml

Greets,
demian

Last edited by demian (2011-04-30 14:59:51)


no place like /home
github

Offline

#32 2010-06-28 12:18:40

pablokal
Member
From: Nijmegen, Holland
Registered: 2010-03-07
Posts: 96
Website

Re: [Openbox] Hacks and Configs Thread!

This post is entirely focused on managing windows and desktops and not on starting apps.
I think it is a good thing to focus on this for awhile to draw enough attention to this subject.
I was learning all the apps short-cuts and for a long time I didn't focus on window control.
So this is especially meant for people who want to use these kind of keyboard short-cuts more:


I mostly don't work with a tiling wm but with maximized floating windows. Even then you can do a lot with openbox keybindings.

The wonderful thing about openbox is the great ease of configuring keybindings for very intense window managing. The use of the keyboard for managing windows and desktops is a very productive alternative to the use of the mouse. The level and complexity of the keybindings you will want is a very personal thing and will change all the time. This is a starter level set up which is intended just to stimulate you to start using keybindings for window managing.
You will have to try out which keybindings you will like the best; below is just an example that works nice for me and doesn't interfere too much with focused app shortcuts.


Activate windows or window switching

[Obkey variable mentioned between brackets, see below for more info on Obkey]

Super z Focus Next window [Obkey options Action: NextWindow; Raise AllDesktops or Desktop, linear; finalactions: Focus, Raise Unshade]
Super Alt z Tab Focus Previous window [Obkey options Action: PreviousWindow; Raise AllDesktops or Desktop, linear; finalactions: Focus, Raise Unshade]
Super Esc Unfocus, Iconofy [Obkey options Action: iconofy,unfocus]
(preferred here Super combinations because Alt combinations are often already in use by the active window app itself)
Alt F4 Close window

Super F5 ShowMenu [Obkey options Action: menu: ShowMenu client-list-combined-menu]
(shows all apps running on diverse desktops,select with up/down, enter)
Super Alt r Resize focused window [Obkey options Action: Resize edge:none]
Super Left - resizes window to half the screen then snaps it to the left [Obkey options Action: unmaximizefull, maximizevert, move resize to x=0,y=0, width:half horizontal monitor resolution 1920:2=960]
Super Right - resizes window to half the screen then snaps it to the right [Obkey options Action: unmaximizefull, maximizevert, move resize to x=960,y=960, width=960 change to half of your horizontal monitor resolution 1920:2=960]
Super F11 Maximize full, toggle [Obkey options Action:ToggleMaximizeFull]
Super F12 Iconofy
Super D Show/Hide Desktop [Obkey options Action:ToggleShowDesktop]

Moving to different workspaces and moving windows to them

Super F1 Go to Workspace 1 [Obkey options Action: Desktop desktop: 1]
Super F2 Go to Workspace2

Super Up Go to the workspace on the left [Obkey options Action: PreviousWindow]
Super Down Go to the workspace on the right [Obkey options Action: NextWindow]

Super Alt F1 Send window to workspace 1 [Obkey options Action:SendToDesktop, desktop:1 follow:yes]
Super Alt F2 Send window to workspace 2

Super Alt Left Send window to the workspace on the left [Obkey options Action:SendToDesktopLeft]
Super Alt Right Send window to the workspace on the right [Obkey options Action:SendToDesktopRight]


All above keybindings use the easy accessible super and alt keys.

When you use Pytyle; activate with Alt-a (halt it with Alt-u)
then Alt-Ctrl-C cascade windows, Alt-Ctrl-M maximize all windows,
Alt-Ctrl-h tile windows horizontal, Alt=Ctrl=v vertical.

Use Obkey to change keybindings

Select a keybinding, which one is not important and click on plus sign top left (insert sibling keybind); click on the new key till you see " new accelerator", press the key or keys whcih you wnat to use for that action.
Now add, action by clicking on plus sign action bottom middle right, you see as default possibility focus, click on that word and you will see a whole range of options of which you can choose by clicking an that option. When done don't forget to save.

For explanations on the terminology:

http://openbox.org/wiki/Help:Actions#Window_actions

This is a conky file, .conkyrc, to memorize the keybindings (to be placed in /home/username/):
Code:


TEXT
#${color red}Manipulate Windows{color}

SHORTCUT KEYS:
${color beige}Change the Active Window
Super+z$alignr Raise Nxt Wind
Super+Alt+z$alignr Raise Prev Wind
Super+Le$alignr Raise Half wind Le
Super+Ri$alignr Raise Half wind Ri
Super F9$alignr Toggle Shade
Super F10$alignr Toggle fullscreen
Super F11$alignr Toggle Max Full
Super F12$alignr Iconofy
Super+d$alignr Show Desktop
Super+Esc$alignr Unfocus and Iconofy
Super Alt+r$alignr Resize Window
${color beige}Move between Windows
Super+up$alignr Go Left Wind
Super+down$alignr Go Right Wind
Super F1$alignr Go Desktop 1
Super F5$alignr Clientlist Combined Menu
Super+d$alignr Show Desktop
${color beige}Moving Windows
Super Alt Left$alignr Send Win to WoLe
Super Alt Right$alignr Send Win to WoRi
Super Alt F1$alignr Send Win to Wo 1
Super Alt F2$alignr Send Win to Wo 2

Last edited by pablokal (2010-06-28 12:22:48)


GNu/Linux: Nu nog schoner: http://linuxnogschoner.blogspot.com/

Offline

#33 2010-07-02 19:53:36

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: [Openbox] Hacks and Configs Thread!

Hi,

I worked on this for a while and I'm finally satisfied.
This is basically an openbox setup with vim-style keybindings which somehow emulates the behaviour of tiling WMs like wmii or i3.

You may want to check out this screenshot to have an idea about the look'n'feel of this setup.


Intro
As a first thing I've set <followMouse> to 'yes' with a <focusDelay> of '50' ms to give focus to windows just by passing over them with the mouse (rather than
clicking).
Then,  I set <center> to 'no' so that windows fill space wisely: basically the first window is drawn at the top-left corner and the other window fill the remaining space,  without overlapping  (try this and you'll see what I mean).
I've got 14 pixels margins at the top and :at the bottom of the screen for conky and tint2,  respectively.


Keybindings:

..:: Desktop Actions ::..
Win + Enter: show menu
Win + Space: show desktop
Win + 1, 2, 3, 4, 5: go to desktop 1, 2, 3, 4, 5
Win + Tab: go to next dekstop
Win + Shift + Tab: go to previos desktop
Win + Shift + 1, 2, 3, 4, 5: move window to desktop 1, 2, 3, 4, 5

..:: Window Actions ::..
Win + Shift + Space: toggle window always on top
Win + Shift + c: close window
Win + f: toggle fullscreen window
Win + m: toggle maximized window
Win + e: toggle vertically maximized window
Win + o: toggle horizonatlly maximized window
Win + i: iconify window

..:: Windows Management ::..
Win + Left, Down, Up, Right: focus window east, south, north, west
Win + h, j, k, l: focus window east, south, north, west
Win + Shift + Left, Down, Up, Right: move window east, south, north, west
Win + Shift + h, j, k, l: move window east, south, north, west
Win + Ctrl + Left, Down, Up, Right: grow window east, south, north, west
Win + Shift + h, j, k, l: growwindow east, south, north, west
Win + n: focus next window
Win + Shift + n: focus previous window

..:: Session Actions ::..
Win + Shift + r: restarts openbox
Win + Shift + q: quits openbox
Win + q: starts a dmenu session menu with logout/restart/shutdown/reboot/suspend/hibernate actions

..:: Start Applications ::..
Win + Shift + Enter: start urxvt
Win + v: start dmenu
Win + Alt + t: start urxvt
Win + Alt + f: start vifm
Win + Alt + b: start vimperator
Win + Alt + m: start mutt
Win + Alt + c: start weechat
Win + Alt + n: start ncmpcpp
Win + Alt + p: start mplayer in radio streaming mode

..:: Special Keys ::..
Quite straightforward mapping: check my rc.xml for details.


Mousebindings:
The default ones,  plus some others:
Win + ScrollUp: go to previous desktop
Win + ScrollDown: go to next desktop
Win + LMB: move windows
Win + RMB: resize window
Win + Shift + RMB: close window
Win + Shift + ScrollDown: iconify window


Applications:
I've got all windows undecorated.
Vimperator starts on desktop 2,  mutt starts on desktop 3,  weechat on desktop 4,  ncmpcpp and mplayer on desktop 5.


Menu:
Just a small one with urxvt/vifm/vimperator/mutt/weechat/ncmpcpp/mplayer and a session menu to logout/restart/shutdown/reboot/suspend/hibernate


Here are my configs:

-- rc.xml --

<?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">
  <resistance>
    <strength>20</strength>
    <screen_edge_strength>30</screen_edge_strength>
  </resistance>
  <focus>
    <focusNew>yes</focusNew>
    <!-- always try to focus new windows when they appear. other rules do
       apply -->
    <followMouse>yes</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>50</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>Smart</policy>
    <!-- 'Smart' or 'UnderMouse' -->
    <center>no</center>
    <!-- whether to place windows in the center of the free area found or
       the top left corner -->
    <monitor>Active</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 -->
    <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>2px</name>
    <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>Terminus</name>
      <size>8</size>
      <!-- font size in points -->
      <weight>Normal</weight>
      <!-- 'bold' or 'normal' -->
      <slant>Normal</slant>
      <!-- 'italic' or 'normal' -->
    </font>
    <font place="InactiveWindow">
      <name>Terminus</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>Terminus</name>
      <size>8</size>
      <!-- font size in points -->
      <weight>Normal</weight>
      <!-- 'bold' or 'normal' -->
      <slant>Normal</slant>
      <!-- 'italic' or 'normal' -->
    </font>
    <font place="MenuItem">
      <name>Terminus</name>
      <size>8</size>
      <!-- font size in points -->
      <weight>Normal</weight>
      <!-- 'bold' or 'normal' -->
      <slant>Normal</slant>
      <!-- 'italic' or 'normal' -->
    </font>
    <font place="OnScreenDisplay">
      <name>Terminus</name>
      <size>9</size>
      <!-- font size in points -->
      <weight>Normal</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>5</number>
    <firstdesk>1</firstdesk>
    <names>
      <name>alpha</name>
      <name>beta</name>
      <name>gamma</name>
      <name>delta</name>
      <name>epsilon</name>
    </names>
    <popupTime>500</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>14</top>
    <bottom>14</bottom>
    <left>0</left>
    <right>0</right>
  </margins>
  <dock>
    <position>Top</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>Horizontal</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>
    <!-- Desktops Actions -->
    <keybind key="W-Return">
      <action name="ShowMenu">
        <menu>root-menu</menu>
      </action>
    </keybind>
    <keybind key="W-space">
      <action name="ToggleShowDesktop">
        </action>
    </keybind>
    <!-- Desktops Movements -->
    <keybind key="W-1">
      <action name="Desktop">
        <desktop>1</desktop>
      </action>
    </keybind>
    <keybind key="W-S-1">
      <action name="SendToDesktop">
        <desktop>1</desktop>
        <follow>yes</follow>
      </action>
    </keybind>
    <keybind key="W-2">
      <action name="Desktop">
        <desktop>2</desktop>
      </action>
    </keybind>
    <keybind key="W-S-2">
      <action name="SendToDesktop">
        <desktop>2</desktop>
        <follow>yes</follow>
      </action>
    </keybind>
    <keybind key="W-3">
      <action name="Desktop">
        <desktop>3</desktop>
      </action>
    </keybind>
    <keybind key="W-S-3">
      <action name="SendToDesktop">
        <desktop>3</desktop>
        <follow>yes</follow>
      </action>
    </keybind>
    <keybind key="W-4">
      <action name="Desktop">
        <desktop>4</desktop>
      </action>
    </keybind>
    <keybind key="W-S-4">
      <action name="SendToDesktop">
        <desktop>4</desktop>
        <follow>yes</follow>
      </action>
    </keybind>
    <keybind key="W-5">
      <action name="Desktop">
        <desktop>5</desktop>
      </action>
    </keybind>
    <keybind key="W-S-5">
      <action name="SendToDesktop">
        <desktop>5</desktop>
        <follow>yes</follow>
      </action>
    </keybind>
    <keybind key="W-Tab">
      <action name="DesktopNext">
        </action>
    </keybind>
    <keybind key="W-S-Tab">
      <action name="DesktopPrevious">
        <follow>no</follow>
      </action>
    </keybind>
    <!-- Windows Actions -->
    <keybind key="W-S-c">
      <action name="Close">
        </action>
    </keybind>
    <keybind key="W-S-space">
      <action name="ToggleAlwaysOnTop">
        </action>
    </keybind>
    <keybind key="W-f">
      <action name="ToggleFullscreen">
        </action>
    </keybind>
    <keybind key="W-m">
      <action name="ToggleMaximizeFull">
        </action>
    </keybind>
    <keybind key="W-o">
      <action name="ToggleMaximizeHorz">
        </action>
    </keybind>
    <keybind key="W-e">
      <action name="ToggleMaximizeVert">
        </action>
    </keybind>
    <keybind key="W-i">
      <action name="Iconify">
        </action>
    </keybind>
    <keybind key="W-n">
      <action name="NextWindow">
        <dialog>no</dialog>
        <raise>yes</raise>
        <linear>yes</linear>
      </action>
    </keybind>
    <keybind key="W-S-n">
      <action name="PreviousWindow">
        <dialog>no</dialog>
        <raise>yes</raise>
        <linear>yes</linear>
      </action>
    </keybind>
    <!-- Windows Movements -->
    <keybind key="W-Up">
      <action name="DirectionalTargetNorth">
        </action>
    </keybind>
    <keybind key="W-k">
      <action name="DirectionalTargetNorth">
        </action>
    </keybind>
    <keybind key="W-Down">
      <action name="DirectionalTargetSouth">
        </action>
    </keybind>
    <keybind key="W-j">
      <action name="DirectionalTargetSouth">
        </action>
    </keybind>
    <keybind key="W-Left">
      <action name="DirectionalTargetWest">
        </action>
    </keybind>
    <keybind key="W-h">
      <action name="DirectionalTargetWest">
        </action>
    </keybind>
    <keybind key="W-Right">
      <action name="DirectionalTargetEast">
        </action>
    </keybind>
    <keybind key="W-l">
      <action name="DirectionalTargetEast">
        </action>
    </keybind>
    <keybind key="W-S-Up">
      <action name="MovetoEdgeNorth">
        </action>
    </keybind>
    <keybind key="W-S-k">
      <action name="MoveToEdgeNorth">
        </action>
    </keybind>
    <keybind key="W-S-Down">
      <action name="MovetoEdgeSouth">
        </action>
    </keybind>
    <keybind key="W-S-j">
      <action name="MoveToEdgeSouth">
        </action>
    </keybind>
    <keybind key="W-S-Left">
      <action name="MovetoEdgeWest">
        </action>
    </keybind>
    <keybind key="W-S-h">
      <action name="MoveToEdgeWest">
        </action>
    </keybind>
    <keybind key="W-S-Right">
      <action name="MoveToEdgeEast">
        </action>
    </keybind>
    <keybind key="W-S-l">
      <action name="MoveToEdgeEast">
        </action>
    </keybind>
    <keybind key="W-C-Up">
      <action name="GrowToEdgeNorth">
        </action>
    </keybind>
    <keybind key="W-C-k">
      <action name="GrowToEdgeNorth">
        </action>
    </keybind>
    <keybind key="W-C-Down">
      <action name="GrowToEdgeSouth">
        </action>
    </keybind>
    <keybind key="W-C-j">
      <action name="GrowToEdgeSouth">
        </action>
    </keybind>
    <keybind key="W-C-Left">
      <action name="GrowToEdgeWest">
        </action>
    </keybind>
    <keybind key="W-C-h">
      <action name="GrowToEdgeWest">
        </action>
    </keybind>
    <keybind key="W-C-Right">
      <action name="GrowToEdgeEast">
        </action>
    </keybind>
    <keybind key="W-C-l">
      <action name="GrowToEdgeEast">
        </action>
    </keybind>
    <!-- Other Actions -->
    <keybind key="W-S-r">
      <action name="Restart">
        </action>
    </keybind>
    <keybind key="W-S-q">
      <action name="Exit">
        <prompt>no</prompt>
      </action>
    </keybind>
    <keybind key="W-q">
      <action name="Execute">
        <command>/home/rent0n/.scripts/dmenu_session.sh</command>
      </action>
    </keybind>
    <!-- Applications -->
    <keybind key="W-S-Return">
      <action name="Execute">
        <command>urxvtc</command>
      </action>
    </keybind>
    <keybind key="W-v">
      <action name="Execute">
        <command>dmenu_run -i -fn -xos4-terminus-medium-r-*--12-*-*-*-*-*-iso10646-1 -nb \#000000 -nf \#999999 -sb \#999999 -sf \#000000</command>
      </action>
    </keybind>
    <keybind key="W-A-t">
      <action name="Execute">
        <command>urxvtc</command>
      </action>
    </keybind>
    <keybind key="W-A-b">
      <action name="Desktop">
        <desktop>2</desktop>
      </action>
      <action name="Execute">
        <command>firefox</command>
      </action>
    </keybind>
    <keybind key="W-A-f">
      <action name="Execute">
        <command>urxvtc -name vifm -e vifm</command>
      </action>
    </keybind>
    <keybind key="W-A-m">
      <action name="Desktop">
        <desktop>3</desktop>
      </action>
      <action name="Execute">
        <command>urxvtc -name mutt -e mutt</command>
      </action>
    </keybind>
    <keybind key="W-A-n">
      <action name="Desktop">
        <desktop>5</desktop>
      </action>
      <action name="Execute">
        <command>urxvtc -name ncmpcpp -e ncmpcpp</command>
      </action>
    </keybind>
     <keybind key="W-A-p">
      <action name="Desktop">
        <desktop>5</desktop>
      </action>
      <action name="Execute">
        <command>urxvtc -name mplayer -e mplayer -playlist .streams</command>
      </action>
    </keybind>   
    <keybind key="W-A-c">
      <action name="Desktop">
        <desktop>4</desktop>
      </action>
      <action name="Execute">
        <command>urxvtc -name weechat -e weechat-curses</command>
      </action>
    </keybind>
    <!-- Special Keys -->
    <keybind key="Print">
      <action name="Execute">
        <command>scrot -q 100  -cd 5 /home/rent0n/screenshot_%d_%m_%y_%H_%M_%S.png</command>
      </action>
    </keybind>
    <keybind key="S-Print">
      <action name="Execute">
        <command>scrot -q 100  -bs /home/rent0n/screenshot_%d_%m_%y_%H_%M_%S.png</command>
      </action>
    </keybind>
    <keybind key="XF86HomePage">
      <action name="Desktop">
        <desktop>2</desktop>
      </action>
      <action name="Execute">
        <command>firefox</command>
      </action>
    </keybind>
    <keybind key="XF86Mail">
      <action name="Desktop">
        <desktop>3</desktop>
      </action>
      <action name="Execute">
        <command>urxvtc -name mutt -e mutt</command>
      </action>
    </keybind>
    <keybind key="XF86Bluetooth">
      <action name="Desktop">
        <desktop>4</desktop>
      </action>
      <action name="Execute">
        <command>urxvtc -name weechat -e weechat-curses</command>
      </action>
    </keybind>
    <keybind key="XF86Launch1">
      <action name="Desktop">
        <desktop>5</desktop>
      </action>
      <action name="Execute">
        <command>urxvtc -name ncmpcpp -e ncmpcpp</command>
      </action>
    </keybind>
    <keybind key="XF86AudioPlay">
      <action name="Execute">
        <command>ncmpcpp toggle</command>
      </action>
    </keybind>
    <keybind key="XF86AudioStop">
      <action name="Execute">
        <command>ncmpcpp stop</command>
      </action>
    </keybind>
    <keybind key="XF86AudioPrev">
      <action name="Execute">
        <command>ncmpcpp prev</command>
      </action>
    </keybind>
    <keybind key="XF86AudioNext">
      <action name="Execute">
        <command>ncmpcpp next</command>
      </action>
    </keybind>
    <keybind key="XF86AudioMute">
      <action name="Execute">
        <command>amixer sset Master toggle</command>
      </action>
    </keybind>
    <keybind key="XF86AudioLowerVolume">
      <action name="Execute">
        <command>amixer sset PCM 10-</command>
      </action>
    </keybind>
    <keybind key="XF86AudioRaiseVolume">
      <action name="Execute">
        <command>amixer sset PCM 10+</command>
      </action>
    </keybind>
    <keybind key="XF86Sleep">
      <action name="Execute">
        <command>sudo pm-suspend</command>
      </action>
    </keybind>
    <keybind key="XF86PowerOff">
      <action name="Execute">
        <command>sudo shutdown -h now</command>
      </action>
    </keybind>
  </keyboard>
  <mouse>
    <dragThreshold>8</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 -->
    <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="DesktopPrevious"/>
      </mousebind>
      <mousebind button="A-Down" action="Click">
        <action name="DesktopNext"/>
      </mousebind>
      <mousebind button="C-A-Up" action="Click">
        <action name="DesktopPrevious"/>
      </mousebind>
      <mousebind button="C-A-Down" action="Click">
        <action name="DesktopNext"/>
      </mousebind>
      <mousebind button="A-S-Up" action="Click">
        <action name="SendToDesktopPrevious"/>
      </mousebind>
      <mousebind button="A-S-Down" action="Click">
        <action name="SendToDesktopNext"/>
      </mousebind>
      <!-- Custom Frame -->
      <mousebind button="W-Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="W-Left" action="Drag">
        <action name="Move"/>
      </mousebind>
      <mousebind button="W-Right" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="W-Right" action="Drag">
        <action name="Resize"/>
      </mousebind>
      <mousebind button="W-Up" action="Click">
        <action name="DesktopPrevious"/>
      </mousebind>
      <mousebind button="W-Down" action="Click">
        <action name="DesktopNext"/>
      </mousebind>
      <mousebind button="W-S-Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="W-S-Right" action="Press">
        <action name="Close"/>
      </mousebind>
      <mousebind button="W-S-Up" action="Click">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="W-S-Down" action="Click">
        <action name="Iconify"/>
      </mousebind>
    </context>
    <context name="Titlebar">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="Left" action="Drag">
        <action name="Move"/>
      </mousebind>
      <mousebind button="Left" action="DoubleClick">
        <action name="ToggleMaximizeFull"/>
      </mousebind>
      <mousebind button="Middle" action="Press">
        <action name="Lower"/>
        <action name="FocusToBottom"/>
        <action name="Unfocus"/>
      </mousebind>
      <mousebind button="Up" action="Click">
        <action name="Shade"/>
        <action name="FocusToBottom"/>
        <action name="Unfocus"/>
        <action name="Lower"/>
      </mousebind>
      <mousebind button="Down" action="Click">
        <action name="Unshade"/>
        <action name="Raise"/>
      </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="Press">
        <action name="Focus"/>
        <action name="Raise"/>
        <action name="Unshade"/>
      </mousebind>
      <mousebind button="Left" action="Drag">
        <action name="Resize">
          <edge>top</edge>
        </action>
      </mousebind>
    </context>
    <context name="Left">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="Left" action="Drag">
        <action name="Resize">
          <edge>left</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="Right">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="Left" action="Drag">
        <action name="Resize">
          <edge>right</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="Bottom">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="Left" action="Drag">
        <action name="Resize">
          <edge>bottom</edge>
        </action>
      </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="BLCorner">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="Left" action="Drag">
        <action name="Resize"/>
      </mousebind>
    </context>
    <context name="BRCorner">
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="Left" action="Drag">
        <action name="Resize"/>
      </mousebind>
    </context>
    <context name="TLCorner">
      <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="TRCorner">
      <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="ToggleMaximizeFull"/>
      </mousebind>
      <mousebind button="Middle" action="Click">
        <action name="ToggleMaximizeVert"/>
      </mousebind>
      <mousebind button="Right" action="Click">
        <action name="ToggleMaximizeHorz"/>
      </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="DesktopPrevious"/>
      </mousebind>
      <mousebind button="Down" action="Click">
        <action name="DesktopNext"/>
      </mousebind>
      <mousebind button="A-Up" action="Click">
        <action name="DesktopPrevious"/>
      </mousebind>
      <mousebind button="A-Down" action="Click">
        <action name="DesktopNext"/>
      </mousebind>
      <mousebind button="C-A-Up" action="Click">
        <action name="DesktopPrevious"/>
      </mousebind>
      <mousebind button="C-A-Down" action="Click">
        <action name="DesktopNext"/>
      </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>
      <!-- Custom Desktop -->
      <mousebind button="W-Up" action="Click">
        <action name="DesktopPrevious"/>
      </mousebind>
      <mousebind button="W-Down" action="Click">
        <action name="DesktopNext"/>
      </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="DesktopPrevious"/>
      </mousebind>
      <mousebind button="Down" action="Click">
        <action name="DesktopNext"/>
      </mousebind>
      <mousebind button="A-Up" action="Click">
        <action name="DesktopPrevious"/>
      </mousebind>
      <mousebind button="A-Down" action="Click">
        <action name="DesktopNext"/>
      </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>
    <!--
  # this is an example with comments through out. use these to make your
  # own rules, but without the comments of course.

  <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)"
               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/type, or you may use more than one
  # together to restrict your matches.

  # the name, class, and role 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
-->
    <application class="*">
      <decor>no</decor>
    </application>
    <application name="firefox">
      <desktop>2</desktop>
      <focus>yes</focus>
    </application>
    <application name="mutt">
      <desktop>3</desktop>
      <focus>yes</focus>
    </application>
    <application name="weechat">
      <desktop>4</desktop>
      <focus>yes</focus>
    </application>
    <application name="ncmpcpp">
      <desktop>5</desktop>
      <focus>yes</focus>
    </application>
    <application class="MPlayer">
      <desktop>5</desktop>
      <focus>yes</focus>
    </application>
  </applications>

-- menu.xml --

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

<openbox_menu xmlns="http://openbox.org/3.4/menu">
    <menu id="root-menu" label="Openbox">
        <item label="urxvt">
            <action name="Execute">
                <command>
                    urxvtc
                </command>
            </action>
        </item>
        <item label="vifm">
            <action name="Execute">
                <command>
                    urxvtc -name vifm -e vifm
                </command>
            </action>
        </item>
        <item label="vimperator">
            <action name="Desktop">
                <desktop>2</desktop>
                </action>
            <action name="Execute">
                <command>
                    firefox
                </command>
            </action>
        </item>
        <item label="mutt">
            <action name="Desktop">
                <desktop>3</desktop>
                </action>
            <action name="Execute">
                <command>
                    urxvtc -name mutt -e mutt
                </command>
            </action>
        </item>
        <item label="weechat">
            <action name="Desktop">
                <desktop>4</desktop>
                </action>
            <action name="Execute">
                <command>
                    urxvtc -name weechat -e weechat-curses
                </command>
            </action>
        </item>
        <item label="ncmpcpp">
            <action name="Desktop">
                <desktop>5</desktop>
                </action>
            <action name="Execute">
                <command>
                    urxvtc -name ncmpcpp -e ncmpcpp
                </command>
            </action>
        </item>
        <item label="mplayer">
            <action name="Desktop">
                <desktop>5</desktop>
                </action>
            <action name="Execute">
                <command>
                    urxvtc -name mplayer -e mplayer -playlist .streams
                </command>
            </action>
        </item>
        <separator/>
        <menu id="root-menu-112232" label="exit">
            <item label="logout">
                <action name="Exit"/>
            </item>
            <item label="restart">
                <action name="Restart"/>
            </item>
            <item label="shutdown">
                <action name="Execute">
                    <command>
                        sudo shutdown -h now
                    </command>
                </action>
            </item>
            <item label="reboot">
                <action name="Execute">
                    <command>
                        sudo shutdown -r now
                    </command>
                </action>
            </item>
            <item label="suspend">
                <action name="Execute">
                    <command>
                        sudo pm-suspend
                    </command>
                </action>
            </item>
            <item label="hibernate">
                <action name="Execute">
                    <command>
                        sudo pm-hibernate
                    </command>
                </action>
            </item>
        </menu>
    </menu>
<

-- autostart.sh --

# This shell script is run before Openbox launches.
# Environment variables set here are passed to the Openbox session.

# Set a background color
BG=""
if which hsetroot >/dev/null 2>&1; then
    BG=hsetroot
else
    if which esetroot >/dev/null 2>&1; then
    BG=esetroot
    else
    if which xsetroot >/dev/null 2>&1; then
        BG=xsetroot
    fi
    fi
fi
test -z $BG || $BG -solid "#101010"

# D-bus
if which dbus-launch >/dev/null 2>&1 && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
       eval `dbus-launch --sh-syntax --exit-with-session`
fi

# Make GTK apps look and behave how they were set up in the gnome config tools
if test -x /usr/libexec/gnome-settings-daemon >/dev/null; then
  /usr/libexec/gnome-settings-daemon &
elif which gnome-settings-daemon >/dev/null 2>&1; then
  gnome-settings-daemon &
# Make GTK apps look and behave how they were set up in the XFCE config tools
elif which xfce-mcs-manager >/dev/null 2>&1; then
  xfce-mcs-manager n &
fi

# Preload stuff for KDE apps
if which start_kdeinit >/dev/null 2>&1; then
  LD_BIND_NOW=true start_kdeinit --new-startup +kcminit_startup &
fi

# Run XDG autostart things.  By default don't run anything desktop-specific
# See xdg-autostart --help more info
DESKTOP_ENV="OPENBOX"
if which /usr/lib/openbox/xdg-autostart >/dev/null 2>&1; then
  /usr/lib/openbox/xdg-autostart $DESKTOP_ENV
fi

## AUTOSTART ##

# start urxvt daemon
urxvtd -q -f -o &

# add exotic fonts to xfontsel
xset +fp /usr/share/fonts/local &
xset fp rehash &

# map Caps_Lock to Escape
setxkbmap -option caps:escape &

# enable Num_Lock
numlockx &

# enable media keys
/home/rent0n/.scripts/xinput_media_keys.sh &
/home/rent0n/.scripts/euro_dollar.sh &

# sync primary and clipboard selections
autocutsel -selection PRIMARY -fork &
autocutsel -selection CLIPBOARD -fork &

# set wallpaper
feh --bg-scale /home/rent0n/.wallpapers/Leaf_Skin_by_Epheus.jpg &

# Start conky
(sleep 4 && conky) &

# start tint2
tint2 &

Please let me know what do you think of this setup! big_smile

Last edited by rent0n (2010-07-02 20:01:03)


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#34 2010-07-05 07:19:12

tamtam
Member
From: France
Registered: 2010-02-11
Posts: 47

Re: [Openbox] Hacks and Configs Thread!

Hey,

In Openbox when a window is maximized, we have only the upper border (cf. screenshot), is it possible to have them all?


Lady, people aren't chocolates. Do you know what they are mostly? Bastards. Bastard-coated bastards with bastard filling. But I don't find them half as annoying as I find naive bobble-headed optimists who walk around vomiting sunshine.

Offline

#35 2010-07-05 18:04:10

daneel971
Member
Registered: 2008-03-28
Posts: 197

Re: [Openbox] Hacks and Configs Thread!

Maybe some of you know apparix: it's in our community repo and I became really addicted to it.
I wrote a little pipemenu so I can have my apparix bookmarks right in the openbox menu, with an option to open them in a terminal or with thunar, and to edit the bookmark file itself. You can choose your preferred editor, file manager and terminal editing the script.

#!/bin/bash
# Openbox Pipe Menu for apparix bookmarks

#where this script is
PIPEDIR=".config/openbox/pipemenus"
#preferred programs
TERMCMD="terminator --geometry 800x450 --working-directory="
FILEMAN="thunar"
EDITOR="gedit"

# Output Openbox menu
cat << _EOF_
    <openbox_pipe_menu>
_EOF_
for item in $(cat ~/.apparixrc); do
    DIR=$(echo ${item} | cut -d"," -f3)
    LABEL=$(echo ${item} | cut -d"," -f2)
    cat << _EOF_
    <menu id="launcher_$LABEL" label="$LABEL" >
            <item label="thunar">
                <action name="Execute">
                    <command>$FILEMAN $DIR</command>
                    <startupnotify><enabled>yes</enabled></startupnotify>
                </action>
            </item>
            <item label="terminal">
                <action name="Execute">
                    <command>$TERMCMD$DIR</command>
                    <startupnotify><enabled>yes</enabled></startupnotify>
                </action>
            </item>
    </menu>
_EOF_
done
cat << _EOF_
    <separator/>
                <item label="Edit bookmarks">
                    <action name="Execute">
                        <execute>
                             $EDITOR ~/.apparixrc
                        </execute>
                    </action>
                </item>
    </openbox_pipe_menu>
_EOF_

Offline

#36 2010-07-05 19:07:50

pablokal
Member
From: Nijmegen, Holland
Registered: 2010-03-07
Posts: 96
Website

Re: [Openbox] Hacks and Configs Thread!

tamtam wrote:

Hey,

In Openbox when a window is maximized, we have only the upper border (cf. screenshot), is it possible to have them all?

Yes you have to choose toggle max full as keybinding in my config: super f11

@renton.
What you try to accomplish is something totally different form what I would want.
That said I won't get into that sort of details but only how you use  your keys for managing windows.
You use a lot of super +letter keybindings  for window managing.
I reserve the letters for starting apps.
For closing windows I can use alt+f4 because I almost always work with maximized windows and don't use more instances of a program except when using the terminal; wanting the tiling window manager is nice when using more terminals. I use pytyle for that.


GNu/Linux: Nu nog schoner: http://linuxnogschoner.blogspot.com/

Offline

#37 2010-07-05 19:30:34

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: [Openbox] Hacks and Configs Thread!

pablokal wrote:
tamtam wrote:

Hey,

In Openbox when a window is maximized, we have only the upper border (cf. screenshot), is it possible to have them all?

Yes you have to choose toggle max full as keybinding in my config: super f11

@renton.
What you try to accomplish is something totally different form what I would want.
That said I won't get into that sort of details but only how you use  your keys for managing windows.
You use a lot of super +letter keybindings  for window managing.
I reserve the letters for starting apps.
For closing windows I can use alt+f4 because I almost always work with maximized windows and don't use more instances of a program except when using the terminal; wanting the tiling window manager is nice when using more terminals. I use pytyle for that.

Hi pablokal and thanks for your comment. smile

I don't know if you ever tried a tiling wm like dwm, wmii or i3, but basically I've just transfered their keybindings to openbox and added some others that follow the same style. The aim was to create a pseudo-tiling experience in openbox with the same keybindings you normally use in a tiling wm.
I manage windows more often than starting new apps and Win+Alt+letter is handy enough to start new apps.
I already tried PyTyle in the past and I will surely give it another go in the future, but basically I don't feel I really need it, with this setup.

I think that openbox is so good because it doesn't give you a standard configuration of keybindings for most things, but it's up to you to create your own.  On the other hand, tiling wms have really good keybindings that can considerably speed up your work, so I tried to get the best of both worlds.

In the end, everyone has its own tastes and use the window manager / configuration that is most appropriate to suit his needs! big_smile

Cheers,

EDIT: @tamtam: AFAIK, you can't. I remember someone talking about this in the openbox mailing list, maybe you can search their archives. wink

Last edited by rent0n (2010-07-05 19:32:07)


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#38 2010-08-01 16:30:56

quigybo
Member
Registered: 2009-01-15
Posts: 223

Re: [Openbox] Hacks and Configs Thread!

First in relation to the pseudo-tiling, thanks a lot for posting your configs, it is just what I needed to get me going. I have W-C-A-Left and W-C-A-Right for the two halves of my screen, but then I started to think about quarters of the screen and not just halves. So I extended on the idea with the help of chained keyboard commands, so now I have W-C-A-Up and W-C-A-Down as initialisers of key chains, where afterwards I press an arrow key to define a corner. To summarise:

    W-C-A-Up: keychain for upper half of screen
        Left: top left quarter of screen
        Right: top right quarter of screen
        Up: top half of screen
    W-C-A-Down: keychain for bottom half of screen
        Left: bottom left quarter of screen
        Right: bottom right quarter of screen
        Down: bottom half of screen

And now I have a question: mouse commands have the concept of context, where for example a right click in "root" context shows the menu. Is there something similar for keyboard commands? The reason I ask is that I'm trying to get A-F4 in the root context to show a shutdown dialog. Is this possible in openbox?

Offline

#39 2010-08-04 16:13:58

k3ttc4r
Member
From: around somewhere
Registered: 2008-12-28
Posts: 137
Website

Re: [Openbox] Hacks and Configs Thread!

quigybo wrote:

    W-C-A-Up: keychain for upper half of screen
        Left: top left quarter of screen
        Right: top right quarter of screen
        Up: top half of screen
    W-C-A-Down: keychain for bottom half of screen
        Left: bottom left quarter of screen
        Right: bottom right quarter of screen
        Down: bottom half of screen

I am soo going to steal that big_smile

I just set up openbox today and was doing some reading on the possibilities. I came across this thread and saw all this pseudo-tiling, thought to myself "that's a good idea", and remembered the chained commands. I came to the conclusion that I'd do something like that, and was just thinking about the best way to realize that when I came across you post. And I'm loving how you solved it.


arch64   ||   github | dotshare | blog

Offline

#40 2010-08-05 01:09:44

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: [Openbox] Hacks and Configs Thread!

This may not be that interesting to people who have used OB for a while but it may help some newbie with his set up if he wants a transparent terminal on a specific desktop.  I ended up using the Xfce Terminal program to do this because it is simple to set up, reasonably light and doesn't confuse me with a billion options a la urxvt.

<!-- my term must always be on desktop 2,
       maximized and below everything else -->
    <application name="Terminal*">
      <desktop>2</desktop>
      <!-- maximized>yes</maximized -->
      <fullscreen>yes</fullscreen>
      <layer>below</layer>
      <monitor>2</monitor>
      <skip_pager>yes</skip_pager>
      <iconic>no</iconic>
      <skip_taskbar>yes</skip_taskbar>
      <decor>no</decor>
      <focus>no</focus>
    </application>

What this does is:

- sets up the terminal application on desktop 2
- makes the app come up in fullscreen (you can set this to maximized instead, which I commented out, so that the window doesn't obscure your panel if you have one)
- keeps the term below all other apps so it doesn't steal focus from a newly opened app
- removes all decorations, skips the pager and taskbar

This took me about 2 hours to work out and really isn't terribly useful but I like the result.  I've seen enough "how do I get a terminal that's transparent on my desktop" questions that I thought this might help those who want the quick and easy way of setting this up.

Now if I could just get the terminal to open on a specific monitor while I am using Twinview I'd be set.

Last edited by MoonSwan (2010-08-05 01:10:23)

Offline

#41 2010-08-08 08:18:48

quigybo
Member
Registered: 2009-01-15
Posts: 223

Re: [Openbox] Hacks and Configs Thread!

@k3ttc4r: steal away smile

Feel free to tell me how to get A-F4 on the desktop (root context) while you are at it... tongue

Offline

#42 2010-10-28 08:26:19

kwbauson
Member
Registered: 2010-08-23
Posts: 34

Re: [Openbox] Hacks and Configs Thread!

Not really a hack or config, but something I noticed is that when something is NOT assigned to a modifier key, then if you have the modifier key pressed, the something doesn't happen.  An example is this:  I've got it set up so that if I click a window (default behavior), then  it get's raised.  If I hold any modifier while clicking on a window key, then I can do whatever I want with the window and it won't be raised.

Offline

#43 2010-10-28 09:01:28

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: [Openbox] Hacks and Configs Thread!

kwbauson wrote:

Not really a hack or config, but something I noticed is that when something is NOT assigned to a modifier key, then if you have the modifier key pressed, the something doesn't happen.  An example is this:  I've got it set up so that if I click a window (default behavior), then  it get's raised.  If I hold any modifier while clicking on a window key, then I can do whatever I want with the window and it won't be raised.

That's how it is supposed to work. A modifier key does change the action associated with the (mouse) key simultaneously pressed. So you have to think about them as a unit: modifier + something As such openbox tries to look up the assiciated action, even if it is not defined - in this case an empty action is associated with the combination.


To know or not to know ...
... the questions remain forever.

Offline

#44 2010-10-28 13:40:46

kwbauson
Member
Registered: 2010-08-23
Posts: 34

Re: [Openbox] Hacks and Configs Thread!

I'm new to openbox.  Before I was using xfce (xfwm4) and other various WMs, which do not behave like this.  I think some window manager's just check for a click on a window and then raises the window.

Offline

#45 2010-10-29 06:59:14

sugardeath
Member
Registered: 2010-03-02
Posts: 82

Re: [Openbox] Hacks and Configs Thread!

Looking through this thread caused me to delve a bit deeper into the rc.xml.  I've been using openbox for a few years now, but have only done menu and basic keybind tweaking.  I've just created a brand new menu on the middle button (moving the client list to the left button, very accessible for a notebook) just for pipe-menus.. but then I found out about the mouse keybind contexts!

In the root context:
Left Click: window list
Right: main app menu
Middle: pipe-menu/etc

In the frame context:
Just prepend the clicks with the Windows key and it's the same!  This is soo cool!  Now I can get rid of that 1px bottom margin for access to my menus!

Offline

#46 2010-10-31 11:48:32

useradded
Member
From: Edinburgh, UK
Registered: 2010-05-15
Posts: 77

Re: [Openbox] Hacks and Configs Thread!

Inspired by the posts on openbox pseudo-tiling, I made the following two keybinds:


</keybind>
    <keybind key="C-F9">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>0</x>
        <y>0</y>
        <width>510</width>
        <height>600</height>
      </action>
      <action name="Raise"/>
      <action name="NextWindow">
        <dialog>no</dialog>
        <finalactions>
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>-0</x>
            <y>0</y>
            <width>510</width>
            <height>600</height>
          </action>
          <action name="Raise"/>
        </finalactions>
      </action>
    </keybind>
   

 <keybind key="C-F10">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>-0</x>
        <y>0</y>
        <width>1024</width>
        <height>298</height>
      </action>
      <action name="Raise"/>
      <action name="NextWindow">
        <dialog>no</dialog>
        <finalactions>
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>-0</x>
            <y>-0</y>
            <width>1024</width>
            <height>298</height>
          </action>
          <action name="Raise"/>
        </finalactions>
      </action>
    </keybind>

C-F9 grabs the last two focused windows and places them side-by-side, with each taking up half the screen vertically

C-F10 does the same, but horizontally.


In both cases, one keypress organises two windows relative to one another such that they share the full screen space equally.  I've been unable to reliably extend this kind of binding to cases of more than two windows, so if anyone has any thoughts on that I'd love to hear them.

Really great thread by the way.

Offline

#47 2010-11-03 12:49:41

thisllub
Member
From: Northern NSW Australia
Registered: 2007-12-28
Posts: 231

Re: [Openbox] Hacks and Configs Thread!

I have plenty of window moving shortcuts but I mostly use pytyle for that now.

This is indispensible.and the Win-z combo is easy. Gmrun is lightweight and has virtually the same completion as bash.
This gives me 4-5 keystrokes to start just about any app.

  <keybind key="W-z">
      <action name="Execute">
             <command>gmrun</command>
      </action>
    </keybind>

Last edited by thisllub (2010-11-03 12:50:52)

Offline

#48 2011-01-05 06:28:24

Skyalmian
Member
Registered: 2009-06-28
Posts: 121

Re: [Openbox] Hacks and Configs Thread!

These are current to the screenshots for January 2011 such as these here

autostart.sh's contents...

sh $HOME/.fehbg &
xcompmgr -o.5 &
tint2 &
nm-applet &
clipit &
alsactl restore -f $HOME/.asoundrc &
synclient TouchpadOff=1 &
conky -c $HOME/.conky1 -p 15 &
conky -c $HOME/.conky3 -p 15 &

In rc.xml, at the top is a run program section, with such examples like:

        <!-- Keyboard Execute Combinations -->
        <keybind key="Print">
            <!-- Print Screen -->
            <action name="Execute">
                <command>scrot -q 100</command>
            </action>
        </keybind>
        <!-- [Prefix] CTRL-ALT -->
        <keybind key="C-A-Delete">
            <action name="Execute">
                <command>terminal</command>
            </action>
            <action name="Execute">
                <command>notify-send -t 1000 "XFCE Terminal"</command>
            </action>
        </keybind>
        <!-- [Prefix] CTRL-WIN -->
        <keybind key="C-W-backslash">
            <action name="Execute">
                <command>terminal --hold --maximize -e "ps -u root -U root"</command>
            </action>
            <action name="Execute">
                <command>notify-send -t 1000 "Processes List, ps"</command>
            </action>
        </keybind>
        <keybind key="C-W-BackSpace">
            <action name="Execute">
                <command>terminal --maximize -e "htop -d 10"</command>
            </action>
            <action name="Execute">
                <command>notify-send -t 1000 "Processes List, htop"</command>
            </action>
        </keybind>
        <keybind key="C-W-1">
            <action name="Execute">
                <command>seamonkey-nightly</command>
            </action>
            <action name="Execute">
                <command>notify-send -t 1000 "Browser, Mozilla"</command>
            </action>
        </keybind>
        <keybind key="C-W-minus">
            <!-- File Manager, Thunar -->
            <action name="Execute">
                <command>thunar</command>
            </action>
            <action name="Execute">
                <command>notify-send -t 1000 "File Manager, Thunar"</command>
            </action>
        </keybind>
        <keybind key="C-W-a">
            <action name="Execute">
                <command>audacious</command>
            </action>
            <action name="Execute">
                <command>notify-send -t 1000 "Audacious Media Player"</command>
            </action>
        </keybind>

This section is for restarting some applications... Those "toggle-" being custom shell scripts found from this site.

        <!-- [Prefix] SHIFT-WIN -->
        <keybind key="S-W-F9">
            <action name="Execute">
                <command>toggle-synaptics</command>
            </action>
        </keybind>
        <keybind key="S-W-c">
            <action name="Execute">
                <command>toggle-xcompmgr</command>
            </action>
            <action name="Execute">
                <command>notify-send -t 1000 "Restart X Composite Manager"</command>
            </action>
        </keybind>
        <keybind key="S-W-o">
            <action name="Execute">
                <command>openbox --restart</command>
            </action>
            <action name="Execute">
                <command>notify-send -t 1000 "Restart Open Box Window Manager"</command>
            </action>
        </keybind>
        <keybind key="S-W-p">
            <action name="Execute">
                <command>toggle-clipit</command>
            </action>
            <action name="Execute">
                <command>notify-send -t 1000 "Restart ClipIt Clipboard Manager"</command>
            </action>
        </keybind>
        <keybind key="S-W-t">
            <action name="Execute">
                <command>toggle-tint2</command>
            </action>
            <action name="Execute">
                <command>notify-send -t 1000 "Restart Tint 2 Desktop Panel"</command>
            </action>
        </keybind>

I use this section of rc.xml very often... I have a laptop with a 1366 x 768 screen, but it's set up for up to 1920 x 1080... I press C-W-A-5 for most windowed applications...

        <!-- Window Manager Commands (Customized) -->
        <!-- [Prefix] CTRL-WIN-ALT -->
        <keybind key="C-W-A-b">
            <action name="ToggleDecorations"/>
        </keybind>
        <keybind key="C-W-A-c">
            <action name="MoveToCenter"/>
        </keybind>
        <keybind key="C-W-A-f">
            <action name="ToggleFullscreen"/>
        </keybind>
        <keybind key="C-W-A-s">
            <action name="ToggleShowDesktop"/>
        </keybind>
        <keybind key="C-W-A-grave">
            <action name="MoveResizeTo">
                <x>center</x>
                <y>center</y>
                <height>1080</height>
                <width>1920</width>
            </action>
            <action name="Execute">
                <command>notify-send -t 500 "1920 x 1080 1080p"</command>
            </action>
        </keybind>
        <keybind key="C-W-A-1">
            <action name="MoveResizeTo">
                <x>center</x>
                <y>center</y>
                <height>1050</height>
                <width>1680</width>
            </action>
            <action name="Execute">
                <command>notify-send -t 500 "1680 x 1050 WSXGA+"</command>
            </action>
        </keybind>
        <keybind key="C-W-A-2">
            <action name="MoveResizeTo">
                <x>center</x>
                <y>center</y>
                <height>900</height>
                <width>1600</width>
            </action>
            <action name="Execute">
                <command>notify-send -t 500 "1600 x 0900 900p"</command>
            </action>
        </keybind>
        <keybind key="C-W-A-3">
            <action name="MoveResizeTo">
                <x>center</x>
                <y>center</y>
                <height>900</height>
                <width>1440</width>
            </action>
            <action name="Execute">
                <command>notify-send -t 500 "1440 x 0900 WXGA+"</command>
            </action>
        </keybind>
        <keybind key="C-W-A-4">
            <action name="MoveResizeTo">
                <x>center</x>
                <y>center</y>
                <height>720</height>
                <width>1280</width>
            </action>
            <action name="Execute">
                <command>notify-send -t 500 "1280 x 0720 720p"</command>
            </action>
        </keybind>
        <keybind key="C-W-A-5">
            <action name="MoveResizeTo">
                <x>center</x>
                <y>center</y>
                <height>576</height>
                <width>1024</width>
            </action>
            <action name="Execute">
                <command>notify-send -t 500 "1024 x 0576 WSVGA"</command>
            </action>
        </keybind>
        <keybind key="C-W-A-6">
            <action name="MoveResizeTo">
                <x>center</x>
                <y>center</y>
                <height>600</height>
                <width>800</width>
            </action>
            <action name="Execute">
                <command>notify-send -t 500 "0800 x 0600 SVGA"</command>
            </action>
        </keybind>
        <keybind key="C-W-A-7">
            <action name="MoveResizeTo">
                <x>center</x>
                <y>center</y>
                <height>480</height>
                <width>640</width>
            </action>
            <action name="Execute">
                <command>notify-send -t 500 "0640 x 0480 VGA"</command>
            </action>
        </keybind>
        <keybind key="C-W-A-8">
            <action name="MoveResizeTo">
                <x>center</x>
                <y>center</y>
                <height>240</height>
                <width>480</width>
            </action>
            <action name="Execute">
                <command>notify-send -t 500 "0480 x 0240"</command>
            </action>
        </keybind>
        <keybind key="C-W-A-9">
            <action name="MoveResizeTo">
                <x>center</x>
                <y>center</y>
                <height>240</height>
                <width>320</width>
            </action>
            <action name="Execute">
                <command>notify-send -t 500 "0320 x 0240 QVGA"</command>
            </action>
        </keybind>
        <keybind key="C-W-A-0">
            <action name="MoveResizeTo">
                <x>center</x>
                <y>center</y>
                <height>640</height>
                <width>256</width>
            </action>
            <action name="Execute">
                <command>notify-send -t 500 "0256 x 0640"</command>
            </action>
        </keybind>
        <!-- [Prefix] WIN -->
        <keybind key="W-z">
            <action name="Close"/>
        </keybind>

Under "<mouse>" -> "<context name="Frame">", extra mouse buttons for handling windows when I have borders disabled in Openbox.

            <!-- <mousebind button="A-Left" action="Drag"> -->
            <mousebind button="button 8" action="Press"> <!-- Special key on Logitech MX510 mouse. -->
                <action name="Move"/>
            </mousebind>
            <mousebind button="button 9" action="Click"> <!-- Special key on Logitech MX510 mouse. -->
                <action name="MoveToCenter"/>
            </mousebind>
            <mousebind button="button 10" action="Click"> <!-- Special key on Logitech MX510 mouse. -->
                <action name="ToggleMaximizeFull"/>
            </mousebind>

The "<applications>" section:

 # in order from most prominent to least prominent -->
        <application class="*">
            <decor>no</decor>
        </application>
        <!-- Console (Terminal) -->
        <application class="Terminal">
            <focus>yes</focus>
            <layer>above</layer>
            <position force="yes">
                <x>center</x>
                <y>center</y>
            </position>
        </application>
        <!-- Console (xterm) -->
        <application class="XTerm">
            <focus>yes</focus>
            <layer>above</layer>
            <position force="yes">
                <x>center</x>
                <y>center</y>
            </position>
        </application>
        <!-- Conky 1 -->
        <application class="Conky1">
            <desktop>1</desktop>
        </application>
        <!-- Conky 2 -->
        <application class="Conky2">
            <desktop>1</desktop>
        </application>
        <!-- Conky 3 -->
        <application class="Conky3">
            <desktop>2</desktop>
        </application>
        <!-- System Monitor (GNOME System Monitor) -->
        <application class="Gnome-system-monitor" name="gnome-system-monitor">
            <focus>yes</focus>
            <layer>above</layer>
            <maximized>true</maximized>
            <position force="yes">
                <x>center</x>
                <y>center</y>
            </position>
        </application>
        <!-- Image Viewer (Feh) -->
        <application class="feh">
            <maximized>true</maximized>
            <position force="yes">
                <x>center</x>
                <y>center</y>
            </position>
        </application>
        <!-- Internet Browser (Mozilla SeaMonkey) -->
        <application class="Seamonkey-bin" role="browser">
            <decor>no</decor>
            <maximized>true</maximized>
            <position force="yes">
                <x>center</x>
                <y>center</y>
            </position>
        </application>
        <!-- Instant Messenger Client (Pidgin) -->
        <application class="Pidgin" name="Pidgin" role="buddy_list">
            <position force="yes">
                <x>-8</x>
                <y>8</y>
            </position>
        </application>
        <!-- Instant Messenger Client (Skype) -->
        <application class="Skype" name="skype">
            <position force="yes">
                <x>-320</x>
                <y>8</y>
            </position>
        </application>
        <!-- Internet Relay Chat Client (xChat) -->
        <application type="normal" class="Xchat" name="xchat">
            <decor>no</decor>
        </application>
        <!-- Audio Player (Audacious) -->
        <application class="Audacious" name="audacious" role="player">
            <focus>yes</focus>
            <layer>above</layer>
            <position force="yes">
                <x>192</x>
                <y>16</y>
            </position>
        </application>
        <!-- Video Player (VideoLAN) -->
        <!-- Considers the "bottom" to be the top of the panel. -->
        <application class="Vlc" role="vlc-main">
            <position force="yes">
                <x>-8</x>
                <y>-8</y>
            </position>
        </application>
        <application class="Vlc" role="vlc-playlist">
            <position force="yes">
                <x>center</x>
                <y>8</y>
            </position>
        </application>
        <application class="vlc" name="vlc">
            <position force="yes">
                <x>center</x>
                <y>center</y>
            </position>
        </application>
        <!-- Video Player (SMPlayer) -->
        <application class="Smplayer" name="smplayer">
            <position force="yes">
                <x>center</x>
                <y>center</y>
            </position>
        </application>
        <!-- Wine: HALF-LIFE 2 -->
        <application class="Wine" name="hl2.exe">
            <decor>no</decor>
        </application>
    </applications>

Last edited by Skyalmian (2011-01-05 17:35:29)

Offline

#49 2011-01-27 18:32:09

jwhendy
Member
Registered: 2010-04-01
Posts: 621

Re: [Openbox] Hacks and Configs Thread!

Not sure this is exactly the place for this... but if fit better than a new post, I think.

Just created a silly script to show/hide the tint2 panel and bound it to an Openbox keybind. I like it so far! My motivation was that I'm considering moving my conky from the lower right in a kind of wide arrangement to a top one-liner like I've seen on so many other desktops... but that would mean a bar at both the top and bottom, which would shrink my available landscape. So I thought about some way to show/hide the panel with a keystroke.

This was the result of perusing the xdotool man pages and finding out that there's calls for the mouse location and the ability to move the mouse. The script is kind of silly, but it works! Here she is:

#!/bin/bash

# simple, silly script to allow a keystroke to
# be bound in Openbox to show/hide tint2 panel
# in tint2rc, set 'autohide = 1' and in rc.xml
# input the following:
# <keybind key="key-stroke-here">
#   <action name="Execute">
#     <command>/path/to/this/script</command>
#   </action>
# </keybind>

# the xdotool command is like so:
# xdotool mousemove x y
# 0 0 is upper left
# screen_wid screen_ht (1280 800) is bot rt

eval $(xdotool getmouselocation --shell)

# conditional to decide whether to move
# to the panel or away
# formats:
# --bottom panel: $Y -lt screen_height
# --top panel: $Y -gt panel_height
# --left panel $X -gt panel_height
# --right panel: $X -lt screen_width
if [ $Y -lt 795 ] ;

# change x y  location as desired,
# somewhere you know will unhide tint2
  then `xdotool mousemove 20 800`

# change this to where you want the mouse
# to move to after showing the panel
# 0 0 is upper left
  else `xdotool mousemove 0 0`
fi

I have this currently in /home/jwhendy/panel.sh and my rc.xml section is like so:

    <keybind key="C-A-p">
      <action name="Execute">
        <command>/home/jwhendy/panel.sh</command>
      </action>
    </keybind>

Pressing C-A-p shows the panel and pressing it again hides it. Oh, and if you don't press the key again... the mouse stays down there and leaves the panel visible until you move it manually or activate the script again.

Don't forget

autohide = 1

in tint2rc.

Oh, my searching only found one other thread on this HERE but it's literally killing and starting tint2 again and again which seems undesirable to me. I can think of other ways to use such a method, like replacing "autohide = 0/1" back and forth with a script and killing/restarting tint2... but I think mine, even though kind of via a goofy means, is a little cleaner than that.

I'm no bash expert so feel free to comment, improve, or modify!

Last edited by jwhendy (2011-01-27 18:37:40)

Offline

#50 2011-01-28 00:02:18

quigybo
Member
Registered: 2009-01-15
Posts: 223

Re: [Openbox] Hacks and Configs Thread!

@jwhendy: I would probably just use windowmap and windowunmap instead of moving the mouse about the screen:

#!/bin/bash

WINID=$(xdotool search --class tint2)

# exit if tint2 not running
(( $? > 0 )) && exit 1

# toggle window mapped state
if xdotool search --onlyvisible --class tint2 > /dev/null ; then
    xdotool windowunmap $WINID
else
    xdotool windowmap $WINID
fi

Offline

Board footer

Powered by FluxBB