You are not logged in.

#1 2010-03-14 15:09:16

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

[Openbox] Hacks and Configs Thread!

Welcome to the Openbox Hacks and Configs Thread! lol

I thought it would be nice to have a place where openbox users can share their knowledge and their doubts about this awesome wm, so here it is.
I am completely satisfied with my setup, but I'm sure that I can learn something useful from other Arch users.

I will start by posting and commenting some parts of my rc.xml, mostly related to Actions and Keybinds, the most interesting feature of openbox (or I am missing something cooler?):

This part is the most important one, it allows me to cycle, maximize, iconify, close, move and resize windows using only the keyboard with some easy keybinds:

    
    <keybind key="W-A-Right">
      <action name="NextWindow"/>
    </keybind>
    <keybind key="W-A-Left">
      <action name="PreviousWindow"/>
    </keybind>
    <keybind key="W-A-Up">
      <action name="ToggleMaximizeFull"/>
    </keybind>
    <keybind key="W-A-Down">
      <action name="Iconify"/>
    </keybind>
    <keybind key="W-A-End">
      <action name="Close"/>
    </keybind>
    <keybind key="W-C-Right">
      <action name="GrowToEdgeEast"/>
    </keybind>
    <keybind key="W-C-Left">
      <action name="GrowToEdgeWest"/>
    </keybind>
    <keybind key="W-C-Up">
      <action name="GrowToEdgeNorth"/>
    </keybind>
    <keybind key="W-C-Down">
      <action name="GrowToEdgeSouth"/>
    </keybind>
    <keybind key="W-C-A-Right">
      <action name="MoveToEdgeEast"/>
    </keybind>
    <keybind key="W-C-A-Left">
      <action name="MoveToEdgeWest"/>
    </keybind>
    <keybind key="W-C-A-Up">
      <action name="MoveToEdgeNorth"/>
    </keybind>
    <keybind key="W-C-A-Down">
      <action name="MoveToEdgeSouth"/>
    </keybind>

Here are some other interesting keybinds for various actions I find very handy:

    
    <keybind key="A-Tab">
      <action name="DesktopNext">
      </action>
    </keybind>
    <keybind key="A-S-Tab">
      <action name="SendToDesktopNext">
        <follow>no</follow>
      </action>
    </keybind>
    <keybind key="A-space">
      <action name="ToggleShowDesktop"/>
    </keybind>
    <keybind key="A-Return">
      <action name="ShowMenu">
        <menu>root-menu</menu>
      </action>
    </keybind>
    <keybind key="S-A-Return">
      <action name="ShowMenu">
        <menu>obm-xdg-menu</menu>
      </action>
    </keybind>
    <keybind key="A-F2">
      <action name="Execute">
        <execute>gmrun</execute>
      </action>
    </keybind>
    <keybind key="A-F4">
      <action name="Close"/>
    </keybind>
    <keybind key="A-F5">
      <action name="Execute">
        <execute>xkill</execute>
      </action>
    </keybind>
    <keybind key="A-F10">
      <action name="Reconfigure"/>
    </keybind>
    <keybind key="A-F11">
      <action name="Restart"/>
    </keybind>
    <keybind key="A-F12">
      <action name="Exit"/>
      <prompt>no</prompt>
    </keybind>
    <keybind key="A-BackSpace">
      <action name="Exit"/>
      <prompt>yes</prompt>
    </keybind>
    <keybind key="A-Escape">
      <action name="Execute">
        <execute>xscreensaver-command --lock</execute>
      </action>
    </keybind>
    <keybind key="A-Menu">
      <action name="ShowMenu">
        <menu>client-menu</menu>
      </action>
    </keybind>

And i won't bother you with all my keybinds to launch apps since they're just Windows+ some letter...

To finish, here's how I mapped the special keys of my Acer Aspire 5920:

    
    <keybind key="XF86HomePage">
      <action name="Execute">
        <execute>firefox</execute>
      </action>
    </keybind>
    <keybind key="XF86Bluetooth">
      <action name="Execute">
        <execute>pidgin</execute>
      </action>
    </keybind>
    <keybind key="XF86Mail">
      <action name="Execute">
        <execute>thunderbird</execute>
      </action>
    </keybind>
    <keybind key="XF86Launch1">
      <action name="Execute">
        <execute>sonata</execute>
      </action>
    </keybind>
    <keybind key="XF86AudioRaiseVolume">
      <action name="Execute">
        <execute>/home/enrico/.scripts/VolumeNotify.sh up</execute>
      </action>
    </keybind>
    <keybind key="XF86AudioLowerVolume">
      <action name="Execute">
        <execute>/home/enrico/.scripts/VolumeNotify.sh down</execute>
      </action>
    </keybind>
    <keybind key="XF86AudioMute">
      <action name="Execute">
        <execute>/home/enrico/.scripts/VolumeNotify.sh toggle</execute>
      </action>
    </keybind>

VolumeNotify.sh is a simple modification of a script I found some thime ago in the forums:

#!/bin/bash

command=$1

if [ "$command" = "" ]; then
    echo "usage: $0 {up|down|toggle}"
    exit 0;
fi

display_volume=0

if [ "$command" = "up" ]; then
    amixer sset Master unmute
    display_volume=$(amixer sset PCM 10+ unmute | grep -m 1 "%]" | cut -d "[" -f2|cut -d "%" -f1)
fi

if [ "$command" = "down" ]; then
    amixer sset Master unmute
    display_volume=$(amixer sset PCM 10- unmute | grep -m 1 "%]" | cut -d "[" -f2|cut -d "%" -f1)
fi

icon_name=""

if [ "$command" = "toggle" ]; then
            if amixer get Master | grep "\[on\]"; then
         amixer sset Master mute
                 display_volume=0
            else
         amixer sset Master unmute
                 display_volume=$(amixer get PCM | grep -m 1 "%]" | cut -d "[" -f2|cut -d "%" -f1)
    fi
fi

notify-send "Volume: $display_volume%"
exit 1

That's all.
Have your say, share your configs! smile

Last edited by rent0n (2010-03-14 15:09:49)


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

#2 2010-03-14 15:21:33

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: [Openbox] Hacks and Configs Thread!

I added these binds I can just use my middle mouse button for minimizing/closing. My titlebar has no buttons big_smile

      <mousebind button="Middle" action="Press">
        <action name="Close"/>
      </mousebind>
      <mousebind button="Down" action="Click">
        <action name="Iconify"/>
      </mousebind>

I also made these to emulate a couple of Windows 7 keybinds:

    <keybind key="W-Left">
      <action name="UnmaximizeFull"/>
      <action name="MaximizeVert"/>
      <action name="MoveResizeTo">
        <width>640</width>
      </action>
      <action name="MoveToEdgeWest"/>
    </keybind>
    <keybind key="W-Right">
      <action name="UnmaximizeFull"/>
      <action name="MaximizeVert"/>
      <action name="MoveResizeTo">
        <width>640</width>
      </action>
      <action name="MoveToEdgeEast"/>
    </keybind>

You should change the numbers based on your display resolution.

Last edited by anonymous_user (2010-03-17 20:46:26)

Offline

#3 2010-03-20 10:36:47

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

Re: [Openbox] Hacks and Configs Thread!

