Skip to content

Instantly share code, notes, and snippets.

@NeoTech
Created April 15, 2017 08:50
Show Gist options
  • Select an option

  • Save NeoTech/98bd5ccbb0ac433ea6577046263cb018 to your computer and use it in GitHub Desktop.

Select an option

Save NeoTech/98bd5ccbb0ac433ea6577046263cb018 to your computer and use it in GitHub Desktop.

Revisions

  1. NeoTech created this gist Apr 15, 2017.
    116 changes: 116 additions & 0 deletions xompmgr_openbox.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,116 @@
    #!/bin/bash
    # Openbox Pipe Menu for xcompmgr
    # Written for CrunchBang Linux <http://crunchbang.org/projects/linux/>
    # by Philip Newborough (aka corenominal) <[email protected]>

    # 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