summaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
authorben <benjaminfranzke@gmail.com>2010-01-04 20:58:50 +0100
committerben <benjaminfranzke@gmail.com>2010-01-04 20:58:50 +0100
commit280e8ecf8c0c73c37c7b31b3533733532f5d2211 (patch)
tree66f81c26f65423031cd3b04b2d77284038094cde /.config
parentb742096b9d111b7be23fb2bd4726bf71c8972c40 (diff)
downloaddotfiles-280e8ecf8c0c73c37c7b31b3533733532f5d2211.tar.gz
dotfiles-280e8ecf8c0c73c37c7b31b3533733532f5d2211.tar.bz2
dotfiles-280e8ecf8c0c73c37c7b31b3533733532f5d2211.zip
add openbox configuration
Diffstat (limited to '.config')
-rw-r--r--.config/openbox/autostart.sh43
-rw-r--r--.config/openbox/menu.xml129
-rw-r--r--.config/openbox/rc.xml796
-rwxr-xr-x.config/openbox/scripts/ob-mpd.py233
-rwxr-xr-x.config/openbox/scripts/processes.py232
-rwxr-xr-x.config/openbox/scripts/system-info.sh112
-rwxr-xr-x.config/openbox/scripts/wallmenu.py109
-rwxr-xr-x.config/openbox/scripts/xcompmgr.sh94
-rwxr-xr-x.config/openbox/scripts/xdgmenu.php207
9 files changed, 1955 insertions, 0 deletions
diff --git a/.config/openbox/autostart.sh b/.config/openbox/autostart.sh
new file mode 100644
index 0000000..7496c4c
--- /dev/null
+++ b/.config/openbox/autostart.sh
@@ -0,0 +1,43 @@
+# This shell script is run before Openbox launches.
+# Environment variables set here are passed to the Openbox session.
+
+# D-bus
+if which dbus-launch >/dev/null && [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
+ eval `dbus-launch --sh-syntax --exit-with-session`
+fi
+
+#xrandr --output VGA-0 --mode 1280x1024 --rate 60
+# start compositing - shadows and fading
+#xcompmgr -cCfF -t-5 -l-5 -r4.2 -o0.55 -D6 & >> /dev/null 2>&1
+
+# set background
+#eval $(cat ~/.fehbg) &
+nitrogen --restore &
+
+#Force OpenOffice.org to use GTK theme
+export OOO_FORCE_DESKTOP=gnome
+
+~/bin/swIcon.py &
+
+#volwheel &
+#trayer --widthtype request --height 24 --align right --margin 0 --padding 0 \
+# --transparent true --alpha 256 --tint 0xffffff --SetDockType true &
+stalonetray &
+~/voltray.py &
+#volwheel &
+
+# Run XDG autostart things. By default don't run anything desktop-specific
+# See xdg-autostart --help more info
+DESKTOP_ENV=""
+if which /usr/lib64/openbox/xdg-autostart >/dev/null; then
+ /usr/lib64/openbox/xdg-autostart $DESKTOP_ENV &
+fi
+
+# start tray
+#trayer --widthtype request --height 22 \
+# --align right --margin 0 --padding 3 \
+# --transparent true --alpha 128 --tint 0x050505 &
+# start panel
+tint2 &
+urxvtd -q -o -f
+synergys
diff --git a/.config/openbox/menu.xml b/.config/openbox/menu.xml
new file mode 100644
index 0000000..aae7851
--- /dev/null
+++ b/.config/openbox/menu.xml
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<openbox_menu xmlns="http://openbox.org/3.4/menu">
+
+<menu execute="~/.config/openbox/scripts/ob-mpd.py" id="pipe-mpd" label="MPD"/>
+<menu execute="~/.config/openbox/scripts/system-info.sh" id="pipe-system-info" label="System"/>
+<menu execute="~/.config/openbox/scripts/wallmenu.py" id="pipe-feh" label="Feh"/>
+<menu execute="~/.config/openbox/scripts/xcompmgr.sh" id="pipe-composite" label="Compositing" />
+
+<menu id="applications" label="Apps">
+ <separator label="Applications" />
+ <item label="Dateimanager">
+ <action name="Execute">
+ <execute>pcmanfm --no-desktop</execute>
+ </action>
+ </item>
+ <item label="GVim">
+ <action name="Execute">
+ <execute>gvim</execute>
+ </action>
+ </item>
+ <item label="Editor">
+ <action name="Execute">
+ <execute>leafpad</execute>
+ </action>
+ </item>
+ <item label="GIMP">
+ <action name="Execute">
+ <execute>gimp</execute>
+ </action>
+ </item>
+ <item label="Pidgin">
+ <action name="Execute">
+ <execute>pidgin</execute>
+ </action>
+ </item>
+ <item label="Openoffice Word">
+ <action name="Execute">
+ <execute>oowriter</execute>
+ </action>
+ </item>
+</menu>
+
+<menu id="games" label="Games">
+ <separator label="Games" />
+ <item label="Xmoto">
+ <action name="Execute">
+ <execute>xmoto</execute>
+ </action>
+ </item>
+ <item label="Torcs">
+ <action name="Execute">
+ <execute>torcs</execute>
+ </action>
+ </item>
+ <item label="ETRacer">
+ <action name="Execute">
+ <execute>etracer</execute>
+ </action>
+ </item>
+ <item label="Warsow">
+ <action name="Execute">
+ <execute>warsow</execute>
+ </action>
+ </item>
+</menu>
+
+<menu id="openbox" label="Openbox">
+ <separator label="Openbox" />
+ <item label="ObConf">
+ <action name="Execute">
+ <execute>obconf</execute>
+ </action>
+ </item>
+ <item label="Reconfigure">
+ <action name="Reconfigure"/>
+ </item>
+ <item label="ObMenu">
+ <action name="Execute">
+ <execute>obmenu</execute>
+ </action>
+ </item>
+ <item label="Erscheinungsbild">
+ <action name="Execute">
+ <execute>lxappearance</execute>
+ </action>
+ </item>
+ <item label="Background">
+ <action name="Execute">
+ <execute>nitrogen ~/.wallpapers</execute>
+ </action>
+ </item>
+ <!-- <menu id="pipe-feh" /> -->
+ <menu id="pipe-composite" />
+</menu>
+
+<menu id="root-menu" label="Openbox 3">
+ <separator label="ben" />
+ <item label="Internet">
+ <action name="Execute">
+ <execute>firefox</execute>
+ </action>
+ </item>
+ <item label="Music">
+ <action name="Execute">
+ <execute>sonata</execute>
+ </action>
+ </item>
+ <item label="Terminal">
+ <action name="Execute">
+ <execute>urxvtc</execute>
+ </action>
+ </item>
+ <separator />
+ <menu id="applications"/>
+ <menu id="games" />
+ <menu id="openbox"/>
+ <separator />
+ <menu id="pipe-mpd"/>
+ <menu id="pipe-system-info"/>
+ <separator />
+ <item label="Exit">
+ <action name="Exit">
+ <prompt>yes</prompt>
+ </action>
+ </item>
+</menu>
+
+</openbox_menu>
diff --git a/.config/openbox/rc.xml b/.config/openbox/rc.xml
new file mode 100644
index 0000000..fa0d5f5
--- /dev/null
+++ b/.config/openbox/rc.xml
@@ -0,0 +1,796 @@
+<?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>10</strength>
+ <screen_edge_strength>20</screen_edge_strength>
+ </resistance>
+ <focus>
+ <focusNew>yes</focusNew>
+ <!-- always try to focus new windows when they appear. other rules do
+ apply -->
+ <followMouse>no</followMouse>
+ <!-- move focus to a window when you move the mouse into it -->
+ <focusLast>yes</focusLast>
+ <!-- focus the last used window when changing desktops, instead of the one
+ under the mouse pointer. when followMouse is enabled -->
+ <underMouse>no</underMouse>
+ <!-- move focus under the mouse, even when the mouse is not moving -->
+ <focusDelay>200</focusDelay>
+ <!-- when followMouse is enabled, the mouse must be inside the window for
+ this many milliseconds (1000 = 1 sec) before moving focus to it -->
+ <raiseOnFocus>no</raiseOnFocus>
+ <!-- when followMouse is enabled, and a window is given focus by moving the
+ mouse into it, also raise the window -->
+ </focus>
+ <placement>
+ <policy>UnderMouse</policy>
+ <!-- 'Smart' or 'UnderMouse' -->
+ <center>yes</center>
+ <!-- whether to place windows in the center of the free area found or
+ the top left corner -->
+ <monitor>Mouse</monitor>
+ </placement>
+ <theme>
+ <name>Dyne-Dark</name>
+ <titleLayout/>
+ <!--
+ avaible 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>no</animateIconify>
+ <font place="ActiveWindow">
+ <name>DejaVu Sans</name>
+ <size>1</size>
+ <!-- font size in points -->
+ <weight>Normal</weight>
+ <!-- 'bold' or 'normal' -->
+ <slant>Normal</slant>
+ <!-- 'italic' or 'normal' -->
+ </font>
+ <font place="InactiveWindow">
+ <name>DejaVu Sans</name>
+ <size>1</size>
+ <!-- font size in points -->
+ <weight>Normal</weight>
+ <!-- 'bold' or 'normal' -->
+ <slant>Normal</slant>
+ <!-- 'italic' or 'normal' -->
+ </font>
+ <font place="MenuHeader">
+ <name>DejaVu Sans</name>
+ <size>8</size>
+ <!-- font size in points -->
+ <weight>Bold</weight>
+ <!-- 'bold' or 'normal' -->
+ <slant>Normal</slant>
+ <!-- 'italic' or 'normal' -->
+ </font>
+ <font place="MenuItem">
+ <name>DejaVu Sans</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>DejaVu Sans</name>
+ <size>8</size>
+ <!-- font size in points -->
+ <weight>Bold</weight>
+ <!-- 'bold' or 'normal' -->
+ <slant>Normal</slant>
+ <!-- 'italic' or 'normal' -->
+ </font>
+ </theme>
+ <desktops>
+ <!-- this stuff is only used at startup, pagers allow you to change them
+ during a session
+
+ these are default values to use when other ones are not already set
+ by other applications, or saved in your session
+
+ use obconf if you want to change these without having to log out
+ and back in -->
+ <number>4</number>
+ <firstdesk>1</firstdesk>
+ <names>
+ <name>main</name>
+ <name>two</name>
+ <name>three</name>
+ <name>four</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' or 'Top' -->
+ <popupFixedPosition>
+ <x>0</x>
+ <y>0</y>
+ </popupFixedPosition>
+ </resize>
+ <!-- You can reserve a portion of your screen where windows will not cover when
+ they are maximized, or when they are initially placed.
+ Many programs reserve space automatically, but you can use this in other
+ cases. -->
+ <margins>
+ <top>0</top>
+ <bottom>0</bottom>
+ <left>0</left>
+ <right>0</right>
+ </margins>
+ <dock>
+ <position>BottomRight</position>
+ <!-- (Top|Bottom)(Left|Right|)|Top|Bottom|Left|Right|Floating -->
+ <floatingX>0</floatingX>
+ <floatingY>0</floatingY>
+ <noStrut>no</noStrut>
+ <stacking>Normal</stacking>
+ <!-- 'Above', 'Normal', or 'Below' -->
+ <direction>Horizontal</direction>
+ <!-- 'Vertical' or 'Horizontal' -->
+ <autoHide>no</autoHide>
+ <hideDelay>100</hideDelay>
+ <!-- in milliseconds (1000 = 1 second) -->
+ <showDelay>5</showDelay>
+ <!-- in milliseconds (1000 = 1 second) -->
+ <moveButton>Middle</moveButton>
+ <!-- 'Left', 'Middle', 'Right' -->
+ </dock>
+ <keyboard>
+ <chainQuitKey>C-g</chainQuitKey>
+ <!-- Keybindings for desktop switching -->
+ <keybind key="C-A-Left">
+ <action name="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="C-A-Up">
+ <action name="DesktopUp">
+ <dialog>no</dialog>
+ <wrap>no</wrap>
+ </action>
+ </keybind>
+ <keybind key="C-A-Down">
+ <action name="DesktopDown">
+ <dialog>no</dialog>
+ <wrap>no</wrap>
+ </action>
+ </keybind>
+ <keybind key="S-A-Left">
+ <action name="SendToDesktopLeft">
+ <dialog>no</dialog>
+ <wrap>no</wrap>
+ </action>
+ </keybind>
+ <keybind key="S-A-Right">
+ <action name="SendToDesktopRight">
+ <dialog>no</dialog>
+ <wrap>no</wrap>
+ </action>
+ </keybind>
+ <keybind key="S-A-Up">
+ <action name="SendToDesktopUp">
+ <dialog>no</dialog>
+ <wrap>no</wrap>
+ </action>
+ </keybind>
+ <keybind key="S-A-Down">
+ <action name="SendToDesktopDown">
+ <dialog>no</dialog>
+ <wrap>no</wrap>
+ </action>
+ </keybind>
+ <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-d">
+ <action name="ToggleShowDesktop"/>
+ </keybind>
+ <!-- Keybindings for windows -->
+ <keybind key="W-q">
+ <action name="Close"/>
+ </keybind>
+ <keybind key="A-F4">
+ <action name="Close"/>
+ </keybind>
+ <keybind key="A-Escape">
+ <action name="Lower"/>
+ <action name="FocusToBottom"/>
+ <action name="Unfocus"/>
+ </keybind>
+ <keybind key="A-space">
+ <action name="ShowMenu">
+ <menu>client-menu</menu>
+ </action>
+ </keybind>
+ <!-- Keybindings for window switching -->
+ <keybind key="W-Tab">
+ <action name="NextWindow"/>
+ </keybind>
+ <keybind key="W-S-Tab">
+ <action name="PreviousWindow"/>
+ </keybind>
+ <keybind key="A-Tab">
+ <action name="NextWindow"/>
+ </keybind>
+ <keybind key="A-S-Tab">
+ <action name="PreviousWindow"/>
+ </keybind>
+ <keybind key="C-A-Tab">
+ <action name="NextWindow">
+ <panels>yes</panels>
+ <desktop>yes</desktop>
+ </action>
+ </keybind>
+ <!-- Keybindings for running applications -->
+ <keybind key="Print">
+ <action name="Execute">
+ <execute>scrot</execute>
+ </action>
+ </keybind>
+ <keybind key="W-Print">
+ <action name="Execute">
+ <execute>scrot %Y%m%d.png -d 3 -t 280x175</execute>
+ </action>
+ </keybind>
+ <keybind key="C-A-l">
+ <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-f">
+ <action name="Execute">
+ <startupnotify>
+ <enabled>true</enabled>
+ <name>pcmanfm</name>
+ </startupnotify>
+ <command>pcmanfm --no-desktop</command>
+ </action>
+ </keybind>
+ <keybind key="W-w">
+ <action name="Execute">
+ <startupnotify>
+ <enabled>true</enabled>
+ <name>Firefox</name>
+ </startupnotify>
+ <command>firefox</command>
+ </action>
+ </keybind>
+ <keybind key="W-m">
+ <action name="Execute">
+ <command>gnome-mplayer</command>
+ </action>
+ </keybind>
+ <keybind key="W-e">
+ <action name="Execute">
+ <command>urxvtc -e mutt</command>
+ </action>
+ </keybind>
+ <keybind key="W-v">
+ <action name="Execute">
+ <command>urxvtc -e alsamixer</command>
+ </action>
+ </keybind>
+ <keybind key="W-x">
+ <action name="Execute">
+ <command>urxvtc</command>
+ </action>
+ </keybind>
+ <keybind key="W-q">
+ <action name="Reconfigure"/>
+ </keybind>
+ <keybind key="W-S-q">
+ <action name="Exit"/>
+ </keybind>
+ <keybind key="W-S-Delete">
+ <action name="execute">
+ <execute>sudo shutdown -r now</execute>
+ </action>
+ </keybind>
+ <keybind key="W-S-End">
+ <action name="execute">
+ <execute>sudo shutdown -h now</execute>
+ </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>150</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="W-Right" action="Click">
+ <action name="Iconify"/>
+ </mousebind>
+ <mousebind button="W-Middle" action="Click">
+ <action name="Close"/>
+ </mousebind>
+ <mousebind button="W-Left" action="Press">
+ <action name="Focus"/>
+ <action name="Raise"/>
+ </mousebind>
+ <mousebind button="W-Left" action="Click">
+ <action name="Unshade"/>
+ </mousebind>
+ <mousebind button="W-Left" action="Drag">
+ <action name="Move"/>
+ </mousebind>
+ <mousebind button="W-Right" action="Press">
+ <action name="Focus"/>
+ <action name="Raise"/>
+ <action name="Unshade"/>
+ </mousebind>
+ <mousebind button="W-Right" action="Drag">
+ <action name="Resize"/>
+ </mousebind>
+ <mousebind button="W-Middle" action="Press">
+ <action name="Lower"/>
+ <action name="FocusToBottom"/>
+ <action name="Unfocus"/>
+ </mousebind>
+ <mousebind button="W-Up" action="Click">
+ <action name="DesktopPrevious"/>
+ </mousebind>
+ <mousebind button="W-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="W-Middle" action="Press">
+ <action name="Execute">
+ <command>urxvtc</command>
+ </action>
+ </mousebind>
+ <mousebind button="W-Left" action="Press">
+ <action name="Execute">
+ <command>urxvtc</command>
+ </action>
+ </mousebind>
+ <mousebind button="Left" action="Press">
+ <action name="Focus"/>
+ <action name="Raise"/>
+ </mousebind>
+ <!-- moved to Root for xfce -->
+ <mousebind button="Up" action="Click">
+ <action name="DesktopPrevious"/>
+ </mousebind>
+ <mousebind button="Down" action="Click">
+ <action name="DesktopNext"/>
+ </mousebind>
+ <mousebind button="W-Up" action="Click">
+ <action name="DesktopPrevious"/>
+ </mousebind>
+ <mousebind button="W-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>
+ <!-- /move! -->
+ </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="W-Up" action="Click">
+ <action name="DesktopPrevious"/>
+ </mousebind>
+ <mousebind button="W-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>
+ <middle>no</middle>
+ <submenuShowDelay>100</submenuShowDelay>
+ <applicationIcons>yes</applicationIcons>
+ </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="first element of window's WM_CLASS property (see xprop)"
+ class="second element of window's WM_CLASS property (see xprop)"
+ role="the window's WM_WINDOW_ROLE property (see xprop)">
+ # the name or the class can be set, or both. this is used to match
+ # windows when they appear. role can optionally be set as well, to
+ # further 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.
+
+ # when multiple rules match a window, they will all be applied, in the
+ # order that they appear in this list
+
+
+ # each 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>
+ # the position is only used if both an x and y coordinate are provided
+ # (and not set to 'default')
+ <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="tint">
+ <decor>yes</decor>
+ <desktop>all</desktop>
+ <layer>below</layer>
+ <position>
+ <x>center</x>
+ <y>default</y>
+ </position>
+ </application>
+ -->
+ <application class="trayer">
+ <desktop>all</desktop>
+ </application>
+ <application name="stalonetray">
+ <decor>yes</decor>
+ <layer>below</layer>
+ <skip_pager>yes</skip_pager>
+ <skip_taskbar>yes</skip_taskbar>
+ <desktop>all</desktop>
+ <!--<position>
+ <x>-1</x>
+ <y>-1</y>
+ </position>-->
+ </application>
+ </applications>
+</openbox_config>
diff --git a/.config/openbox/scripts/ob-mpd.py b/.config/openbox/scripts/ob-mpd.py
new file mode 100755
index 0000000..0460478
--- /dev/null
+++ b/.config/openbox/scripts/ob-mpd.py
@@ -0,0 +1,233 @@
+#!/usr/bin/env python
+#
+# Author: John Eikenberry <jae@zhar.net>
+# License: GPL 2.0
+#
+# Changelog
+# 2007-09-09 - Fixed compatibility issue with mpdclient2 version 1.0
+# vs. 11.1 which I have (debian).
+# 2007-11-18 - Added playlist load/clear support.
+#
+#
+# This script depends on py-libmpdclient2 which you can get from
+# http://incise.org/index.cgi/py-libmpdclient2
+#
+# Usage:
+# Put an entry in ~/.config/openbox/menu.xml:
+# <menu id="mpd" label="MPD" execute="~/.config/openbox/scripts/ob-mpd.py" />
+#
+# Add the following wherever you'd like it to be displayed in your menu:
+# <menu id="mpd" />
+#
+#
+# Originally Based on code by John McKnight <jmcknight@gmail.com>
+#
+## Main changes from original version:
+#
+# Changed to use libmpdclient2.
+# Refactored/Cleaned up the code.
+# Added random/repeat toggle indicators.
+# Changed Pause/Play so only the appropriate one would show up.
+# Added actions to start and stop mpd daemon.
+# Added exception to deal with no id3 tags.
+# Added volume controls.
+# Added output setting controls.
+# Determine location of script dynamically instead of hardcoded
+
+import os, sys, socket
+import mpdclient2
+
+argv = sys.argv
+
+# The default port for MPD is 6600. If for some reason you have MPD
+# running on a different port, change this setting.
+mpdPort = 6600
+
+# determin path to this file
+my_path = sys.modules[__name__].__file__
+# if this fails for some reason, just set it manually.
+# Eg.
+# my_path = "~/.config/openbox/scripts/ob-mpd.py"
+
+
+separator = "<separator />"
+info = """<item label="%s" />"""
+action = ("""<item label="%s"><action name="Execute">"""
+ """<execute>MY_PATH %s</execute>"""
+ """</action></item>""").replace("MY_PATH",my_path)
+menu = """<menu id="%s" label="%s">"""
+menu_end = """</menu>"""
+
+
+try:
+ connect = mpdclient2.connect(port=mpdPort)
+except socket.error:
+ # If MPD is not running.
+ if len(argv) > 1 and argv[1] == 'start':
+ os.execl('/usr/bin/mpd','$HOME/.mpdconf')
+ else:
+ print ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ "<openbox_pipe_menu>")
+ print action % ('MPD is not running [start]','start')
+ print "</openbox_pipe_menu>"
+
+else: # part of connect try block
+
+ song = connect.currentsong()
+ stats = connect.stats()
+ status = connect.status()
+
+ if status['state'] == "stop":
+ display_state = "Not playing"
+ else:
+ try:
+ display_state = "%s - %s" % (song.artist, song.title)
+ except (AttributeError, KeyError): # no id3 tags
+ display_state = os.path.basename(song.file)
+ if status['state'] == "pause":
+ display_state += " (paused)"
+ display_state = display_state.replace('"',"'")
+ display_state = display_state.replace('&','&amp;')
+
+ if len(argv) > 1:
+
+ state = status.state
+ def play():
+ if state == "stop" or state == "pause":
+ connect.play()
+
+ def pause():
+ if state == "play":
+ connect.pause(1)
+ elif state == "pause":
+ connect.play()
+
+ def stop():
+ if state == "play" or state == "pause":
+ connect.stop()
+
+ def prev():
+ if state == "play":
+ connect.previous()
+
+ def next():
+ if state == "play":
+ connect.next()
+
+ random_state = int(status.random)
+ def random():
+ if random_state:
+ connect.random(0)
+ else:
+ connect.random(1)
+
+ repeat_state = int(status.repeat)
+ def repeat():
+ if repeat_state:
+ connect.repeat(0)
+ else:
+ connect.repeat(1)
+
+ def kill():
+ try:
+ connect.kill()
+ except EOFError:
+ pass
+
+ def update():
+ connect.update()
+
+ def volume(setto):
+ relative = (setto[0] in ['+','-'])
+ setto = int(setto)
+ if relative:
+ newvol = int(status.volume) + setto
+ newvol = newvol <= 100 or 100
+ newvol = newvol >= 0 or 0
+ connect.setvol(setto)
+
+ def client():
+ os.execlp('x-terminal-emulator','-e','ncmpc')
+
+ def enable(output_id):
+ connect.enableoutput(int(output_id))
+
+ def disable(output_id):
+ connect.disableoutput(int(output_id))
+
+ def load(list_name):
+ connect.load(list_name)
+
+ def clear():
+ connect.clear()
+
+ if (argv[1] == "play"): play()
+ elif (argv[1] == "pause"): pause()
+ elif (argv[1] == "stop"): stop()
+ elif (argv[1][:4] == "prev"): prev()
+ elif (argv[1] == "next"): next()
+ elif (argv[1] == "random"): random()
+ elif (argv[1] == "repeat"): repeat()
+ elif (argv[1] == "volume"): volume(argv[2])
+ elif (argv[1] == "client"): client()
+ elif (argv[1] == "kill"): kill()
+ elif (argv[1] == "update"): update()
+ elif (argv[1] == "enable"): enable(argv[2])
+ elif (argv[1] == "disable"): disable(argv[2])
+ elif (argv[1] == "load"): load(argv[2])
+ elif (argv[1] == "clear"): clear()
+
+ else:
+ #
+ print """<?xml version="1.0" encoding="UTF-8"?>"""
+ print """<openbox_pipe_menu>"""
+ print action % (display_state,'client')
+ print separator
+ print action % ('Next','next')
+ print action % ('Previous','prev')
+ if status['state'] in ["pause","stop"]:
+ print action % ('Play','play')
+ if status['state'] == "play":
+ print action % ('Pause','pause')
+ print action % ('Stop','stop')
+ print separator
+ print menu % ("volume","Volume: %s%%" % status.volume)
+ print action % ('[100%]','volume 100')
+ print action % (' [80%]','volume 80')
+ print action % (' [60%]','volume 60')
+ print action % (' [40%]','volume 40')
+ print action % (' [20%]','volume 20')
+ print action % ('[Mute]','volume 0')
+ print menu_end
+ print menu % ("playlist","Playlist")
+ print action % ('clear','clear')
+ print separator
+ for entity in connect.lsinfo():
+ if 'playlist' in entity:
+ playlist = entity['playlist'].replace('&', '&amp;')
+ print action % (playlist, 'load "%s"' % playlist)
+ print menu_end
+ print menu % ("output","Audio Output")
+ for out in connect.outputs():
+ name,oid = out['outputname'],out['outputid']
+ on = int(out['outputenabled'])
+ print action % ("%s [%s]" % (name, on and 'enabled' or 'disabled'),
+ "%s %s" % ((on and 'disable' or 'enable'), oid))
+ print menu_end
+ print separator
+ print action % ('Toggle random %s' % (
+ int(status.random) and '[On]' or '[Off]'), 'random')
+ print action % ('Toggle repeat %s' % (
+ int(status.repeat) and '[On]' or '[Off]'), 'repeat')
+ print separator
+ print action % ('Update Database','update')
+ print action % ('Kill MPD','kill')
+ print "</openbox_pipe_menu>"
+
+# print menu % ("Song Info","Volume: %s%%" % status.volume)
+# print info % ('%s kbs' % status.bitrate)
+# print separator
+# print info % ("Artists in DB: %s" % stats.artists)
+# print info % ("Albums in DB: %s" % stats.albums)
+# print info % ("Songs in DB: %s" % stats.songs)
+
diff --git a/.config/openbox/scripts/processes.py b/.config/openbox/scripts/processes.py
new file mode 100755
index 0000000..ac475bb
--- /dev/null
+++ b/.config/openbox/scripts/processes.py
@@ -0,0 +1,232 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+"""
+#-------------------------------------------------------------------------------
+
+processes.py - version 7
+by Vlad George
+
+#-------------------------------------------------------------------------------
+
+Description:
+ This script pipes a process manipulation menu into the openbox menu.
+
+Usage:
+ Just place this script in ~/.config/openbox/scripts, make it executable; if you want you can enlist the processes
+ which should not be shown in the unwanted_procs list below, then add following to your ~/.config/openbox/menu.xml:
+ "<menu id="proc-menu" label="processes" execute="~/.config/openbox/scripts/processes.py" />...
+ <menu id="root-menu" label="Openbox3">...<menu id="proc-menu" />...</menu>"
+ and reconfigure openbox.
+ To enable cpu usage display uncomment the lines marked with (***) (lines 106-108 and 146).
+ Note: You need 'ps'.
+ To enable cpulimit just uncomment the lines marked with (#*#) (lines 158-169).
+ Note: You need 'cpulimit'. Get it from here: "http://cpulimit.sourceforge.net"
+
+Changelog:
+ 20.02.07: 7th version - added "-z" flag to cpulimit; added ValueError handling for printXml; added --title flag
+ 04.12.07: 6th version - added cpulimit; to enable it just uncomment the lines marked with (#*#)
+ 18.11.07: 5th version - processes alphabetically sorted
+ 22.10.07: 4th version - totally removed SleepAVG from script. for kernels < 2.6.20 please use earlier versions.
+ simplified cpu usage command.
+ 07.07.07: 3rd version - added cpu usage;
+ since SleepAVG was removed from /proc (2.6.20), it will be only displayed depending on running kernel version
+ 17.02.07: 2nd version - shortened procData
+
+#-------------------------------------------------------------------------------
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+http://www.fsf.org/
+
+"""
+
+#-------------------------------------------------------------------------------
+# User set variables
+#-------------------------------------------------------------------------------
+
+## processes (e.g. daemons, bash, this script, etc) you do not want to be shown in the process manipulation menu:
+## !!! don´t forget quotes !!!
+
+## unwanted_procs = ["processes.py","ssh-agent","gconfd-2","dbus-daemon","dbus-launch","kded","dcopserver","..."]
+unwanted_procs = ["processes.py","sh","bash","netstat","ssh-agent","gconfd-2","gnome-pty-helpe","dbus-daemon","dbus-launch",\
+ "visibility","pypanel","knotify","kdeinit","klauncher","kded","dcopserver","kio_file"]
+
+## if you want a title (separator) for the processes menu you can set it here; to show the title use the "--title" flag (/path/to/processes.py --title)
+processes_menu_title = "processes"
+
+
+#-------------------------------------------------------------------------------
+# Script
+#-------------------------------------------------------------------------------
+
+
+def _procName(pid):
+ """ pid -> processname """
+ try:
+ return file(os.path.join('/proc', str(pid), 'status'), 'r').readline().split()[1]
+ except IOError:
+ return None
+
+
+def _procData(pid):
+ """ pid -> info_list = [State, VmSize, VmLck, VmRSS, VmLib, priority(nice), command, cpu usage] """
+ info_list = list()
+
+ ## from /proc/<pid>/status get State, VmSize, VmLck, VmRSS, VmLib
+ status_file = file(os.path.join("/proc", str(pid), "status"), 'r')
+ status = status_file.readlines()
+ status_file.close()
+ [info_list.append(status[i].split(":")[1].lstrip().rstrip("\n")) for i in (1,11,12,14,18)]
+
+ ## from /proc/<pid>/stat get priority(nicelevel)
+ priority_file = file(os.path.join('/proc', str(pid), 'stat'), 'r')
+ priority = priority_file.read()
+ priority_file.close()
+ info_list.append(priority.split()[18])
+
+ ## from /proc/<pid>/cmdline get command
+ cmdline_file = file(os.path.join("/proc", str(pid),"cmdline"),'r')
+ cmdline = cmdline_file.read()
+ cmdline_file.close()
+ info_list.append(" ".join(cmdline.split("\x00")[:-1]))
+
+ ## from "ps --pid %s -o pcpu=" get cpu usage for pid
+ ## (***) comment out following three lines to disable cpu usage display
+ #ps_cpu_for_pid = 'ps --pid %s -o pcpu=' % (pid)
+ #ps_cmd = os.popen(ps_cpu_for_pid).readline()
+ #info_list.append(ps_cmd)
+ ## (***)
+ return info_list
+
+
+def userPidFilter():
+ """ fiters pids from /proc/<pid>/ for user who owns script excluding the unwanted_procs ids """
+ uid = os.stat(sys.argv[0])[4]
+ uid_pids = list()
+ for pid in os.listdir("/proc"):
+ if os.path.isdir(os.path.join("/proc", pid)):
+ try:
+ if os.stat(os.path.join("/proc", pid))[4] == uid :
+ uid_pids.append(int(pid))
+ except ValueError:
+ pass
+
+ ## sort pids according to process names
+ pid_proc_list = list()
+ [pid_proc_list.append((i, _procName(i))) for i in uid_pids]
+
+ def removeProcsFromList(pid):
+ process = _procName(pid)
+ if process in unwanted_procs:
+ pid_proc_list.remove((pid, process))
+ map(removeProcsFromList, uid_pids)
+
+ pid_proc_list.sort(key = lambda t:t[1].lower())
+ return [pid_proc_list[i][0] for i in xrange(len(pid_proc_list))]
+
+
+def printXml(pid):
+ """ xml output for each pid
+ _procData(pid)=[[0]-State, [1]-VmSize, [2]-VmLck, [3]-VmRSS, [4]-VmLib, [5]-priority(nice), [6]-command, [(***)optional: [7]-cpu usage]] """
+
+ proc_info = _procData(pid)
+
+## (***) uncomment following line to enable cpu usage display:
+ #print '<item label="cpu usage: %s' % (proc_info[7]) + ' %"><action name="execute"><command>true</command></action></item>'
+## (***)
+ print '<menu id="%s-menu-memory" label="memory: %s MB">' % (pid, int(proc_info[1].split()[0])/1024)
+ print '<item label="Ram: %s"><action name="Execute"><command>true</command></action></item>' % (proc_info[3])
+ print '<item label="Lib: %s"><action name="Execute"><command>true</command></action></item>' % (proc_info[4])
+ print '<item label="Lock: %s"><action name="Execute"><command>true</command></action></item>' % (proc_info[2])
+ print '<item label="Total: %s"><action name="Execute"><command>true</command></action></item>' % (proc_info[1])
+ print '</menu>'
+
+ print '<separator />'
+
+## (#*#) uncomment following lines to enable cpulimit:
+ #print '<menu id="%s-menu-cpulimit" label="cpulimit">' % (pid)
+ #print '<item label=" 10 &#37;"><action name="Execute"><command>cpulimit -p %s -z -l 10</command></action></item>' % (pid)
+ #print '<item label=" 20 &#37;"><action name="Execute"><command>cpulimit -p %s -z -l 20</command></action></item>' % (pid)
+ #print '<item label=" 30 &#37;"><action name="Execute"><command>cpulimit -p %s -z -l 30</command></action></item>' % (pid)
+ #print '<item label=" 40 &#37;"><action name="Execute"><command>cpulimit -p %s -z -l 40</command></action></item>' % (pid)
+ #print '<item label=" 50 &#37;"><action name="Execute"><command>cpulimit -p %s -z -l 50</command></action></item>' % (pid)
+ #print '<item label=" 60 &#37;"><action name="Execute"><command>cpulimit -p %s -z -l 60</command></action></item>' % (pid)
+ #print '<item label=" 70 &#37;"><action name="Execute"><command>cpulimit -p %s -z -l 70</command></action></item>' % (pid)
+ #print '<item label=" 80 &#37;"><action name="Execute"><command>cpulimit -p %s -z -l 80</command></action></item>' % (pid)
+ #print '<item label=" 90 &#37;"><action name="Execute"><command>cpulimit -p %s -z -l 90</command></action></item>' % (pid)
+ #print '<item label="100 &#37;"><action name="Execute"><command>cpulimit -p %s -z -l 100</command></action></item>' % (pid)
+ #print '</menu>'
+## (#*#)
+
+ print '<menu id="%s-menu-priority" label="priority (%s)">' % (pid, proc_info[5])
+ print '<item label="-10 (fast)"><action name="Execute"><command>renice -10 %s</command></action></item>' % (pid)
+ print '<item label="-5"><action name="Execute"><command>renice -5 %s</command></action></item>' % (pid)
+ print '<item label="0 (base)"><action name="Execute"><command>renice 0 %s</command></action></item>' % (pid)
+ print '<item label="5"><action name="Execute"><command>renice 5 %s</command></action></item>' % (pid)
+ print '<item label="10"><action name="Execute"><command>renice 10 %s</command></action></item>' % (pid)
+ print '<item label="15"><action name="Execute"><command>renice 15 %s</command></action></item>' % (pid)
+ print '<item label="19 (idle)"><action name="Execute"><command>renice 19 %s</command></action></item>' % (pid)
+ print '</menu>'
+
+ print '<menu id="%s-menu-state" label="%s">' % (pid, proc_info[0])
+ print '<item label="stop"><action name="Execute"><command>kill -SIGSTOP %s</command></action></item>' % (pid)
+ print '<item label="continue"><action name="Execute"><command>kill -SIGCONT %s</command></action></item>' % (pid)
+ print '</menu>'
+
+ print '<menu id="%s-menu-stop" label="stop signals">' % (pid)
+ print '<item label="exit"><action name="Execute"><command>kill -TERM %s</command></action></item>' % (pid)
+ print '<item label="hangup"><action name="Execute"><command>kill -HUP %s</command></action></item>' % (pid)
+ print '<item label="interrupt"><action name="Execute"><command>kill -INT %s</command></action></item>' % (pid)
+ print '<item label="kill"><action name="Execute"><command>kill -KILL %s</command></action></item>' % (pid)
+ print '</menu>'
+ print '<separator />'
+
+ print '<menu id="%s-menu-command" label="command">' % (pid)
+ print '<item label="%s"><action name="Execute"><command>true</command></action></item>' % (proc_info[6])
+ print '<separator />'
+ print '<item label="spawn new"><action name="Execute"><command>%s</command></action></item>' % (proc_info[6])
+ print '</menu>'
+
+
+def generateMenu(pid):
+ """ generate main menu """
+ print '<menu id="%s-menu" label="%s" execute="%s --pid %s"/>' % (pid, _procName(pid), sys.argv[0], pid)
+
+#-------------------------------------------------------------------------------
+# Main
+#-------------------------------------------------------------------------------
+
+import os, sys
+
+#-------------------------#
+if __name__ == "__main__" :
+#-------------------------#
+ print '<?xml version="1.0" encoding="UTF-8"?>'
+ print '<openbox_pipe_menu>'
+ args = sys.argv[1:]
+ if ('--pid' in args):
+ try:
+ printXml(int(sys.argv[2]))
+ except ValueError and IOError:
+ pass
+ else:
+ if ('--title' in args):
+ print '<separator label="%s" />' % (processes_menu_title)
+ else:
+ pass
+ map(generateMenu, userPidFilter())
+ print '</openbox_pipe_menu>'
+
+# vim: set ft=python nu ts=4 sw=4 :
+
diff --git a/.config/openbox/scripts/system-info.sh b/.config/openbox/scripts/system-info.sh
new file mode 100755
index 0000000..c104288
--- /dev/null
+++ b/.config/openbox/scripts/system-info.sh
@@ -0,0 +1,112 @@
+#!/bin/bash
+######## This is a script made
+######## by 'yettenet'.
+########
+######## SysInfo script for OpenBox
+######## v0.1
+########
+######## The author does not take
+######## any responsibility for
+######## what it might do to your
+######## computer, though it's
+######## improbable to do any harm.
+########
+######## You may share the script with
+######## everyone and modify it for your
+######## liking, as long as you
+######## GIVE CREDIT.
+########
+######## To add it to Openbox, copy it to
+######## your Openbox/scripts folder, which usually is at
+######## ~/.config/openbox/scripts
+########
+######## edit your menu.xml file, which usually is at
+######## ~/.config/openbox/menu.xml
+######## and add the following line (in case you have the usual paths - if not, edit the path as needed):
+########
+########<menu execute="~/.config/openbox/scripts/sysinfo_v01-by_yettenet.script" id="sysinfo-menu" label="SysInfo"/>
+########
+######## Below you will find the settings
+######## (the script still needs to be tested)
+
+######## settings
+
+MountPoint1=$(echo /dev/root)
+MountPoint2=$(echo /dev/trekstor1)
+MountPoint3=$(echo /dev/trekstor2)
+MountPoint4=$(echo /dev/sda3)
+MountPoint5=$(echo /media/crossfire)
+#NetworkDevice1=$(echo eth0)
+#NetworkDevice2=$(echo eth1) #Uncomment some lines to make it work!
+
+######## /settings
+
+
+Signal=$(cat /sys/class/net/wlan0/wireless/link)
+User=$(whoami)
+Host=$(uname -n)
+System=$(uname -s)
+Release=$(uname -r)
+Arch=$(uname -m)
+
+SizeMountPoint1=$(df | grep "$MountPoint1" | cut -c1-20,51-55)
+SizeMountPoint2=$(df | grep "$MountPoint2" | cut -c1-20,51-55)
+SizeMountPoint3=$(df | grep "$MountPoint3" | cut -c1-20,51-55)
+SizeMountPoint4=$(df | grep "$MountPoint4" | cut -c1-20,51-55)
+SizeMountPoint5=$(df | grep "$MountPoint5" | cut -c1-20,51-55)
+
+#NetDev1ip=$(/sbin/ifconfig "$NetworkDevice1" | grep "inet addr:" | sed "s/.*inet addr://" | sed "s/Bcast.*//")
+#NetDev1down=$(/sbin/ifconfig "$NetworkDevice1" | grep bytes | sed 's/.*RX bytes:[0-9]* (//' | sed 's/iB).*TX.*//' | sed 's/b).*TX.*//' | sed 's/).*TX.*//')
+#NetDev1up=$(/sbin/ifconfig "$NetworkDevice1" | grep bytes | sed 's/.*TX bytes:[0-9]* (//' | sed 's/iB)//' |sed 's/b).*//' | sed 's/).*//')
+
+#NetDev2ip=$(/sbin/ifconfig "$NetworkDevice1" | grep "inet addr:" | sed "s/.*inet addr://" | sed "s/Bcast.*//")
+#NetDev2down=$(/sbin/ifconfig "$NetworkDevice1" | grep bytes | sed 's/.*RX bytes:[0-9]* (//' | sed 's/iB).*TX.*//' | sed 's/b).*TX.*//' | sed 's/).*TX.*//')
+#NetDev2up=$(/sbin/ifconfig "$NetworkDevice1" | grep bytes | sed 's/.*TX bytes:[0-9]* (//' | sed 's/iB)//' |sed 's/b).*//' | sed 's/).*//')
+
+DateDate=$(date '+Date: %m.%d.%Y (%a)')
+DateWeek=$(date '+Week: %W')
+ DateDay=$(date '+ Day: %j')
+DateTime=$(date '+Time: %I:%M [%Z]')
+UpTime=$(uptime | sed 's/.* up //' | sed 's/[0-9]* us.*//' | sed 's/ day, /d/' | sed 's/ days, /d /' | sed 's/:/h /' | sed 's/ min//'| sed 's/,/m/' | sed 's/ / /')
+
+MemTotal=$(echo "scale = 2; ("$(cat /proc/meminfo | grep MemTotal: | awk '{print $2}' | sed 's/k//')" /1024)" | bc)
+ MemFree=$(echo "scale = 2; ("$(cat /proc/meminfo | grep MemFree: | awk '{print $2}' | sed 's/k//')" /1024) + ("$(cat /proc/meminfo | grep grep -m 1 Cached: | awk '{print $2}' | sed 's/k//')" /1024)" | bc)
+ MemUsed=$(echo "scale = 2; ("$(cat /proc/meminfo | grep MemTotal: | awk '{print $2}' | sed 's/k//')" /1024) - (("$(cat /proc/meminfo | grep MemFree: | awk '{print $2}' | sed 's/k//')" /1024) + ("$(cat /proc/meminfo | grep -m 1 Cached: | awk '{print $2}' | sed 's/k//')" /1024))" | bc)
+
+SwpTotal=$(echo "scale = 2; ("$(cat /proc/meminfo | grep SwapTotal: | awk '{print $2}' | sed 's/k//')" /1024)" | bc)
+ SwpFree=$(echo "scale = 2; ("$(cat /proc/meminfo | grep SwapFree: | awk '{print $2}' | sed 's/k//')" /1024)" | bc)
+ SwpUsed=$(echo "scale = 2; ("$(cat /proc/meminfo | grep SwapTotal: | awk '{print $2}' | sed 's/k//')" /1024) - ("$(cat /proc/meminfo | grep SwapFree: | awk '{print $2}' | sed 's/k//')" /1024)" | bc)
+
+MemUsedPercent=$(echo "scale = 2; (("$(cat /proc/meminfo | grep MemTotal: | awk '{print $2}' | sed 's/k//')" /1024) - (("$(cat /proc/meminfo | grep MemFree: | awk '{print $2}' | sed 's/k//')" /1024) + ("$(cat /proc/meminfo | grep -m 1 Cached: | awk '{print $2}' | sed 's/k//')" /1024))) / ("$(cat /proc/meminfo | grep MemTotal: | awk '{print $2}' | sed 's/k//')" /1024) *100" | bc)
+SwpUsedPercent=$(echo "scale = 2; (("$(cat /proc/meminfo | grep SwapTotal: | awk '{print $2}' | sed 's/k//')" /1024) - ("$(cat /proc/meminfo | grep SwapFree: | awk '{print $2}' | sed 's/k//')" /1024)) / ("$(cat /proc/meminfo | grep SwapTotal: | awk '{print $2}' | sed 's/k//')" /1024) *100" | bc)
+
+CPUmodel=$(cat /proc/cpuinfo | grep "model name" | sed 's/.*: //')
+CPUfreq=$(cat /proc/cpuinfo | grep -m 1 "cpu MHz" | sed 's/.*: //' | cut -c1-4)
+CPUcache=$(cat /proc/cpuinfo | grep -m 1 "cache size" | sed 's/.*: //')
+
+
+echo "<openbox_pipe_menu>"
+echo "<separator label = \"Mountpoint ~ Space Used\"/>"
+test "$SizeMountPoint1" && echo "<item label=\"$SizeMountPoint1\"/>"
+test "$SizeMountPoint2" && echo "<item label=\"$SizeMountPoint2\"/>"
+test "$SizeMountPoint3" && echo "<item label=\"$SizeMountPoint3\"/>"
+test "$SizeMountPoint4" && echo "<item label=\"$SizeMountPoint4\"/>"
+test "$SizeMountPoint5" && echo "<item label=\"$SizeMountPoint5\"/>"
+
+echo "<separator label=\"Hardware ~ Use\"/>"
+echo "<item label=\"RAM used: $MemUsedPercent%\"/>"
+echo "<item label=\"Swap used: $SwpUsedPercent%\"/>"
+echo "<item label=\"Cpu-Freq: $CPUfreq MHz\"/>"
+echo "<item label=\"Signal: $Signal%\"/>"
+
+#echo "<separator label = \"Network ~ "$NetworkDevice2" \"/>"
+#echo "<item label=\""$NetworkDevice1" ~ ip: $NetDev2ip\"/>"
+#echo "<item label=\""$NetworkDevice1" ~ downloaded: "$NetDev2down"iB\"/>"
+#echo "<item label=\""$NetworkDevice1" ~ uploaded: "$NetDev2up"iB\"/>"
+
+echo "<separator label = \"Date ~ Time\"/>"
+echo "<item label=\"$DateDate\"/>"
+echo "<item label=\"$DateTime\"/>"
+echo "<item label=\"Uptime: $UpTime\"/>"
+
+echo "</openbox_pipe_menu>"
diff --git a/.config/openbox/scripts/wallmenu.py b/.config/openbox/scripts/wallmenu.py
new file mode 100755
index 0000000..492c91f
--- /dev/null
+++ b/.config/openbox/scripts/wallmenu.py
@@ -0,0 +1,109 @@
+#!/usr/bin/env python
+
+import os
+import re
+import string
+import sys
+from os.path import isdir
+
+
+# --------------------------------------------------------------------------- #
+# wallmenu.py #
+# version 0.3.0 #
+# --------------------------------------------------------------------------- #
+# This script creates an openbox pipe menu to choose a wallpaper.
+# You can configure what types of files are allowed, where to search for
+# wallpapers, and what program to use to set the wallpaper.
+# This script will also update a configuration file
+# (~/.config/openbox/wallmenurc) that stores the last set wallpaper.
+# This means that you can add a line to your .xinitrc file to load the
+# last set wallpaper on start-up.
+# You can configure this script with the variables below.
+# This script will recursively go through directories from the one you
+# specify, searching for image files.
+# --------------------------------------------------------------------------- #
+
+# --------------------------------------------------------------------------- #
+# Using the config file #
+# --------------------------------------------------------------------------- #
+# To use the config file that stores the filename of the last set wallpaper,
+# you can add a line to your .xinitrc file to load it on start-up. If you
+# use Esetroot you can use this example, if not just replace the program
+# command with your chosen program:
+#
+# Esetroot `cat ~/.config/openbox/wallmenurc`
+#
+# If you want to use this script with feh to set your wallpaper, you don't
+# need the script to update a config file. feh automatically inserts the full
+# command string used to set the wallpaper into ~/.fehbg. In order to set the
+# wallpaper back at the next startof openbox, just add the following to
+# ~/.xinitrc:
+#
+# eval `cat ~/.fehbg`
+# --------------------------------------------------------------------------- #
+
+# --------------------------------------------------------------------------- #
+# User configuration #
+# --------------------------------------------------------------------------- #
+# types of files accepted (list, seperated by a |)
+filetypes = "jpg|png|gif"
+# directory where wallpapers are stored (must be long: no ~ symbol allowed)
+directory = "/home/ben/.wallpapers"
+# program to set wallpaper
+program = "feh --bg-scale"
+# store wallpaper name in a config file?
+config = "no"
+# --------------------------------------------------------------------------- #
+
+def genmenu(start, directory):
+ # get a directory list
+ dirlist = os.listdir(directory)
+ for d in dirlist:
+ # set di to overall directory
+ di = directory + "/" + d
+ # if we get a dir, generate a menu
+ if isdir(di):
+ print ""
+ print " <menu id=\"" + di + "\" label=\"" + d + "\" >"
+ genmenu(start, di)
+ print " </menu>"
+ # if we get a file, check if it is a valid type
+ else:
+ if re.search(filetypes, string.lower(di)) > 0:
+ # make fi variable just filename, without extension
+ fi = string.replace(string.replace(di, directory, ""), "/", "")
+ fi = fi[:string.rfind(fi, ".")]
+ # if so, add it to the pipe menu
+ print " <item label=\"" + fi + "\">"
+ # execute line to set wallpaper
+ print " <action name=\"Execute\"><execute>" + program + " \"" + di + "\"</execute></action>"
+ # if we want to update config file, do so
+ if config == "yes":
+ print " <action name=\"Execute\"><execute>~/.config/openbox/wallmenu.py " + di + "</execute></action>"
+ print " </item>"
+
+
+def main(argv):
+
+ # if we've been passed an argument update the config file with the arg
+ if len(argv) == 1:
+ os.system("echo " + argv[0] + " > ~/.config/openbox/wallmenurc")
+
+ else:
+
+ # start menu
+ print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ print "<openbox_pipe_menu>"
+ print " <separator label=\"Wallpaper\" />"
+
+ # set the original start directory
+ start = directory
+ # generate menu
+ genmenu(start, directory)
+
+ # end menu
+ print "</openbox_pipe_menu>"
+
+# run the main() function
+if __name__ == "__main__":
+ main(sys.argv[1:])
diff --git a/.config/openbox/scripts/xcompmgr.sh b/.config/openbox/scripts/xcompmgr.sh
new file mode 100755
index 0000000..f19dcc2
--- /dev/null
+++ b/.config/openbox/scripts/xcompmgr.sh
@@ -0,0 +1,94 @@
+#!/bin/bash
+# Openbox Pipe Menu for xcompmgr
+# Written for CrunchBang Linux <http://crunchbang.org/projects/linux/>
+# by Philip Newborough (aka corenominal) <mail@philipnewborough.co.uk>
+
+# Set xcompmgr command options
+#EXEC='xcompmgr -c -t-5 -l-5 -r4.2 -o.55' #basic
+EXEC='xcompmgr -cCfF -t-5 -l-5 -r4.2 -o.55 -D6' #more effects
+
+# Toggle compositing. Call with "myxcompmgr --startstop"
+if [ "$1" = "--startstop" ]; then
+ if [ ! "$(pidof xcompmgr)" ]; then
+ $EXEC
+ else
+ killall xcompmgr
+ fi
+ exit 0
+fi
+# Output Openbox menu
+if [ ! "$(pidof xcompmgr)" ]; then
+ cat << _EOF_
+ <openbox_pipe_menu>
+ <separator label="Compositing" />
+ <item label="Enable Compositing">
+ <action name="Execute">
+ <execute>~/.config/openbox/scripts/xcompmgr.sh --startstop</execute>
+ </action>
+ </item>
+ </openbox_pipe_menu>
+_EOF_
+else
+ cat << _EOF_
+ <openbox_pipe_menu>
+ <separator label="Compositing" />
+ <item label="Remove Transparency from Target Window">
+ <action name="Execute">
+ <execute>transset-df 1</execute>
+ </action>
+ </item>
+ <item label="Set Target Window Transparency to 10%">
+ <action name="Execute">
+ <execute>transset-df .90</execute>
+ </action>
+ </item>
+ <item label="Set Target Window Transparency to 20%">
+ <action name="Execute">
+ <execute>transset-df .80</execute>
+ </action>
+ </item>
+ <item label="Set Target Window Transparency to 30%">
+ <action name="Execute">
+ <execute>transset-df .70</execute>
+ </action>
+ </item>
+ <item label="Set Target Window Transparency to 40%">
+ <action name="Execute">
+ <execute>transset-df .60</execute>
+ </action>
+ </item>
+ <item label="Set Target Window Transparency to 50%">
+ <action name="Execute">
+ <execute>transset-df .50</execute>
+ </action>
+ </item>
+ <item label="Set Target Window Transparency to 60%">
+ <action name="Execute">
+ <execute>transset-df .40</execute>
+ </action>
+ </item>
+ <item label="Set Target Window Transparency to 70%">
+ <action name="Execute">
+ <execute>transset-df .30</execute>
+ </action>
+ </item>
+ <item label="Set Target Window Transparency to 80%">
+ <action name="Execute">
+ <execute>transset-df .20</execute>
+ </action>
+ </item>
+ <item label="Set Target Window Transparency to 90%">
+ <action name="Execute">
+ <execute>transset-df .10</execute>
+ </action>
+ </item>
+ <separator/>
+ <item label="Disable Compositing">
+ <action name="Execute">
+ <execute>~/.config/openbox/scripts/xcompmgr.sh --startstop</execute>
+ </action>
+ </item>
+ </openbox_pipe_menu>
+_EOF_
+fi
+exit 0
diff --git a/.config/openbox/scripts/xdgmenu.php b/.config/openbox/scripts/xdgmenu.php
new file mode 100755
index 0000000..b5ded26
--- /dev/null
+++ b/.config/openbox/scripts/xdgmenu.php
@@ -0,0 +1,207 @@
+#!/usr/bin/env php
+<?php
+error_reporting(0);
+$dirs = array (
+ "/usr/share/applications",
+// "/usr/share/control-center-2.0/capplets",
+// $_SERVER["HOME"] . "/.gnome2/vfolders/applications"
+);
+
+function parseDesktopFile($path)
+// {{{
+{
+ $desktop = array ();
+ $booleans = array ("false" => false, "true" => true);
+ $data = file_get_contents($path);
+ $data = str_replace("&", "&amp;", $data);
+ $lines = explode("\n", $data);
+ foreach ($lines as $l => $line) {
+ $line = rtrim($line);
+ $pos = strpos($line, "=");
+ if (!$pos) continue;
+ $field = substr($line, 0, $pos);
+ $value = substr($line, ($pos + 1));
+ if ($value === false) $value = "";
+ if (array_key_exists($value, $booleans)) {
+ $value = $booleans[$value];
+ }
+
+ $pos = strpos($field, "[");
+ if ($pos) {
+ $field_name = strtolower(substr($field, 0, $pos));
+ $key = substr($field, ($pos + 1), -1);
+ } else {
+ $field_name = strtolower($field);
+ }
+ if ($field_name == "categories") {
+ if (substr($value, -1) == ";")
+ $value = substr($value, 0, -1);
+ $value = explode(";", strtolower($value));
+ }
+ if (!array_key_exists($field_name, $desktop)) {
+ $desktop[$field_name] = $value;
+ } else if (!is_array($desktop[$field_name])) {
+ $default = $desktop[$field_name];
+ $desktop[$field_name] = array ("default" => $default);
+ } else {
+ $desktop[$field_name][$key] = $value;
+ }
+ }
+ if (!array_key_exists("terminal", $desktop))
+ $desktop["terminal"] = false;
+ return $desktop;
+}
+// }}}
+
+function storeEntry($name, $exec, $categories, $menu, $indexes = null, $core = false)
+// {{{
+{
+ if (is_null($indexes)) { // first call of this function for this desktop file
+ $indexes = array ();
+ $indexes["c"] = 0;
+ $indexes["nc"] = count($categories);
+ $indexes["lc"] = $indexes["nc"] - 1;
+ }
+
+ for ($c =& $indexes["c"]; $c < $indexes["nc"]; $c++) { // loop through each category
+ $category =& $categories[$c];
+ if ($category == "application") {
+ $core = true;
+ continue;
+ }
+ $is_last = ($c == $indexes["lc"]);
+ if (array_key_exists($category, $menu)) {
+ $core = false;
+ if ($is_last) { // put entry in current (sub)menu
+ $menu[$category][] = array (
+ "appname" => $name,
+ "appexec" => $exec
+ );
+ } else { // look for a matching submenu
+ ++$c;
+ $menu[$category] = storeEntry($name, $exec, $categories, $menu[$category], $indexes, $core);
+ }
+ return $menu;
+ } else { // unknown category
+ if (!$is_last) {
+ $core = false;
+ continue;
+ } else if ($core && $category != "core") { // not a "core" app, not a supported category
+ $menu["other"][] = array (
+ "appname" => $name,
+ "appexec" => $exec
+ );
+ return $menu;
+ } else { // last category, put it in current (sub)menu
+ $menu[] = array (
+ "appname" => $name,
+ "appexec" => $exec
+ );
+ return $menu;
+ }
+ }
+ }
+ return $menu;
+}
+// }}}
+
+function genXML(&$menu, &$labels, $i = 0)
+// {{{
+{
+ static $x = 0;
+ $xml = "";
+ foreach ($menu as $key => $value) {
+ $indentation = str_repeat(" ", $i);
+ if (is_string($key)) { // recursion
+ list ($label,) = each($labels); // advance pointer no matter what
+ if (empty($value)) continue; // menu is empty, there's no point in displaying it
+ $xml .= $indentation . "<menu id=\"gnome-menu-$x\" label=\"$label\">\n";
+ $xml .= genXML($menu[$key], $labels[$label], $i + 1, ++$x);
+ $xml .= $indentation . "</menu>\n";
+ } else {
+ if (empty($value)) continue;
+ $xml .= $indentation . "<item label=\"{$value["appname"]}\"><action name=\"Execute\">"
+ . "<execute>{$value["appexec"]}</execute></action></item>\n";
+ }
+ }
+ return $xml;
+}
+// }}}
+
+$categories = array (
+ "utility" => array (),
+ "settings" => array (
+ "accessibility" => array (),
+ "advancedsettings" => array ()
+ ),
+ "education" => array (),
+ "game" => array (),
+ "graphics" => array (),
+ "network" => array (),
+ "audiovideo" => array (
+ "audio" => array (),
+ "video" => array ()
+ ),
+ "office" => array (),
+ "other" => array (),
+ "development" => array (),
+ "science" => array (),
+ "system" => array ()
+);
+
+$menu = array (
+ "Accessories" => null,
+ "Desktop Preferences" => array (
+ "Accessibility" => null,
+ "Advanced" => null
+ ),
+ "Education" => null,
+ "Games" => null,
+ "Graphics" => null,
+ "Internet" => null,
+ "Multimedia" => array (
+ "Audio" => null,
+ "Video" => null,
+ ),
+ "Office" => null,
+ "Other" => null,
+ "Programming" => null,
+ "Scientific Tools" => null,
+ "System Tools" => null
+);
+
+$modifiers = array ("%f", "%F", "%u", "%U", "%d", "%D", "%n", "%N", "%i", "%c", "%k", "%v");
+
+$desktops = array ();
+$names = array ();
+foreach ($dirs as $path) {
+ $dir = dir($path);
+ while (($entry = $dir->read()) !== false) {
+ if (substr($entry, -8) != ".desktop") continue;
+ $desktop = parseDesktopFile($path . DIRECTORY_SEPARATOR . $entry);
+ if ($desktop === false || !array_key_exists("categories", $desktop)) continue;
+ !is_array($desktop["name"]) ? $name = $desktop["name"] : $name = $desktop["name"]["default"];
+ $key = & $desktop["exec"];
+ $desktops[$key] = $desktop;
+ $names[$key] = $name;
+ }
+}
+asort($names);
+reset($names);
+
+foreach ($names as $key => $name) {
+ $desktop =& $desktops[$key];
+ $exec = str_replace($modifiers, "", $desktop["exec"]);
+ if ($desktop["terminal"]) $exec = "xterm -e $exec";
+ $categories = storeEntry($name, $exec, $desktop["categories"], $categories);
+}
+?>
+<openbox_pipe_menu xmlns="http://openbox.org/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://openbox.org/
+ file:///usr/share/openbox/menu.xsd">
+
+<?php echo genXML($categories, $menu, 1); ?>
+
+</openbox_pipe_menu>
+