Uhm... it seems that this thread is not having a great success... sad

Openbox is extensively hackable and this is why it is so powerful; are the majority of Arch Openbox users using it just like a normal window manager?
Come on, share your knowledge!

For example, does anyone know if Openbox allows to group windows in tabs, like fluxbox does?


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

#4 2010-03-20 12:44:36

the gray
Member
From: Croatia
Registered: 2009-03-16
Posts: 21

Re: [Openbox] Hacks and Configs Thread!

nope. openbox doesn't support window tabbing. i personally don't miss that.

i have a pretty much standard rc.conf except some keybindings and a few window rules. my favorites are these for moving the active window to screen edges

     <keybind key="W-q">
      <action name="MoveResizeTo">
        <x>0</x>
        <y>0</y>
      </action>
    </keybind>
    <keybind key="W-w">
      <action name="MoveResizeTo">
        <x>center</x>
        <y>0</y>
      </action>
    </keybind>
    <keybind key="W-e">
      <action name="MoveResizeTo">
        <x>-0</x>
        <y>0</y>
      </action>
    </keybind>
    <keybind key="W-a">
      <action name="MoveResizeTo">
        <x>0</x>
        <y>center</y>
      </action>
    </keybind>
    <keybind key="W-s">
      <action name="MoveResizeTo">
        <x>center</x>
        <y>center</y>
      </action>
    </keybind>
    <keybind key="W-d">
      <action name="MoveResizeTo">
        <x>-0</x>
        <y>center</y>
      </action>
    </keybind>
    <keybind key="W-y">
      <action name="MoveResizeTo">
        <x>0</x>
        <y>-0</y>
      </action>
    </keybind>
    <keybind key="W-x">
      <action name="MoveResizeTo">
        <x>center</x>
        <y>-0</y>
      </action>
    </keybind>
    <keybind key="W-c">
      <action name="MoveResizeTo">
        <x>-0</x>
        <y>-0</y>
      </action>
    </keybind>

Offline

#5 2010-03-20 13:21:00

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

Re: [Openbox] Hacks and Configs Thread!

the gray wrote:

nope. openbox doesn't support window tabbing. i personally don't miss that.
i have a pretty much standard rc.conf except some keybindings and a few window rules. my favorites are these for moving the active window to screen edges

I don't know if I miss it, just heard of it among fluxbox users.
I'm not sure of what I'm saying but maybe using MoveToEdge (and optionally GrowToEdge) actions could be a good solution for you. What's the difference compared to your approach?


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

#6 2010-03-20 15:36:34

the gray
Member
From: Croatia
Registered: 2009-03-16
Posts: 21

Re: [Openbox] Hacks and Configs Thread!

documentation for MoveToEdge says that edges are both screen edges and other window edges which is not the behaviour i want. i wanted to move windows
exclusively to screen edges and to screen center (which i could have accomplished with MoveToCenter). anyway, this approach seemed more logical to me

Offline

#7 2010-03-20 18:10:53

Wintervenom
Member
Registered: 2008-08-20
Posts: 1,011

Re: [Openbox] Hacks and Configs Thread!

I make Openbox open normal windows maximized and without decoration to emulate the way Musca/Ratpoison/StumpWM let me flip though multiple windows in each container -- now, if I could only work out actually splitting the screen for the multiple containers...
I suppose if I'm going to make Openbox do this, I might as well be using a tiling window manager, but nothing can replace Musca for me.  tongue

