You are not logged in.

#1 2010-04-09 22:09:31

illumin8
Member
From: Tacoma, WA
Registered: 2010-02-26
Posts: 10
Website

How to enable menu trasparency/compositing pipe menu in Openbox.

In response to Skrite's question regarding enabling menu transparency, and compositing control in the Openbox menu,
These are the steps I followed to set this up:

Deps: xcompmgr-dana
          transset

-If you have xcompmgr installed, remove it and replace it with xcompmgr-dana which is available in AUR.
-insure that you have transset installed.

-Enabling compositing at start up can be achieved by adding  xcompmgr -'options' &  to either your ~/.xinitrc, or to ~/.config/openbox/autostart.sh, but adding compositing control to the openbox menu requires a bit more set up. Also, doing it this way adds some additional compositing options.

- Create the control script...

$ su
# cd /usr/bin
# touch xcompmgr_openbox
# nano xcompmgr_openbox

and paste the following into /usr/bin/xcompmgr_openbox

#!/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.11 -D7 -m.86' # more bling

# Toggle compositing. Call with "xcompmgr_openbox --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>
        <item label="Enable Compositing">
            <action name="Execute">
                <execute>
                    xcompmgr_openbox --startstop
                </execute>
            </action>
        </item>
    </openbox_pipe_menu>
_EOF_
else
    cat << _EOF_
    <openbox_pipe_menu>
                <item label="Remove Transparency from Target Window">
                    <action name="Execute">
                        <execute>
                            transset 1
                        </execute>
                    </action>
                </item>
                <item label="Set Target Window Transparency to 10%">
                    <action name="Execute">
                        <execute>
                            transset .90
                        </execute>
                    </action>
                </item>
                <item label="Set Target Window Transparency to 20%">
                    <action name="Execute">
                        <execute>
                            transset .80
                        </execute>
                    </action>
                </item>
                <item label="Set Target Window Transparency to 30%">
                    <action name="Execute">
                        <execute>
                            transset .70
                        </execute>
                    </action>
                </item>
                <item label="Set Target Window Transparency to 40%">
                    <action name="Execute">
                        <execute>
                            transset .60
                        </execute>
                    </action>
                </item>
                <item label="Set Target Window Transparency to 50%">
                    <action name="Execute">
                        <execute>
                            transset .50
                        </execute>
                    </action>
                </item>
                <item label="Set Target Window Transparency to 60%">
                    <action name="Execute">
                        <execute>
                            transset .40
                        </execute>
                    </action>
                </item>
                <item label="Set Target Window Transparency to 70%">
                    <action name="Execute">
                        <execute>
                            transset .30
                        </execute>
                    </action>
                </item>
                <item label="Set Target Window Transparency to 80%">
                    <action name="Execute">
                        <execute>
                            transset .20
                        </execute>
                    </action>
                </item>
                <item label="Set Target Window Transparency to 90%">
                    <action name="Execute">
                        <execute>
                            transset .10
                        </execute>
                    </action>
                </item>
                <separator/>
                <item label="Disable Compositing">
                    <action name="Execute">
                        <execute>
                            xcompmgr_openbox --startstop
                        </execute>
                    </action>
                </item>
    </openbox_pipe_menu>
_EOF_
fi
exit 0

Use cntl + x then enter to save.

Set permissions...

# chmod 755 /usr/bin/xcompmgr_openbox
# exit

Add the openbox compositing control pipe menu...

<menu execute="xcompmgr_openbox" id="CompositingPipeMenu" label="Compositing"/>

This should be placed in ~/.config/openbox/menu.xml where ever you would like it to showup in your Openbox menu.

Finanlly, if you wish compositing to be enabled at startup, place the following in ~/.config/openbox/autostart.sh

xcompmgr_openbox --startstop &

You should also take the time to read man xcompmgr to see what options can be used...
This section of /usr/bin/xcompmgr_openbox is where you can adjust your options...

# 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.11 -D7 -m.86' # more bling

The -o option controls drop shadow opacity, and the -D option controls fadein/fadeout time in milliseconds. See man pages for more.

A quick final note, the transparency settings for application windows using xcompmgr-dana is not enduring.
If you would like to enable unfocused client transparency support in Openbox, refer to this thread....
http://bbs.archlinux.org/viewtopic.php?pid=733946

Last edited by illumin8 (2010-04-09 22:16:03)

Offline

#2 2010-04-14 05:38:07

maxexcloo
Member
Registered: 2009-10-14
Posts: 177

Re: How to enable menu trasparency/compositing pipe menu in Openbox.

Very nice guide!

I'm using it now smile

Offline

Board footer

Powered by FluxBB