<?xml version="1.0" encoding="UTF-8"?>
<openbox_config xmlns="http://openbox.org/3.4/rc">
  <theme>
    <name>Onyx-black</name>
    <titleLayout>CMIDLN</titleLayout>
    <keepBorder>yes</keepBorder>
    <animateIconify>no</animateIconify>
    <font place="ActiveWindow">
      <name>Sans</name>
      <size>7</size>
      <weight>Bold</weight>
      <slant>None</slant>
    </font>
    <font place="InactiveWindow">
      <name>Sans</name>
      <size>7</size>
      <weight>Normal</weight>
      <slant>Italic</slant>
    </font>
    <font place="MenuHeader">
      <name>Sans</name>
      <size>7</size>
      <weight>Normal</weight>
      <slant>None</slant>
    </font>
    <font place="MenuItem">
      <name>Sans</name>
      <size>7</size>
      <weight>Normal</weight>
      <slant>None</slant>
    </font>
    <font place="OnScreenDisplay">
      <name>Sans</name>
      <size>7</size>
      <weight>Normal</weight>
      <slant>None</slant>
    </font>
  </theme>

  <keyboard>
    <chainQuitKey>C-g</chainQuitKey>

    <!-- Switch desktops -->
    <keybind key="W-comma">
      <action name="DesktopPrevious">
        <dialog>yes</dialog>
      </action>
    </keybind>
    <keybind key="W-period">
      <action name="DesktopNext">
        <dialog>yes</dialog>
      </action>
    </keybind>

    <!-- Move window to desktop -->
    <keybind key="W-S-comma">
      <action name="SendToDesktopLeft">
        <dialog>no</dialog>
        <follow>yes</follow>
      </action>
    </keybind>
    <keybind key="W-S-period">
      <action name="SendToDesktopRight">
        <dialog>no</dialog>
        <follow>yes</follow>
      </action>
    </keybind>

    <!-- Switch to specific desktop -->
    <keybind key="W-1">
      <action name="Desktop">
        <desktop>1</desktop>
      </action>
    </keybind>
    <keybind key="W-2">
      <action name="Desktop">
        <desktop>2</desktop>
      </action>
    </keybind>
    <keybind key="W-3">
      <action name="Desktop">
        <desktop>3</desktop>
      </action>
    </keybind>
    <keybind key="W-4">
      <action name="Desktop">
        <desktop>4</desktop>
      </action>
    </keybind>
    <keybind key="W-5">
      <action name="Desktop">
        <desktop>5</desktop>
      </action>
    </keybind>
    <keybind key="W-6">
      <action name="Desktop">
        <desktop>6</desktop>
      </action>
    </keybind>
    <keybind key="W-7">
      <action name="Desktop">
        <desktop>7</desktop>
      </action>
    </keybind>
    <keybind key="W-8">
      <action name="Desktop">
        <desktop>8</desktop>
      </action>
    </keybind>
    <keybind key="W-9">
      <action name="Desktop">
        <desktop>9</desktop>
      </action>
    </keybind>

    <!-- Move window to specific desktop -->
    <keybind key="W-S-1">
      <action name="SendToDesktop">
        <desktop>1</desktop>
        <follow>yes</follow>
      </action>
    </keybind>
    <keybind key="W-S-2">
      <action name="SendToDesktop">
        <desktop>2</desktop>
        <follow>yes</follow>
      </action>
    </keybind>
    <keybind key="W-S-3">
      <action name="SendToDesktop">
        <desktop>3</desktop>
        <follow>yes</follow>
      </action>
    </keybind>
    <keybind key="W-S-4">
      <action name="SendToDesktop">
        <desktop>4</desktop>
        <follow>yes</follow>
      </action>
    </keybind>
    <keybind key="W-S-5">
      <action name="SendToDesktop">
        <desktop>5</desktop>
        <follow>yes</follow>
      </action>
    </keybind>
    <keybind key="W-S-6">
      <action name="SendToDesktop">
        <desktop>6</desktop>
        <follow>yes</follow>
      </action>
    </keybind>
    <keybind key="W-S-7">
      <action name="SendToDesktop">
        <desktop>7</desktop>
        <follow>yes</follow>
      </action>
    </keybind>
    <keybind key="W-S-8">
      <action name="SendToDesktop">
        <desktop>8</desktop>
        <follow>yes</follow>
      </action>
    </keybind>
    <keybind key="W-S-9">
      <action name="SendToDesktop">
        <desktop>9</desktop>
        <follow>yes</follow>
      </action>
    </keybind>

    <!-- Show desktop -->
    <keybind key="W-d">
      <action name="ToggleShowDesktop"/>
    </keybind>

    <!-- Window focus -->
    <keybind key="W-S-n">
      <action name="PreviousWindow">
        <allDesktops>no</allDesktops>
        <raise>yes</raise>
        <linear>yes</linear>
        <dialog>yes</dialog>
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>
    <keybind key="W-n">
      <action name="NextWindow">
        <allDesktops>no</allDesktops>
        <raise>yes</raise>
        <linear>yes</linear>
        <dialog>yes</dialog>
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>

    <!-- Window controls -->
    <keybind key="W-c">
      <action name="Close"/>
    </keybind>
    <keybind key="W-b">
      <action name="Iconify"/>
    </keybind>
    <keybind key="W-m">
      <action name="ToggleMaximizeFull"/>
    </keybind>
    <keybind key="A-space">
      <action name="ShowMenu">
        <menu>client-menu</menu>
      </action>
    </keybind>

    <!-- Window manipulation -->
    <keybind key="W-v">
      <action name="Move"/>
    </keybind>
    <keybind key="W-r">
      <action name="Resize"/>
    </keybind>


    <!-- Openbox control -->
    <keybind key="W-space">
      <action name="ShowMenu">
        <menu>client-list-combined-menu</menu>
      </action>
    </keybind>
    <keybind key="W-z">
      <action name="Execute">
        <command>notify-send -t 3000 "Reloaded Openbox configuration."</command>
      </action>
      <action name="Execute">
        <command>obmenu-update</command>
      </action>
    </keybind>
    <keybind key="W-q">
      <action name="Execute">
        <command>notify-send -t 3000 "Restarting Openbox..."</command>
      </action>
      <action name="Execute">
        <command>openbox --restart</command>
      </action>
    </keybind>
    <keybind key="W-S-q">
      <action name="Exit"></action>
    </keybind>
    <keybind key="W-p">
      <action name="ShowMenu">
        <menu>root-menu</menu>
      </action>
    </keybind>
  </keyboard>

  <mouse>
    <dragThreshold>8</dragThreshold>
    <doubleClickTime>200</doubleClickTime>
    <screenEdgeWarpTime>200</screenEdgeWarpTime>
    <context name="Frame"> <!-- The window itself -->
      <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>
    </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>
    </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>
    </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="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>
  </mouse>

  <desktops>
    <number>9</number>
    <firstdesk>1</firstdesk>
    <names>
      <name>Alpha</name>
      <name>Beta</name>
      <name>Gamma</name>
      <name>Delta</name>
      <name>Epsilon</name>
      <name>Zeta</name>
      <name>Eta</name>
      <name>Theta</name>
      <name>Iota</name>
      <name>Kappa</name>
    </names>
    <popupTime>500</popupTime>
  </desktops>

  <resistance>
    <strength>10</strength>
    <screen_edge_strength>20</screen_edge_strength>
  </resistance>

  <focus>
    <focusNew>yes</focusNew>
    <followMouse>no</followMouse>
    <focusLast>yes</focusLast>
    <underMouse>no</underMouse>
    <focusDelay>200</focusDelay>
    <raiseOnFocus>no</raiseOnFocus>
  </focus>

  <placement>
    <policy>Smart</policy>
    <center>yes</center>
    <monitor>Any</monitor>
  </placement>

  <resize>
    <drawContents>yes</drawContents>
    <popupShow>Nonpixel</popupShow>
    <popupPosition>Center</popupPosition>
    <popupFixedPosition>
      <x>10</x>
      <y>10</y>
    </popupFixedPosition>
  </resize>

  <margins>
    <top>0</top>
    <bottom>12</bottom>
    <left>0</left>
    <right>0</right>
  </margins>

  <dock>
    <position>Top</position>
    <floatingX>0</floatingX>
    <floatingY>0</floatingY>
    <noStrut>No</noStrut>
    <stacking>Above</stacking>
    <direction>Horizontal</direction>
    <autoHide>no</autoHide>
    <hideDelay>300</hideDelay>
    <showDelay>300</showDelay>
    <moveButton>Middle</moveButton>
  </dock>

  <menu>
    <file>menu.xml</file>
    <hideDelay>200</hideDelay>
    <middle>no</middle>
    <submenuShowDelay>100</submenuShowDelay>
    <applicationIcons>yes</applicationIcons>
    <manageDesktops>yes</manageDesktops>
  </menu>

  <applications>
    <application class="*" type="normal">
      <maximized>yes</maximized>
      <decor>no</decor>
    </application>
    <application name="gimp">
      <maximized>no</maximized>
      <decor>yes</decor>
    </application>
  </applications>
</openbox_config>

Last edited by Wintervenom (2010-03-20 18:11:23)

Offline

#8 2010-03-20 18:14:57

xd-0
Member
From: Sweden
Registered: 2007-11-02
Posts: 327
Website

Re: [Openbox] Hacks and Configs Thread!

First I have the ordinaty multimediakeys mapped to ossvol (in AUR) and mpc. But that is described in one of the above posts.
Secondly I have w+right w+left set to move and resize the active window to half the screen (left or right). This works nice with my resolution 1680x1050 and 28px high tint2 panel, and leaves a little space. It's a nice workaround if you want some tiling in OB.

<keybind key="W-Left">
    <action name="MoveResizeTo">
        <x>0</x>
        <y>-0</y>
        <width>835</width>
        <height>995</height>
    </action>
</keybind>
<keybind key="W-Right">
    <action name="MoveResizeTo">
        <x>-0</x>
        <y>-0</y>
        <width>835</width>
        <height>995</height>
    </action>
</keybind>

Offline

#9 2010-03-26 21:01:28

Wintervenom
Member
Registered: 2008-08-20
Posts: 1,011

Re: [Openbox] Hacks and Configs Thread!

xd-0 wrote:

Secondly I have w+right w+left set to move and resize the active window to half the screen (left or right). This works nice with my resolution 1680x1050 and 28px high tint2 panel, and leaves a little space. It's a nice workaround if you want some tiling in OB.

Pure awesomeness!  I borrowed this and added:

<keybind key="W-h">
      <action name="DirectionalFocusWest">
        <raise>yes</raise>
        <dialog>yes</dialog>
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>
    <keybind key="W-l">
      <action name="DirectionalFocusEast">
        <raise>yes</raise>
        <dialog>yes</dialog>
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>
    <keybind key="W-k">
      <action name="DirectionalFocusNorth">
        <raise>yes</raise>
        <dialog>yes</dialog>
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>
    <keybind key="W-j">
      <action name="DirectionalFocusSouth">
        <raise>yes</raise>
        <dialog>yes</dialog>
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>
<!-- Window pseudotiling -->
    <keybind key="W-S-h">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>0</x>
        <y>0</y>
        <width>636</width>
        <height>778</height>
      </action>
    </keybind>
    <keybind key="W-S-l">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>-0</x>
        <y>0</y>
        <width>636</width>
        <height>778</height>
      </action>
    </keybind>
    <keybind key="W-S-k">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>-0</x>
        <y>0</y>
        <width>1280</width>
        <height>379</height>
      </action>
    </keybind>
    <keybind key="W-S-j">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>-0</x>
        <y>-0</y>
        <width>1280</width>
        <height>379</height>
      </action>
    </keybind>

Now, if only windows could be swapped... tongue

Last edited by Wintervenom (2010-03-26 21:02:00)

Offline

#10 2010-03-27 07:09:28

Sarai
Member
From: Alaska
Registered: 2010-02-20
Posts: 62

Re: [Openbox] Hacks and Configs Thread!

My favorite key bindings, in no particular order...

Controlling mpd:

<keybind key="W-Left">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>lastsong</name>
        </startupnotify>
        <command>mpc prev</command>
      </action>
    </keybind>
    <keybind key="W-Right">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>nextsong</name>
        </startupnotify>
        <command>mpc next</command>
      </action>
    </keybind>
    <keybind key="W-Return">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>playorpausesong</name>
        </startupnotify>
        <command>mpc toggle</command>
      </action>
    </keybind>

Controlling windows:

<keybind key="A-BackSpace">
      <action name="Close"/>
    </keybind>
    <keybind key="A-Down">
      <action name="Iconify"/>
    </keybind>
    <keybind key="A-Up">
      <action name="ToggleMaximizeFull"/>
    </keybind>
    <keybind key="A-Right">
      <action name="NextWindow"/>
    </keybind>
    <keybind key="A-Left">
      <action name="PreviousWindow"/>
    </keybind>
    <keybind key="A-space">
      <action name="ShowMenu">
        <menu>client-menu</menu>
      </action>
    </keybind>

In quicker to read terms, those are...

Mpd controls
Super-Right : next song
Super-Left: previous song
Super-Enter: toggle pause/play

Window controls
Alt-Bkspace : exit focused window
Alt-Down : minimize focused window
Alt-Up : maximize focused window
Alt-Right/Left : brings up the osd with a window list that can be scrolled through
Alt-Space : right click menu, anywhere!

Of course, I have a ton load of others too, for launching applications, suspending, rebooting, making toast, etc. I am unabashedly in love with keybindings, they speed up my workflow to the point where I do stuff faster than I can think about it. This leads to the wrong window getting closed, stuff getting written in the wrong text box, etc, but I don't even care.

Offline

#11 2010-03-27 08:33:20

tawan
Member
Registered: 2010-03-02
Posts: 290
Website

Re: [Openbox] Hacks and Configs Thread!

^ nice idea to summarize the code hilights like you did there smile . It is not so useful when people post whole rc's expecting us to read it.

Offline

#12 2010-03-27 08:58:58

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

Re: [Openbox] Hacks and Configs Thread!

Wintervenom wrote:
xd-0 wrote:

Secondly I have w+right w+left set to move and resize the active window to half the screen (left or right). This works nice with my resolution 1680x1050 and 28px high tint2 panel, and leaves a little space. It's a nice workaround if you want some tiling in OB.

Pure awesomeness!  I borrowed this and added:

<keybind key="W-h">
      <action name="DirectionalFocusWest">
        <raise>yes</raise>
        <dialog>yes</dialog>
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>
    <keybind key="W-l">
      <action name="DirectionalFocusEast">
        <raise>yes</raise>
        <dialog>yes</dialog>
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>
    <keybind key="W-k">
      <action name="DirectionalFocusNorth">
        <raise>yes</raise>
        <dialog>yes</dialog>
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>
    <keybind key="W-j">
      <action name="DirectionalFocusSouth">
        <raise>yes</raise>
        <dialog>yes</dialog>
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>
<!-- Window pseudotiling -->
    <keybind key="W-S-h">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>0</x>
        <y>0</y>
        <width>636</width>
        <height>778</height>
      </action>
    </keybind>
    <keybind key="W-S-l">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>-0</x>
        <y>0</y>
        <width>636</width>
        <height>778</height>
      </action>
    </keybind>
    <keybind key="W-S-k">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>-0</x>
        <y>0</y>
        <width>1280</width>
        <height>379</height>
      </action>
    </keybind>
    <keybind key="W-S-j">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>-0</x>
        <y>-0</y>
        <width>1280</width>
        <height>379</height>
      </action>
    </keybind>

Now, if only windows could be swapped... tongue

Ok, this looks extremely cool.
Can you please explain the use of these keybinds?
As far as I see, with Win+h,j,k,l you move between windows (like in wmii) but I didn't completely get what do you do with Shift+Win+h,j,k,l.
Thanks!


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

#13 2010-03-27 19:35:07

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: [Openbox] Hacks and Configs Thread!

Ok, I'll share mine:

<keybind key="W-F1">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>-0</x>
        <y>0</y>
        <width>1200</width>
        <height>360</height>
      </action>
      <action name="GrowToEdgeWest"/>
    </keybind>
    <keybind key="W-F2">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>-0</x>
        <y>-0</y>
        <width>1200</width>
        <height>360</height>
      </action>
      <action name="GrowToEdgeWest"/>
    </keybind>
    <keybind key="W-F3">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>0</x>
        <y>0</y>
        <width>637</width>
        <height>700</height>
      </action>
      <action name="GrowToEdgeSouth"/>
    </keybind>
    <keybind key="W-F4">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>-0</x>
        <y>0</y>
        <width>637</width>
        <height>700</height>
      </action>
      <action name="GrowToEdgeSouth"/>
    </keybind>
    <keybind key="W-S-F1">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>0</x>
        <y>0</y>
        <width>637</width>
        <height>360</height>
      </action>
    </keybind>
    <keybind key="W-S-F2">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>-0</x>
        <y>0</y>
        <width>637</width>
        <height>360</height>
      </action>
    </keybind>
    <keybind key="W-S-F3">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>0</x>
        <y>-0</y>
        <width>637</width>
        <height>360</height>
      </action>
    </keybind>
    <keybind key="W-S-F4">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>-0</x>
        <y>-0</y>
        <width>637</width>
        <height>360</height>
      </action>
    </keybind>
<keybind key="W-Q">
      <action name="MoveResizeTo">
        <x>center</x>
        <y>center</y>
        <width>840</width>
        <height>640</height>
      </action>
    </keybind>

W-F1 - Window covers the upper half of the screen (horizontal)
W-F2 - Window covers the lower half of the screen (horizontal)
W-F3 - Window covers the left half of the screen (vertical)
W-F4 - Window covers the right half of the screen (vertical)

W-S-F1 - Window covers the upper left corner of the screen
W-S-F2 - Window covers the upper right corner of the screen
W-S-F3 - Window covers the lower left corner of the screen
W-S-F4 - Window covers the lower right corner of the screen

W-Q - Window resized to 840x640 and centered on screen

These cover the basic, most often used window sizes and positions in most tiling algorithms.
The config above is for 1280x800 resolution.

Last edited by moljac024 (2010-03-27 19:35:48)


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#14 2010-03-27 20:07:44

Roline
Member
From: Netherlands
Registered: 2009-12-05
Posts: 207
Website

Re: [Openbox] Hacks and Configs Thread!

moljac024 wrote:

Ok, I'll share mine:
...
These cover the basic, most often used window sizes and positions in most tiling algorithms.
The config above is for 1280x800 resolution.

Thanks!


Bitbucket - DeviantART - Userstyles
*Currently Not Using Arch

Offline

#15 2010-03-27 20:58:07

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

Re: [Openbox] Hacks and Configs Thread!

I happened to bind 105 keys to actions and most used application. At least this is what a
grep "keybind key" .config/openbox/rc.xml | wc -l
tells. This allows me to almost exclusively use the keyboard for daily work (if I want to).

Among them these bindings these may be interesting.

Openbox Control

    <!-- Show Openbox Menu -->

    <keybind key="C-W-k">
      <action name="ShowMenu">
        <menu>root-menu</menu>
      </action>
    </keybind>

    <!-- Show Desktop Menu -->

    <keybind key="W-S-k">
      <action name="ShowMenu">
        <menu>client-list-combined-menu</menu>
      </action>
    </keybind>

Desktop Control

    <!-- Keybindings for desktop switching -->

    <keybind key="W-C-A-Left">
      <action name="DesktopLeft">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>

    <keybind key="W-C-A-Right">
      <action name="DesktopRight">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>

    <keybind key="W-C-A-Up">
      <action name="DesktopUp">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>

    <keybind key="W-C-A-Down">
      <action name="DesktopDown">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>

    <keybind key="W-S-A-Left">
      <action name="SendToDesktopLeft">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>

    <keybind key="W-S-A-Right">
      <action name="SendToDesktopRight">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>

    <keybind key="W-S-A-Up">
      <action name="SendToDesktopUp">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>

    <keybind key="W-S-A-Down">
      <action name="SendToDesktopDown">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>

    <keybind key="W-A-F1">
      <action name="Desktop">
        <desktop>1</desktop>
      </action>
    </keybind>

    <keybind key="W-A-F2">
      <action name="Desktop">
        <desktop>2</desktop>
      </action>
    </keybind>

    <keybind key="W-A-F3">
      <action name="Desktop">
        <desktop>3</desktop>
      </action>
    </keybind>

    <keybind key="W-A-F4">
      <action name="Desktop">
        <desktop>4</desktop>
      </action>
    </keybind>

    <keybind key="W-d">
      <action name="ToggleShowDesktop"/>
    </keybind>

Windows Positioning and Select

    <!-- Keybindings to move windows to edges -->

    <keybind key="W-Up">
      <action name="MoveToEdgeNorth"/>
    </keybind>

    <keybind key="W-Down">
      <action name="MoveToEdgeSouth"/>
    </keybind>

    <keybind key="W-Left">
      <action name="MoveToEdgeWest"/>
    </keybind>

    <keybind key="W-Right">
      <action name="MoveToEdgeEast"/>
    </keybind>

    <keybind key="W-Home">
      <action name="MoveToCenter"/>
    </keybind>

    <!-- Keybindings to grow a window to edges -->

    <keybind key="W-C-Up">
      <action name="GrowToEdgeNorth"/>
    </keybind>

    <keybind key="W-C-Down">
      <action name="GrowToEdgeSouth"/>
    </keybind>

    <keybind key="W-C-Left">
      <action name="GrowToEdgeWest"/>
    </keybind>

    <keybind key="W-C-Right">
      <action name="GrowToEdgeEast"/>
    </keybind>

    <!-- Keybindings to directionally focus a window -->
    <!-- (Thanks to rent0n!) -->

    <keybind key="W-A-Up">
      <action name="DirectionalFocusNorth">
        <raise>yes</raise>
        <dialog>yes</dialog>
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>

    <keybind key="W-A-Down">
      <action name="DirectionalFocusSouth">
        <raise>yes</raise>
        <dialog>yes</dialog>
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>

    <keybind key="W-A-Left">
      <action name="DirectionalFocusWest">
        <raise>yes</raise>
        <dialog>yes</dialog>
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>

    <keybind key="W-A-Right">
      <action name="DirectionalFocusEast">
        <raise>yes</raise>
        <dialog>yes</dialog>
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>

    <!-- Keybindings for window switching -->

    <keybind key="W-Tab">
      <action name="NextWindow"/>
    </keybind>
    <keybind key="W-S-Tab">
      <action name="PreviousWindow"/>
    </keybind>

    <keybind key="C-W-Tab">
      <action name="NextWindow">
        <panels>yes</panels>
        <desktop>yes</desktop>
      </action>
    </keybind>

Other Windows Control

    <!-- Keybindings for windows control -->

    <keybind key="W-F4">
      <action name="Close"/>
    </keybind>

    <keybind key="W-A-Escape">
      <action name="Lower"/>
      <action name="FocusToBottom"/>
      <action name="Unfocus"/>
    </keybind>

    <keybind key="W-A-space">
      <action name="ShowMenu">
        <menu>client-menu</menu>
      </action>
    </keybind>

    <keybind key="W-0">
      <action name="ToggleDecorations"/>
    </keybind>

    <keybind key="W-9">
      <action name="ToggleMaximizeFull"/>
    </keybind>

    <keybind key="W-8">
      <action name="Iconify"/>
    </keybind>

Additionally I defined two standard window sizes, a small (according to a urxvt 80x24 lines, DejaVu Sans Mono 11 pt.) and a medium-sized one (ditto, 88x39 lines) which can be arranged to completely fill my screen area, thus easily fitting for a pseudo-tiled display.

Last edited by bernarcher (2010-03-27 21:09:35)


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

Offline

#16 2010-03-27 21:17:22

evot
Member
From: Finland
Registered: 2010-02-26
Posts: 96

Re: [Openbox] Hacks and Configs Thread!

I'm quite new with my openbox configurations.
It is very helpful to have thread like this. smile

btw. MoveToEdge and GrowToEdge are very useful.

Offline

#17 2010-03-28 02:02:24

Wintervenom
Member
Registered: 2008-08-20
Posts: 1,011

Re: [Openbox] Hacks and Configs Thread!

rent0n wrote:

Ok, this looks extremely cool.
Can you please explain the use of these keybinds?
As far as I see, with Win+h,j,k,l you move between windows (like in wmii) but I didn't completely get what do you do with Shift+Win+h,j,k,l.
Thanks!

Moves and resizes the window to the west, south, north, or west half of the screen, respectively.

Last edited by Wintervenom (2010-03-28 02:03:08)

Offline

#18 2010-03-28 08:45:29

Larsson
Member
From: Sweden
Registered: 2010-03-22
Posts: 156

Re: [Openbox] Hacks and Configs Thread!

Wintervenom wrote:

Pure awesomeness!  I borrowed this and added:

Thank you smile was worried a while when I did'nt get any response on this since there are so many that want some kind of tiling. I was thinking that using this keybinding also could launch a script that changes the window id and stores it in a file. Then it would be as simple as to swap the position of the window ids. I think Openbox might be able to handle this but I have'nt tried yet.

ps. I changed username since the last time. previous xd-0. Sorry for the confusion.


"If the person you are talking to doesn't appear to be listening, be patient. It may simply be that he has a small piece of fluff in his ear." - A.A. Milne (Winnie-the-Pooh)

Offline

#19 2010-03-28 17:51:15

Wintervenom
Member
Registered: 2008-08-20
Posts: 1,011

Re: [Openbox] Hacks and Configs Thread!

Larsson wrote:
Wintervenom wrote:

Pure awesomeness!  I borrowed this and added:

Thank you smile was worried a while when I did'nt get any response on this since there are so many that want some kind of tiling. I was thinking that using this keybinding also could launch a script that changes the window id and stores it in a file. Then it would be as simple as to swap the position of the window ids. I think Openbox might be able to handle this but I have'nt tried yet.

ps. I changed username since the last time. previous xd-0. Sorry for the confusion.

Maybe wmctrl can help here.

Offline

#20 2010-04-05 09:19:02

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

Re: [Openbox] Hacks and Configs Thread!

Just changed a bit my keybindings so I will post it here again with easy to read comments.

General
Win+Tab: switch to next desktop (I only use 2 desktops)
Win+Shift+Tab: move window to next desktop, without switching desktop
Win+Space: show/hide desktop
Win+Enter: show menu
Win+Shift+Enter: show obm-xdg menu
Win+Menu: show current window menu
Win+Esc: lock screen
Win+Backspace: exit openbox
Alt+F2: run
Alt+F4: close window
Alt+F5: xkill
Alt+F10: reconfigure openbox
Alt+F11: restart openbox
Alt+F12: exit openbox

Starting Applications:
Win+r: run (gmrun)
Win+t: terminal (terminal)
Win+Shift+t: terminal with tmux
Win+e: editor (mousepad)
Win+f: file manager (thunar)
Win+b: browser (firefox)
Win+m: mail (thunderbird)
Win+c: calculator (gcalctool)
Win+p: player (gnome-mplayer)
Win+s: sonata
Win+d: pidgin
Win+a: abiword
Win+n: gnumeric
Win+w: openoffice writer
Win+l: openoffice calc
Win+i: openoffice impress
Win+g: gimp
Win+k: inkscape
Win+y: geany
Win+o: orage
Print: scrot takes screenshot of desktop after 5 seconds
Shift+Print: scrot takes screenshots of current window or selection.

Managing Windows
Win+Alt+Up: maximize/unmazimize window
Win+Alt+Down: iconify window
Win+Alt+Left: previous window
Win+Alt+Right: next window
Win+Alt+End: close window
Ctrl+Win+Up: grow window to north edge
Ctrl+Win+Down: grow window to south edge
Ctrl+Win+Left: grow window to west edge
Ctrl+Win+Right: move window to east edge
Ctrl+Win+Alt+Up: move window to north edge
Ctrl+Win+Alt+Down: move window to south edge
Ctrl+Win+Alt+Left: move window to west edge
Ctrl+Win+Alt+Right: move window to east edge

Special keys
very predictable, see rc.xml.



Here is my rc.xml:

  <keyboard>
    <chainQuitKey>C-g</chainQuitKey>
    <!-- Keybindings for desktop switching -->
    <keybind key="W-Tab">
      <action name="DesktopNext">
      </action>
    </keybind>
    <keybind key="W-S-Tab">
      <action name="SendToDesktopNext">
        <follow>no</follow>
      </action>
    </keybind>
    <keybind key="W-space">
      <action name="ToggleShowDesktop"/>
    </keybind>
    <!-- Keybindings for windows -->
    <keybind key="W-Return">
      <action name="ShowMenu">
        <menu>root-menu</menu>
      </action>
    </keybind>
    <keybind key="S-W-Return">
      <action name="ShowMenu">
        <menu>obm-xdg-menu</menu>
      </action>
    </keybind>
    <keybind key="A-F2">
      <action name="Execute">
        <command>gmrun</command>
      </action>
    </keybind>
    <keybind key="A-F4">
      <action name="Close"/>
    </keybind>
    <keybind key="A-F5">
      <action name="Execute">
        <command>xkill</command>
      </action>
    </keybind>
    <keybind key="A-F10">
      <action name="Reconfigure"/>
    </keybind>
    <keybind key="A-F11">
      <action name="Restart"/>
    </keybind>
    <keybind key="A-F12">
      <action name="Exit"/>
      <prompt>no</prompt>
    </keybind>
    <keybind key="W-BackSpace">
      <action name="Exit"/>
      <prompt>yes</prompt>
    </keybind>
    <keybind key="W-Escape">
      <action name="Execute">
        <command>xscreensaver-command --lock</command>
      </action>
    </keybind>
    <keybind key="W-r">
      <action name="Execute">
        <command>gmrun</command>
      </action>
    </keybind>
    <keybind key="W-t">
      <action name="Execute">
        <command>terminal</command>
      </action>
    </keybind>
    <keybind key="W-S-t">
      <action name="Execute">
        <command>terminal -e tmux</command>
      </action>
    </keybind>
    <keybind key="W-f">
      <action name="Execute">
        <command>thunar</command>
      </action>
    </keybind>
    <keybind key="W-e">
      <action name="Execute">
        <command>mousepad</command>
      </action>
    </keybind>
    <keybind key="W-b">
      <action name="Execute">
        <command>firefox</command>
      </action>
    </keybind>
    <keybind key="W-m">
      <action name="Execute">
        <command>thunderbird</command>
      </action>
    </keybind>
    <keybind key="W-d">
      <action name="Execute">
        <command>pidgin</command>
      </action>
    </keybind>
    <keybind key="W-i">
      <action name="Execute">
        <command>soffice -impress</command>
      </action>
    </keybind>
    <keybind key="W-g">
      <action name="Execute">
        <command>gimp</command>
      </action>
    </keybind>
    <keybind key="W-c">
      <action name="Execute">
        <command>gcalctool</command>
      </action>
    </keybind>
    <keybind key="W-a">
      <action name="Execute">
        <command>abiword</command>
      </action>
    </keybind>
    <keybind key="W-n">
      <action name="Execute">
        <command>gnumeric</command>
      </action>
    </keybind>
    <keybind key="W-k">
      <action name="Execute">
        <command>inkscape</command>
      </action>
    </keybind>
    <keybind key="W-w">
      <action name="Execute">
        <command>soffice -writer</command>
      </action>
    </keybind>
    <keybind key="W-l">
      <action name="Execute">
        <command>soffice -calc</command>
      </action>
    </keybind>
    <keybind key="W-y">
      <action name="Execute">
        <command>geany</command>
      </action>
    </keybind>
    <keybind key="W-p">
      <action name="Execute">
        <command>gnome-mplayer-caffeine</command>
      </action>
    </keybind>
    <keybind key="W-s">
      <action name="Execute">
        <command>sonata</command>
      </action>
    </keybind>
    <keybind key="W-o">
      <action name="Execute">
        <command>orage</command>
      </action>
    </keybind>
    <keybind key="Print">
      <action name="Execute">
        <command>scrot -cd 5 /home/enrico/Desktop/screenshot_%d_%m_%y_%H_%M_%S.png</command>
      </action>
    </keybind>
    <keybind key="S-Print">
      <action name="Execute">
        <command>scrot -bs /home/enrico/Desktop/screenshot_%d_%m_%y_%H_%M_%S.png</command>
      </action>
    </keybind>
    <keybind key="XF86HomePage">
      <action name="Execute">
        <command>firefox</command>
      </action>
    </keybind>
    <keybind key="XF86Bluetooth">
      <action name="Execute">
        <command>pidgin</command>
      </action>
    </keybind>
    <keybind key="XF86Mail">
      <action name="Execute">
        <command>thunderbird</command>
      </action>
    </keybind>
    <keybind key="XF86Launch1">
      <action name="Execute">
        <command>sonata</command>
      </action>
    </keybind>
    <keybind key="XF86AudioRaiseVolume">
      <action name="Execute">
        <command>/home/enrico/.scripts/VolumeNotify.sh up</command>
      </action>
    </keybind>
    <keybind key="XF86AudioLowerVolume">
      <action name="Execute">
        <command>/home/enrico/.scripts/VolumeNotify.sh down</command>
      </action>
    </keybind>
    <keybind key="XF86AudioMute">
      <action name="Execute">
        <command>/home/enrico/.scripts/VolumeNotify.sh toggle</command>
      </action>
    </keybind>
    <keybind key="W-Menu">
      <action name="ShowMenu">
        <menu>client-menu</menu>
      </action>
    </keybind>
    <keybind key="W-A-Right">
      <action name="NextWindow"/>
    </keybind>
    <keybind key="W-A-Left">
      <action name="PreviousWindow"/>
    </keybind>
    <keybind key="W-A-Up">
      <action name="ToggleMaximizeFull"/>
    </keybind>
    <keybind key="W-A-Down">
      <action name="Iconify"/>
    </keybind>
    <keybind key="W-A-End">
      <action name="Close"/>
    </keybind>
    <keybind key="W-C-Right">
      <action name="GrowToEdgeEast"/>
    </keybind>
    <keybind key="W-C-Left">
      <action name="GrowToEdgeWest"/>
    </keybind>
    <keybind key="W-C-Up">
      <action name="GrowToEdgeNorth"/>
    </keybind>
    <keybind key="W-C-Down">
      <action name="GrowToEdgeSouth"/>
    </keybind>
    <keybind key="W-C-A-Right">
      <action name="MoveToEdgeEast"/>
    </keybind>
    <keybind key="W-C-A-Left">
      <action name="MoveToEdgeWest"/>
    </keybind>
    <keybind key="W-C-A-Up">
      <action name="MoveToEdgeNorth"/>
    </keybind>
    <keybind key="W-C-A-Down">
      <action name="MoveToEdgeSouth"/>
    </keybind>
  </keyboard>

Cheers,

Last edited by rent0n (2010-04-05 09:27:31)


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

#21 2010-04-05 11:28:11

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

Re: [Openbox] Hacks and Configs Thread!

@rent0n
This looks good.
I immediately stole your Print key scrot bindings. This Print key binding was something I couldn't figure out yet.
Thanks! big_smile


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

Offline

#22 2010-04-05 12:18:47

Möller
Member
Registered: 2009-11-19
Posts: 16

Re: [Openbox] Hacks and Configs Thread!

    
<keybind key="Menu">
 <action name="ShowMenu">
  <menu>root-menu</menu>
 </action>
</keybind>

I never use the menubutton otherwise, so it feels great finally having a use for it!

Offline

#23 2010-04-05 17:09:46

Andrwe
Member
From: Leipzig/Germany
Registered: 2009-06-17
Posts: 322
Website

Re: [Openbox] Hacks and Configs Thread!

I don't have any special key bindings that is why I'm posting my application settings:
class="?*": All applications not set up otherwise are centered on the first monitor
name="urxvtq1": first urxvtq (kuake-like urxvt) is maximized horizontally starting at y=0, set on all desktops, above all other apps and not shown in taskbar and pager
name="urxvtq2": second urxvtq is maximized horizontally starting at y=700, set on all desktops, above all other apps and not shown in taskbar and pager
name="irssi": irssi is maximized on second monitor without decoration on all desktops
class="Midori": browser is started maximized at first desktop
class="Claws-mail": mail-client is started maximized at second desktop
class="Oblogout": shown on all desktops
class="Conky": conky with system values is started above all other on second monitor

  <applications>
    <application class="?*">
      <position force="no">
        <x>center</x>
        <y>center</y>
        <monitor>1</monitor>
      </position>
    </application>
    <application name="urxvtq1">
      <decor>no</decor>
      <position force="yes">
        <x>center</x>
        <y>0</y>
        <monitor>1</monitor>
      </position>
      <desktop>all</desktop>
      <layer>above</layer>
      <skip_pager>yes</skip_pager>
      <skip_taskbar>yes</skip_taskbar>
      <maximized>Horizontal</maximized>
    </application>
    <application name="urxvtq2">
      <decor>no</decor>
      <position force="yes">
        <x>center</x>
        <y>700</y>
        <monitor>1</monitor>
      </position>
      <desktop>all</desktop>
      <layer>above</layer>
      <skip_pager>yes</skip_pager>
      <skip_taskbar>yes</skip_taskbar>
      <maximized>Horizontal</maximized>
    </application>
    <application name="irssi">
      <decor>no</decor>
      <position force="yes">
        <x>center</x>
        <y>center</y>
        <monitor>2</monitor>
      </position>
      <desktop>all</desktop>
      <skip_taskbar>yes</skip_taskbar>
      <maximized>yes</maximized>
    </application>
    <application class="Midori">
      <decor>no</decor>
      <position force="yes">
        <x>center</x>
        <y>center</y>
        <monitor>1</monitor>
      </position>
      <desktop>1</desktop>
      <maximized>yes</maximized>
    </application>
    <application class="Claws-mail">
      <decor>no</decor>
      <desktop>2</desktop>
      <maximized>yes</maximized>
    </application>
    <application class="Oblogout">
      <decor>no</decor>
      <position force="yes">
        <x>center</x>
        <y>center</y>
        <monitor>1</monitor>
      </position>
      <desktop>all</desktop>
      <maximized>yes</maximized>
    </application>
    <application class="Conky">
      <position force="yes">
                <x>center</x>
                <y>1</y>
                <monitor>2</monitor>
      </position>
      <decor>no</decor>
      <layer>above</layer>
      <desktop>all</desktop>
      <skip_taskbar>yes</skip_taskbar>
    </application>
    <application class="Tint2">
      <position force="yes">
        <x>center</x>
        <y>1066</y>
        <monitor>1</monitor>
      </position>
    </application>
  </applications>

Last edited by Andrwe (2010-04-05 17:10:12)

Offline

#24 2010-04-10 18:57:16

Roline
Member
From: Netherlands
Registered: 2009-12-05
Posts: 207
Website

Re: [Openbox] Hacks and Configs Thread!

Here's mine. Nothing fancy, all borrowed stuff, but i'll post it anyway.

Keybindings for printscreens:

    <keybind key="Print">
      <action name="Execute">
        <command>scrot /home/sander/Afbeeldingen/Printscreen/screenshot-%F-%H%M%S.png</command>
      </action>
    </keybind>
    <keybind key="W-Print">
      <action name="Execute">
        <command>scrot -d 5 /home/sander/Afbeeldingen/Printscreen/screenshot-%F-%H%M%S.png</command>
      </action>
    </keybind>
    <keybind key="S-Print">
      <action name="Execute">
        <command>scrot -bs /home/sander/Afbeeldingen/Printscreen/screenshot-%F-%H%M%S.png</command>
      </action>
    </keybind>

Keybindings for Openbox:

    <keybind key="A-F2">
      <action name="execute">
        <execute>/home/sander/.scripts/OBDmenu.sh</execute>
      </action>
    </keybind>
    <keybind key="A-F3">
       <action name="ToggleDockAutohide"/>
     </keybind>
    <keybind key="A-F4">
      <action name="Close"/>
    </keybind>
    <keybind key="A-F5">
      <action name="Execute">
        <command>xkill</command>
      </action>
    </keybind>
    <keybind key="A-F10">
      <action name="Reconfigure"/>
    </keybind>
    <keybind key="A-F11">
      <action name="Restart"/>
    </keybind>
    <keybind key="A-F12">
      <action name="Exit"/>
      <prompt>yes</prompt>
    </keybind>
    <keybind key="Menu">
      <action name="ShowMenu">
        <menu>root-menu</menu>
      </action>
    </keybind>
    <keybind key="A-Menu">
      <action name="ShowMenu">
        <menu>client-list-combined-menu</menu>
      </action>
    </keybind>
    <keybind key="C-Menu">
      <action name="ShowMenu">
        <menu>client-send-to-menu</menu>
      </action>
    </keybind>
    <keybind key="Help">
      <action name="execute">
        <execute>/home/sander/.scripts/conky_help</execute>
      </action>
    </keybind>
    <chainQuitKey>C-g</chainQuitKey>

Keybindings for desktop switching:

    <keybind key="C-A-Left">
      <action name="DesktopLeft">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="C-A-Right">
      <action name="DesktopRight">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="W-A-Left">
      <action name="SendToDesktopLeft">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>
    <keybind key="W-A-Right">
      <action name="SendToDesktopRight">
        <dialog>no</dialog>
        <wrap>no</wrap>
      </action>
    </keybind>

Keybindings for window switching:

    <keybind key="W-BackSpace">
      <action name="Iconify"/>
    </keybind>
    <keybind key="W-Tab">
      <action name="NextWindow">
        <dialog>no</dialog>
        <bar>yes</bar>
        <raise>yes</raise>
      </action>
    </keybind>
    <keybind key="A-Tab">
      <action name="NextWindow"/>
    </keybind>
    <keybind key="A-S-Tab">
      <action name="PreviousWindow"/>
    </keybind>

Keybindings for Tiling:

    <keybind key="W-Up">
      <action name="MoveToEdgeNorth"/>
    </keybind>
    <keybind key="W-Down">
      <action name="MoveToEdgeSouth"/>
    </keybind>
    <keybind key="W-Left">
      <action name="MoveToEdgeWest"/>
    </keybind>
    <keybind key="W-Right">
      <action name="MoveToEdgeEast"/>
    </keybind>
    <keybind key="W-F1">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>center</x>
        <y>center</y>
        <width>311</width>
        <height>746</height>
      </action>
    </keybind>
    <keybind key="W-F2">
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>center</x>
        <y>center</y>
        <width>626</width>
        <height>746</height>
      </action>
    </keybind>
    <keybind key="W-F3">
      <action name="MoveResizeTo">
        <x>center</x>
        <y>center</y>
        <width>941</width>
        <height>746</height>
      </action>
    </keybind>
    <keybind key="W-F4">
      <action name="MoveResizeTo">
        <x>center</x>
        <y>center</y>
        <width>1256</width>
        <height>746</height>
      </action>
    </keybind>
    <keybind key="W-F5">
      <action name="MoveResizeTo">
        <x>center</x>
        <y>center</y>
        <width>626</width>
        <height>364</height>
      </action>
    </keybind>
    <keybind key="W-F6">
      <action name="MoveResizeTo">
        <x>center</x>
        <y>center</y>
        <width>1256</width>
        <height>364</height>
      </action>
    </keybind>

Keybindings for applications:

    <keybind key="W-a">
      <action name="Execute">
        <command>sunbird</command>
      </action>
    </keybind>
    <keybind key="W-b">
      <action name="Execute">
        <command>firefox</command>
      </action>
    </keybind>
    <keybind key="W-c">
      <action name="Execute">
        <command>galculator</command>
      </action>
    </keybind>
    <keybind key="W-d">
      <action name="Execute">
        <command>dropboxd</command>
      </action>
    </keybind>
    <keybind key="W-e">
      <action name="Execute">
        <command>bluefish</command>
      </action>
    </keybind>
    <keybind key="W-f">
      <action name="Execute">
        <command>pcmanfm</command>
      </action>
    </keybind>
    <keybind key="W-g">
      <action name="Execute">
        <command>gimp</command>
      </action>
    </keybind>
    <keybind key="W-h">
      <action name="Execute">
        <command>urxvt -e htop</command>
      </action>
    </keybind>
    <keybind key="W-l">
      <action name="Execute">
        <command>leafpad</command>
      </action>
    </keybind>
    <keybind key="W-m">
      <action name="Execute">
        <command>urxvt -e mc</command>
      </action>
    </keybind>
    <keybind key="W-s">
      <action name="Execute">
        <command>sonata</command>
      </action>
    </keybind>
    <keybind key="W-t">
      <action name="Execute">
        <command>urxvt</command>
      </action>
    </keybind>
    <keybind key="W-w">
      <action name="Execute">
        <command>soffice -writer</command>
      </action>
    </keybind>
    <keybind key="W-1">
      <action name="Execute">
        <command>mpc prev</command>
      </action>
    </keybind>
    <keybind key="W-2">
      <action name="Execute">
        <command>mpc next</command>
      </action>
    </keybind>
    <keybind key="W-3">
      <action name="Execute">
        <command>mpc toggle</command>
      </action>
    </keybind>
    <keybind key="W-4">
      <action name="Execute">
        <command>mpc stop</command>
      </action>
    </keybind>

Applications:

  <applications>
    <application name="claws-mail">
      <desktop>1</desktop>
    </application>
    <application name="sunbird*">
      <desktop>1</desktop>
    </application>
    <application name="firefox*">
      <desktop>1</desktop>
    </application>
    <application name="Conkyvar">
      <desktop>2</desktop>
    </application>
    <application name="sonata">
      <desktop>2</desktop>
      <layer>below</layer>
    </application>
  </applications>

Last edited by Roline (2010-05-07 11:27:25)


Bitbucket - DeviantART - Userstyles
*Currently Not Using Arch

Offline

#25 2010-04-10 20:30:44

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: [Openbox] Hacks and Configs Thread!

You didn't have to post the entire config wink

Offline

Board footer

Powered by FluxBB