Merge lp:~bryanfritt/compiz/compiz-decorator_script-edit_1192376 into lp:compiz/0.9.11

Proposed by Sam Spilsbury
Status: Needs review
Proposed branch: lp:~bryanfritt/compiz/compiz-decorator_script-edit_1192376
Merge into: lp:compiz/0.9.11
Diff against target: 378 lines (+128/-107)
3 files modified
debian/patches/ubuntu-config.patch (+60/-39)
plugins/decor/decor.xml.in (+1/-1)
plugins/decor/src/compiz-decorator (+67/-67)
To merge this branch: bzr merge lp:~bryanfritt/compiz/compiz-decorator_script-edit_1192376
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
MC Return Pending
Daniel van Vugt Pending
Sam Spilsbury Pending
Review via email: mp+176814@code.launchpad.net

This proposal supersedes a proposal from 2013-06-24.

Commit message

Changed 'compiz-decorator', and 'decor.xml.in':
fixed missing '/'
fixed 'kde-plasma' detection
changed comments
added some quoting
moved some code around
(LP: #1192376)

Description of the change

compiz-decorator changes: 'default path', 'which', 'plasma-kde','quoting', '/', ' --replace &'
decor.xml.in changes: default command for decorator

Describe what changes your branch introduces,
Changes to compiz-decorator and decor.xml.in that get it to choose and run a decorator better.

"what bugs it fixes,"
Fallback was messed up for KDE,
'/' neaded in paths,
better description of what's it's doing, if it can't find a perfect decorator match,
'--replace &' was missing

"or what features it implements."
If COMPIZ_BIN_PATH isn't set, it'll detect what directory it's in, and set COMPIZ_BIN_PATH to it,
detects location of METACITY,
allows spaces in paths of HOME, XDG_CONFIG_DIRS, XDG_CONFIG_HOME, etc...

"Ideally include rationale and how to test."
Kill the the decorators, and then run this script in COMPIZ_BIN_PATH, or in the paths with the decorators,
Are the correct decorators for KDE and GNOME run?

To post a comment you must log in.
Revision history for this message
MC Return (mc-return) wrote : Posted in a previous version of this proposal

If this MP is ready, please set it's status from "Work in progress" to "Needs review" and do not forget to add a main commit message to it via the "Set commit message"- (green "+") button above...

Another note: If you "bzr merge lp:compiz" and then commit, you do not have to copy the whole commit message, it is enough to say "Merged latest lp:compiz" or "Merged lp:compiz" in the commit message then...

Revision history for this message
MC Return (mc-return) wrote : Posted in a previous version of this proposal
Revision history for this message
BryanFRitt (bryanfritt) wrote : Posted in a previous version of this proposal

> If this MP is ready, please set it's status from "Work in progress" to "Needs
> review" and do not forget to add a main commit message to it via the "Set
> commit message"- (green "+") button above...
>
> Another note: If you "bzr merge lp:compiz" and then commit, you do not have to
> copy the whole commit message, it is enough to say "Merged latest lp:compiz"
> or "Merged lp:compiz" in the commit message then...

What does 'MP' stand for?
I don't see a "work in progress"/"Needs review". Where is it? The closest thing I see is "Request a review".

Revision history for this message
BryanFRitt (bryanfritt) wrote : Posted in a previous version of this proposal

For the 'commit message(s)' is there a specific writing style that's preferred?

Revision history for this message
MC Return (mc-return) wrote : Posted in a previous version of this proposal

MP == Merge Proposal

Search "Work in progress" on this page via browser if you cannot find it ;)

Well, there is no hard rule regarding the commit message, but:

I always start uppercase and end with punctuation, but your commit message is okay that way as well...
It would be good to add "(LP: #1192376)" at the bottom to have the link to the bug directly in the commit message.

I hope Sam can take a look at this also soon, as I am no expert regarding this script, but generally this looks good already and I cannot find anything that is obviously wrong.

Revision history for this message
MC Return (mc-return) wrote : Posted in a previous version of this proposal

LGTM. +1.
Thanks 4 all the work you invested into this. Top job !
Hope to see more MPs from you in the future. Good to know that KDE users still care about Compiz !

Approve from me, but waiting for Sam with the final green light, but from what I am seeing everything looks good. :)

review: Approve
Revision history for this message
BryanFRitt (bryanfritt) wrote : Posted in a previous version of this proposal
Download full text (4.0 KiB)

I've edited/started/done a start-compiz and a start-ccsm script, they export LD_LIBRARY_PATH, and PYTHONPATH, etc...
How can I get them into Compiz?
They would be new files that aren't in there currently, so I have to find and mess with an install script and add them in somehow?
(and/or perhaps Compiz could be made so that these scripts would be optional)

Guess I start a new branch/bug report?

-----

#!/bin/sh

# start-compiz

# Assumes script is in a direct sibdirectory of COMPIZ_PREFIX, like "${COMPIZ_PREFIX}/bin/"
COMPIZ_PREFIX=$(dirname $(cd $(dirname "$0"); pwd))
# If the above isn't correct, it can be commented it out, and the line below edited
#COMPIZ_PREFIX=

#VERBOSE="no"
VERBOSE="yes"
# Echos the arguments if verbose
verbose()
{
 if [ "${VERBOSE}" = "yes" ]; then
  echo "$@"
 fi
}

verbose "COMPIZ_PREFIX=\"${COMPIZ_PREFIX}\""
#export PKG_CONFIG_PATH="${COMPIZ_PREFIX}/lib/pkgconfig:${COMPIZ_PREFIX}/lib64/pkgconfig:${COMPIZ_PREFIX}/lib32/pkgconfig:${PKG_CONFIG_PATH}"
export LD_LIBRARY_PATH="${COMPIZ_PREFIX}/lib:${COMPIZ_PREFIX}/lib64:${COMPIZ_PREFIX}/lib32:${LD_LIBRARY_PATH}"
verbose "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}"

if [ -n `which "python2.7"` ]; then
 PYTHONVERSION="2.7"
else
 if [ -n `which "python2.6"` ]; then
  PYTHONVERSION="2.6"
 else
  echo "neither python2.7 nor python2.6 where found"
 fi
fi
verbose "PYTHONVERSION=\"${PYTHONVERSION}\""
if [ -n "${PYTHONVERSION}" ]; then
 #unset PYTHONPATH
 export PYTHONPATH="${COMPIZ_PREFIX}/lib/python${PYTONVERSION}/site-packages:${COMPIZ_PREFIX}/lib64/python${PYTONVERSION}/site-packages:${COMPIZ_PREFIX}/lib32/python${PYTONVERSION}/site-packages::${PYTHONPATH}"
 verbose "PYTHONPATH=\"${PYTHONPATH}\""
fi

# gets rid of plama panels, etc... probably not good
#kquitapp plasma-desktop

verbose "${COMPIZ_PREFIX}/bin/compiz" --replace ccp "$@" &
"${COMPIZ_PREFIX}/bin/compiz" --replace ccp "$@" &

-----

#!/bin/sh

# start-ccsm

# Kill any running instance of ccsm
#pkill -x ccsm

# Assumes script is in a direct subdirectory of $COMPIZ_PREFIX, like "${COMPIZ_PREFIX}/bin/
COMPIZ_PREFIX=$(dirname $(cd $(dirname "$0"); pwd))
# If the above isn't correct, it can be commented it out, and the line below edited
#COMPIZ_PREFIX=

VERBOSE="no"
#VERBOSE="yes"
# Echos the arguments if verbose
verbose()
{
 if [ "${VERBOSE}" = "yes" ]; then
  echo "$@"
 fi
}

verbose "COMPIZ_PREFIX=\"${COMPIZ_PREFIX}\""
export PKG_CONFIG_PATH="${COMPIZ_PREFIX}/lib/pkgconfig:${COMPIZ_PREFIX}/lib64/pkgconfig:${COMPIZ_PREFIX}/lib32/pkgconfig:${PKG_CONFIG_PATH}"
verbose "PKG_CONFIG_PATH=\"${PKG_CONFIG_PATH}\""
export LD_LIBRARY_PATH="${COMPIZ_PREFIX}/lib:${COMPIZ_PREFIX}/lib64:${COMPIZ_PREFIX}/lib32:${LD_LIBRARY_PATH}"
verbose "LD_LIBRARY_PATH=\"${LD_LIBRARY_PATH}\""

# with this way somehow in either bash or sh, with this, python editor will start, not the intended result!
#if $(`which "python2.7"` &> /dev/null); then
# export PYTHONPATH="${COMPIZ_PREFIX}/lib/python2.7/site-packages:${COMPIZ_PREFIX}/lib64/python2.7/site-packages:${COMPIZ_PREFIX}/lib32/python2.7/site-packages::${PYTHONPATH}"
#fi
#if $(which python2.6 &> /dev/null); then
# export PYTHONPATH=$COMPIZ_PREFIX/lib/python2.6/site-packages:$COMPIZ_PREFIX/lib64/pyth...

Read more...

Revision history for this message
BryanFRitt (bryanfritt) wrote : Posted in a previous version of this proposal

> LGTM. +1.
> Thanks 4 all the work you invested into this. Top job !
> Hope to see more MPs from you in the future. Good to know that KDE users still
> care about Compiz !
>
> Approve from me, but waiting for Sam with the final green light, but from what
> I am seeing everything looks good. :)

Couldn't have done it without your help on bzr, etc...! Thanks!

Revision history for this message
MC Return (mc-return) wrote : Posted in a previous version of this proposal

>
> I've edited/started/done a start-compiz and a start-ccsm script, they export
> LD_LIBRARY_PATH, and PYTHONPATH, etc...

You seem to be the script master ;)
Great -> useful scripts are very welcome. +1 for engaging this.

> How can I get them into Compiz?
> They would be new files that aren't in there currently, so I have to find and
> mess with an install script and add them in somehow?
> (and/or perhaps Compiz could be made so that these scripts would be optional)
>

You can add directories and files with "bzr add filename".
We already have a scripts/ directory in the Compiz source, so simply add your script(s) with "bzr add scripts/scriptname.sh" to get them under version control, then "bzr commit" and "bzr push", like you've already learned ;)

> Guess I start a new branch/bug report?
>

Yes, please. Unrelated issues should not be mixed. Also it helps review to have everything separated.
Please also take care of typos and try to commit best-quality stuff only, make no compromises there ;)
I guess GPL v2 licensing of your code is okay for you ?

Revision history for this message
MC Return (mc-return) wrote : Posted in a previous version of this proposal

>
> Couldn't have done it without your help on bzr, etc...! Thanks!

No problem. We all want a better, cooler and greater Compiz don't we ? ;)

Revision history for this message
MC Return (mc-return) wrote : Posted in a previous version of this proposal

Another note:
Do not worry if a requested review can take a while. We are all volunteers here and time is precious these days... ;)

So do not wait for review of your old MP, if you have further MPs -> bring them on.
Everything gets reviewed sooner or later ;)

Revision history for this message
BryanFRitt (bryanfritt) wrote : Posted in a previous version of this proposal

Is there a way/how to 'undo' a merge commit like 3752? Like if last merge were to prevent this branch from compiling, or something else?

I'm guessing doing an unnecessary bzr merge or a bzr merge without a reason is a bad thing?
I supose it would affect those downloading the branch, if they chose to try to compile it, etc..., but would it even matter to those evaluating the merge proposal in my case since it's the last thing done, and any of the files I changed, weren't changed by others?

Revision history for this message
BryanFRitt (bryanfritt) wrote : Posted in a previous version of this proposal

The latest Compiz is giving me an error during 'make'.
...
compiz/build/kde/window-decorator-kde4/../../../kde/window-decorator-kde4/window.h:74:10: error: 'QuickTileMode' does not name a type
cc1plus: error: unrecognized command line option "-Wno-unused-private-field" [-Werror]
cc1plus: error: unrecognized command line option "-Wno-unused-private-field" [-Werror]
cc1plus: error: unrecognized command line option "-Wno-unused-private-field" [-Werror]
cc1plus: all warnings being treated as errors
make[2]: *** [kde/window-decorator-kde4/CMakeFiles/kde4-window-decorator.dir/kde4-window-decorator_automoc.o] Error 1
make[1]: *** [kde/window-decorator-kde4/CMakeFiles/kde4-window-decorator.dir/all] Error 2
make: *** [all] Error 2

Revision history for this message
Sam Spilsbury (smspillaz) wrote : Posted in a previous version of this proposal

You can disable KDE4 builds by doing -DBUILD_KDE4=OFF

On Fri, Jun 28, 2013 at 11:18 PM, BryanFRitt <email address hidden> wrote:
> The latest Compiz is giving me an error during 'make'.
> ...
> compiz/build/kde/window-decorator-kde4/../../../kde/window-decorator-kde4/window.h:74:10: error: 'QuickTileMode' does not name a type
> cc1plus: error: unrecognized command line option "-Wno-unused-private-field" [-Werror]
> cc1plus: error: unrecognized command line option "-Wno-unused-private-field" [-Werror]
> cc1plus: error: unrecognized command line option "-Wno-unused-private-field" [-Werror]
> cc1plus: all warnings being treated as errors
> make[2]: *** [kde/window-decorator-kde4/CMakeFiles/kde4-window-decorator.dir/kde4-window-decorator_automoc.o] Error 1
> make[1]: *** [kde/window-decorator-kde4/CMakeFiles/kde4-window-decorator.dir/all] Error 2
> make: *** [all] Error 2
> --
> https://code.launchpad.net/~bryanfritt/compiz/compiz-decorator_script-edit_1192376/+merge/171005
> You are requested to review the proposed merge of lp:~bryanfritt/compiz/compiz-decorator_script-edit_1192376 into lp:compiz.

--
Sam Spilsbury

Revision history for this message
MC Return (mc-return) wrote : Posted in a previous version of this proposal

> Is there a way/how to 'undo' a merge commit like 3752? Like if last merge were
> to prevent this branch from compiling, or something else?
>
"bzr revert" will revert uncommitted changes, use "bzr revert --help" for detailed
and verbose instructions on how to remove a commit.

> I'm guessing doing an unnecessary bzr merge or a bzr merge without a reason is
> a bad thing?

You just sync your source with trunk, nothing bad about doing this. It happens
anyway, when your branch lands. But doing it before it lands will give you the
opportunity to fix merge problems before they occur.

> I supose it would affect those downloading the branch, if they chose to try to
> compile it, etc..., but would it even matter to those evaluating the merge
> proposal in my case since it's the last thing done, and any of the files I
> changed, weren't changed by others?

I'm sorry, I do not understand what you mean by this...

Revision history for this message
MC Return (mc-return) wrote : Posted in a previous version of this proposal

I recommend to use cmake-gui to configure build options as it gives a nice visual representation of all the options.

Revision history for this message
BryanFRitt (bryanfritt) wrote : Posted in a previous version of this proposal

> You can disable KDE4 builds by doing -DBUILD_KDE4=OFF
>
> On Fri, Jun 28, 2013 at 11:18 PM, BryanFRitt <email address hidden> wrote:
> > The latest Compiz is giving me an error during 'make'.
> > ...
> > compiz/build/kde/window-decorator-kde4/../../../kde/window-decorator-
> kde4/window.h:74:10: error: 'QuickTileMode' does not name a type
> > cc1plus: error: unrecognized command line option "-Wno-unused-private-field"
> [-Werror]
> > cc1plus: error: unrecognized command line option "-Wno-unused-private-field"
> [-Werror]
> > cc1plus: error: unrecognized command line option "-Wno-unused-private-field"
> [-Werror]
> > cc1plus: all warnings being treated as errors
> > make[2]: *** [kde/window-decorator-kde4/CMakeFiles/kde4-window-
> decorator.dir/kde4-window-decorator_automoc.o] Error 1
> > make[1]: *** [kde/window-decorator-kde4/CMakeFiles/kde4-window-
> decorator.dir/all] Error 2
> > make: *** [all] Error 2
> > --
> > https://code.launchpad.net/~bryanfritt/compiz/compiz-decorator_script-
> edit_1192376/+merge/171005
> > You are requested to review the proposed merge of lp:~bryanfritt/compiz
> /compiz-decorator_script-edit_1192376 into lp:compiz.
>
>
>
> --
> Sam Spilsbury

It compiles with -DBUILD_KDE4=OFF. I'm using KDE and the 'kde4-window-decorator'(from one compiled earlier?). Is there going to be a working 'kde4-window-decorator' for 0.9.10?

Revision history for this message
BryanFRitt (bryanfritt) wrote : Posted in a previous version of this proposal

> > I supose it would affect those downloading the branch, if they chose to try
> to
> > compile it, etc..., but would it even matter to those evaluating the merge
> > proposal in my case since it's the last thing done, and any of the files I
> > changed, weren't changed by others?
>
> I'm sorry, I do not understand what you mean by this...

I guess I was trying to say the script working and Compiz compiling are fairly independent. Even if the script was replaced with complete garbage, it wouldn't affect rather or not Compiz compiles. But to those who would get the branch by itself `bzr branch lp:~bryanfritt/compiz/compiz-decorator_script-edit_1192376` and try to compile that would be affected by rather or not this Compiz branch compiles, or not.

Revision history for this message
Sam Spilsbury (smspillaz) wrote : Posted in a previous version of this proposal

61 +# Set COMPIZ_BIN_PATH if need be
62 +if [ -z "${COMPIZ_BIN_PATH}" ]; then
63 + #COMPIZ_BIN_PATH="/usr/bin/"
64 + # ?set default to the bin path is in the same path as this file, or to do above?
65 + COMPIZ_BIN_PATH=$(cd $(dirname "$0"); pwd)
66 + #echo "${COMPIZ_BIN_PATH}"
67 +fi

This is fine, although the method is a bit strange. Is there anything wrong with:

if [ -z "${COMPIZ_BIN_PATH}" ]; then
    # Set default binary path to the same path as this file
    COMPIZ_BIN_PATH=`dirname "$0"`
fi

There's lots of commented out code in the review version.

115 -if [ -n "$DECORATOR" ]; then
116 - verbose "Starting ${DECORATOR}\n"
117 - exec ${COMPIZ_BIN_PATH}$DECORATOR "$@"
118 -else
119 - verbose "Found no decorator to start\n"
120 - exec $FALLBACKWM $FALLBACKWM_OPTIONS
121 +if [ -z "${XDG_CONFIG_DIRS}" ]; then
122 + test -f "/etc/xdg/compiz/compiz-manager" && . "/etc/xdg/compiz/compiz-manager"
123 +else
124 + test -f "${XDG_CONFIG_DIRS}/compiz/compiz-manager" && . "${XDG_CONFIG_DIRS}/compiz/compiz-manager"
125 +fi

These changes are inconsistent with the coding style. Use 8-wide tabs for two indents and 4-spaces for one indent, or, if the language doesn't support it, use 4-spaces for indents.

159 + # If there isn't a compiz decorator available, try not leave users without decoration
160 + if [ "${DESKTOP_SESSION}" = "kde-plasma" ]; then
161 + FALLBACKWM=`which kwin` # typically "/usr/bin/kwin"
162 + else
163 + FALLBACKWM=`which metacity` # typically "/usr/bin/metacity"
164 + fi
165 + FALLBACKWM_OPTIONS="--replace"
166 + verbose "Couldn't find a decorator to start, running fallback"
167 + verbose "exec ${FALLBACKWM} ${FALLBACKWM_OPTIONS} &"
168 + exec "${FALLBACKWM}" "${FALLBACKWM_OPTIONS}" &

I'm not so sure how I feel about starting another _window manager_ just because a decorator wasn't found, but this code was here before so I don't mind too much.

review: Needs Fixing
Revision history for this message
BryanFRitt (bryanfritt) wrote : Posted in a previous version of this proposal

COMPIZ_BIN_PATH=$(cd $(dirname "$0"); vs COMPIZ_BIN_PATH=`dirname "$0"`
The first always gives the full path; The second changes based on how it's called. Put it in a script and it'll change based on how the script is called. Like is it called via a relative path, or via a full path? I suppose for this script this line could be done either way, although I haven't tested the script with the second.

you can try it out...
put this in a file and run different ways

# a quickly made example...
# with this code in /opt/CompizBZR/bin/pathTest.sh

THIS_PATH_1=$(cd $(dirname "$0"); pwd)
echo $THIS_PATH_1

THIS_PATH_2=`dirname "$0"`
echo $THIS_PATH_2

# results:
# called from /opt/CompizBZR/ with /opt/CompizBZR/bin/pathTests.sh
# /opt/CompizBZR/bin
# /opt/CompizBZR/bin

# also called from /opt/CompizBZR/ with ./bin/pathTests.sh
# /opt/CompizBZR/bin
# ./bin

# called from ~/ with ../../opt/CompizBZR/bin/pathTests.sh
# /opt/CompizBZR/bin
# ../../opt/CompizBZR/bin

# called from /opt/CompizBZR/bin/ with ./pathTests.sh
# ./pathTests.sh
# /opt/CompizBZR/bin

"There's lots of commented out code in the review version."
This was my first time messing with bzr, and Compiz submissions. I'm guessing I hit submit for review too soon?, and guessing it doesn't update which code to review? and so you might reviewed an earlier version?
(And I should resubmit again after changing tabs to 4 spaces?)

The one I should have submitted should have been done after 3751 `chmod +x`, the last thing I've done with this code. I hadn't thought of any changes to do with it since then, and it's working for me, so I guess I'm done with this set of edits, except for now messing with what you said, the using four spaces in place of a tab.

"These changes are inconsistent with the coding style. Use 8-wide tabs for two indents and 4-spaces for one indent, or, if the language doesn't support it, use 4-spaces for indents."
I didn't know about the coding style. Where can I read it?
Should be an easy change. No problem. It'll actually be easier to do copy paste code type testing on to the shell with spaces instead of tab. (tab characters cause 'tab completions' to activate during copy paste, which makes things look weird...)

"I'm not so sure how I feel about starting another _window manager_ just because a decorator wasn't found, but this code was here before so I don't mind too much."
I thought the same thing, and left it in there as a 'just in case', and 'it must have been added for a reason'..., If this code causes problems, it can be taken out without too much trouble.

Revision history for this message
Sam Spilsbury (smspillaz) wrote : Posted in a previous version of this proposal

> COMPIZ_BIN_PATH=$(cd $(dirname "$0"); vs COMPIZ_BIN_PATH=`dirname "$0"`
> The first always gives the full path; The second changes based on how it's
> called. Put it in a script and it'll change based on how the script is called.
> Like is it called via a relative path, or via a full path? I suppose for this
> script this line could be done either way, although I haven't tested the
> script with the second.
>
> you can try it out...
> put this in a file and run different ways
>
> # a quickly made example...
> # with this code in /opt/CompizBZR/bin/pathTest.sh
>
> THIS_PATH_1=$(cd $(dirname "$0"); pwd)
> echo $THIS_PATH_1
>
> THIS_PATH_2=`dirname "$0"`
> echo $THIS_PATH_2
>
> # results:
> # called from /opt/CompizBZR/ with /opt/CompizBZR/bin/pathTests.sh
> # /opt/CompizBZR/bin
> # /opt/CompizBZR/bin
>
> # also called from /opt/CompizBZR/ with ./bin/pathTests.sh
> # /opt/CompizBZR/bin
> # ./bin
>
> # called from ~/ with ../../opt/CompizBZR/bin/pathTests.sh
> # /opt/CompizBZR/bin
> # ../../opt/CompizBZR/bin
>
> # called from /opt/CompizBZR/bin/ with ./pathTests.sh
> # ./pathTests.sh
> # /opt/CompizBZR/bin

Ah okay, what I might suggest is readlink -e, eg

readlink -e "$0"

That works regardless of the path, and it also resolves symlinks too.

Changing the pwd is a bit of a kludge and can get messy if the script crashes or gets killed in-between.

>
> "There's lots of commented out code in the review version."
> This was my first time messing with bzr, and Compiz submissions. I'm guessing
> I hit submit for review too soon?, and guessing it doesn't update which code
> to review? and so you might reviewed an earlier version?
> (And I should resubmit again after changing tabs to 4 spaces?)

It will automatically update. Resubmit if you want - it just sends me another email notification that's all :)

>
> The one I should have submitted should have been done after 3751 `chmod +x`,
> the last thing I've done with this code. I hadn't thought of any changes to do
> with it since then, and it's working for me, so I guess I'm done with this set
> of edits, except for now messing with what you said, the using four spaces in
> place of a tab.
>
> "These changes are inconsistent with the coding style. Use 8-wide tabs for two
> indents and 4-spaces for one indent, or, if the language doesn't support it,
> use 4-spaces for indents."
> I didn't know about the coding style. Where can I read it?
> Should be an easy change. No problem. It'll actually be easier to do copy
> paste code type testing on to the shell with spaces instead of tab. (tab
> characters cause 'tab completions' to activate during copy paste, which makes
> things look weird...)
>

Revision history for this message
Sam Spilsbury (smspillaz) wrote : Posted in a previous version of this proposal

> The one I should have submitted should have been done after 3751 `chmod +x`,
> the last thing I've done with this code. I hadn't thought of any changes to do
> with it since then, and it's working for me, so I guess I'm done with this set
> of edits, except for now messing with what you said, the using four spaces in
> place of a tab.
>
> "These changes are inconsistent with the coding style. Use 8-wide tabs for two
> indents and 4-spaces for one indent, or, if the language doesn't support it,
> use 4-spaces for indents."
> I didn't know about the coding style. Where can I read it?
> Should be an easy change. No problem. It'll actually be easier to do copy
> paste code type testing on to the shell with spaces instead of tab. (tab
> characters cause 'tab completions' to activate during copy paste, which makes
> things look weird...)
>

Oops - I was going to mention. This is on wiki.compiz.org, but that's down again. I'll grab the link as soon as it comes back up. Basically:

 1. 8-wide tab for two indents, 4 spaces for the last indent for odd indent levels
 2. Space in-between () and identifiers
 3. camelCase
 4. Braces fall on the same line as the start of the control condition, eg:

    if (1)
    {
    }

Revision history for this message
BryanFRitt (bryanfritt) wrote : Posted in a previous version of this proposal

"This is on wiki.compiz.org, but that's down again. I'll grab the link as soon as it comes back up."
It's been down for quite a while, a "(it no longer loads, at least for me)" was written "2013-06-30", and it's still down for me.

"These changes are inconsistent with the coding style. Use 8-wide tabs for two indents and 4-spaces for one indent, or, if the language doesn't support it, use 4-spaces for indents."
"1. 8-wide tab for two indents, 4 spaces for the last indent for odd indent levels"
I replaced every indention tab with four spaces. Upon reading again, I'm not sure if that's what you meant. What did you mean by "last indent", and "odd indent levels", etc...?

Revision history for this message
Sam Spilsbury (smspillaz) wrote : Posted in a previous version of this proposal

So, for example:

1 indent: 4 spaces
2 indents: 1 tab
3 indents: 1 tab, 4 spaces
4 indents: 2 tabs
5 indents: 2 tabs, 4 spaces

etc

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

Please re-target to lp:compiz

review: Needs Resubmitting
Revision history for this message
BryanFRitt (bryanfritt) wrote : Posted in a previous version of this proposal

> So, for example:
>
> 1 indent: 4 spaces
> 2 indents: 1 tab
> 3 indents: 1 tab, 4 spaces
> 4 indents: 2 tabs
> 5 indents: 2 tabs, 4 spaces
>
> etc

Even with a Bash script too? If you try to drag and drop a line of code onto a Bash terminal window, everywhere there's a tab it'll try to do a tab completion(`ls` or whatever it's called). Which looks weird, even though it doesn't affect how the code runs. Spaces instead of tabs would be good for those who want to test parts of the script out this way.

> camelCase
In Bash environment variables, and global variables, are conventionally done in all UPPERCASE
http://stackoverflow.com/questions/673055/correct-bash-and-shell-script-variable-capitalization

> Please re-target to lp:compiz

What does this mean? / How to?

Revision history for this message
MC Return (mc-return) wrote : Posted in a previous version of this proposal

> > So, for example:
> >
> > 1 indent: 4 spaces
> > 2 indents: 1 tab
> > 3 indents: 1 tab, 4 spaces
> > 4 indents: 2 tabs
> > 5 indents: 2 tabs, 4 spaces
> >
> > etc
>
> Even with a Bash script too? If you try to drag and drop a line of code onto a
> Bash terminal window, everywhere there's a tab it'll try to do a tab
> completion(`ls` or whatever it's called). Which looks weird, even though it
> doesn't affect how the code runs. Spaces instead of tabs would be good for
> those who want to test parts of the script out this way.
>
I agree that the C++ X11 indentation style is not needed and would look weird in bash scripts.

> > camelCase
> In Bash environment variables, and global variables, are conventionally done
> in all UPPERCASE
> http://stackoverflow.com/questions/673055/correct-bash-and-shell-script-
> variable-capitalization
>
I agree here also.

> > Please re-target to lp:compiz
>
> What does this mean? / How to?

1. Copy your commit message (as you will need it again).
2. Open your branch: lp:~bryanfritt/compiz/compiz-decorator_script-edit_1192376
3. Propose a new merge into lp:compiz, which is Compiz 0.9.11-dev now (this here is now lp:compiz/0.9.10).
4. Paste your commit message again, when you're done.

Revision history for this message
BryanFRitt (bryanfritt) wrote : Posted in a previous version of this proposal

1. Copy your commit message (as you will need it again).
2. Open your branch: lp:~bryanfritt/compiz/compiz-decorator_script-edit_1192376
3. Propose a new merge into lp:compiz, which is Compiz 0.9.11-dev now (this here is now lp:compiz/0.9.10).
4. Paste your commit message again, when you're done.

"The proposal to merge lp:~bryanfritt/compiz/compiz-decorator_script-edit_1192376 into lp:compiz has been updated."
"This proposal has been superseded by a proposal from 2013-07-24."

I guess this means someone got to it before me. (that's fine by me)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
BryanFRitt (bryanfritt) wrote :

> FAILED: Continuous integration, rev:3754
> http://jenkins.qa.ubuntu.com/job/compiz-ci/285/
> Executed test runs:
> FAILURE: http://jenkins.qa.ubuntu.com/job/compiz-saucy-amd64-ci/98/console
> FAILURE: http://jenkins.qa.ubuntu.com/job/compiz-saucy-armhf-ci/98/console
> FAILURE: http://jenkins.qa.ubuntu.com/job/compiz-saucy-i386-ci/98/console
>
> Click here to trigger a rebuild:
> http://s-jenkins:8080/job/compiz-ci/285/rebuild

patching file plugins/decor/decor.xml.in
Hunk #4 FAILED at 101.
1 out of 4 hunks FAILED -- rejects in file plugins/decor/decor.xml.in

Does that mean it didn't like this?
<default>exec ${COMPIZ_BIN_PATH}/compiz-decorator</default>
line 104 in decor.xml.in

Which affects
`ccsm` program->'Effects' section->'Window Decoration' plugin->'General' tab->'Command' option->'Reset' button.

I tried something like
<default>exec "${COMPIZ_BIN_PATH}/compiz-decorator"</default>
and it didn't compile, until I removed the quotes; so I left it unquoted, and it would compile for me.

It probably should be quoted, but that didn't compile for me, until I removed the quotes, but it seams like it still failed for PS Jenkins bot (ps-jenkins)

with
<default>exec "${COMPIZ_BIN_PATH}/compiz-decorator"</default>
make gives
.../build/generated/decor_options.cpp:83:68: error: expected ')' before '$'
At global scope:
cc1plus: error: unrecognized command line option "-Wno-unused-private-field" [-Werror]
cc1plus: error: unrecognized command line option "-Wno-unused-private-field" [-Werror]
cc1plus: error: unrecognized command line option "-Wno-unused-private-field" [-Werror]
cc1plus: error: unrecognized command line option "-Wno-unused-private-field" [-Werror]
cc1plus: error: unrecognized command line option "-Wno-unused-private-field" [-Werror]
cc1plus: error: unrecognized command line option "-Wno-unused-private-field" [-Werror]
cc1plus: all warnings being treated as errors
make[2]: *** [plugins/decor/CMakeFiles/decor.dir/__/__/generated/decor_options.cpp.o] Error 1
make[1]: *** [plugins/decor/CMakeFiles/decor.dir/all] Error 2
make: *** [all] Error 2

tried
exec \"${COMPIZ_BIN_PATH}/compiz-decorator\"
makes the default
exec \"${COMPIZ_BIN_PATH}/compiz-decorator\"

tried
exec ""${COMPIZ_BIN_PATH}/compiz-decorator""
makes the default
exec ""${COMPIZ_BIN_PATH}/compiz-decorator""

tried
exec '${COMPIZ_BIN_PATH}/compiz-decorator'
makes the default
exec '${COMPIZ_BIN_PATH}/compiz-decorator'

ME=Blah
echo '${ME}/hi'
{ME}/hi

echo "${ME}/hi"
Blah/hi

with
<default>exec &quot${COMPIZ_BIN_PATH}/compiz-decorator&quot</default>
make gives
not well-formed (invalid token) at line 104, column 21, byte 3100 at /usr/lib/perl5/XML/Parser.pm line 187
make[2]: *** [generated/decor.xml] Error 255
make[1]: *** [plugins/decor/CMakeFiles/decor.dir/all] Error 2
make: *** [all] Error 2

...

How can this be made to make the default
exec "${COMPIZ_BIN_PATH}/compiz-decorator"
and to be able to compile for me, and PS Jenkins bot (ps-jenkins) ?

Revision history for this message
Sam Spilsbury (smspillaz) wrote :
Download full text (3.6 KiB)

You need to update the distro patch:

sudo apt-get install quilt;
export QUILT_PATCHES=debian/patches
quilt push -fa
*edit the file where hunks from the patch did not apply such that the patch
is applied "by hand"*
quilt refresh
quilt pop -fa
bzr commit

On Wed, Jul 24, 2013 at 10:53 PM, BryanFRitt <email address hidden> wrote:

> > FAILED: Continuous integration, rev:3754
> > http://jenkins.qa.ubuntu.com/job/compiz-ci/285/
> > Executed test runs:
> > FAILURE:
> http://jenkins.qa.ubuntu.com/job/compiz-saucy-amd64-ci/98/console
> > FAILURE:
> http://jenkins.qa.ubuntu.com/job/compiz-saucy-armhf-ci/98/console
> > FAILURE:
> http://jenkins.qa.ubuntu.com/job/compiz-saucy-i386-ci/98/console
> >
> > Click here to trigger a rebuild:
> > http://s-jenkins:8080/job/compiz-ci/285/rebuild
>
> patching file plugins/decor/decor.xml.in
> Hunk #4 FAILED at 101.
> 1 out of 4 hunks FAILED -- rejects in file plugins/decor/decor.xml.in
>
> Does that mean it didn't like this?
> <default>exec ${COMPIZ_BIN_PATH}/compiz-decorator</default>
> line 104 in decor.xml.in
>
> Which affects
> `ccsm` program->'Effects' section->'Window Decoration' plugin->'General'
> tab->'Command' option->'Reset' button.
>
> I tried something like
> <default>exec "${COMPIZ_BIN_PATH}/compiz-decorator"</default>
> and it didn't compile, until I removed the quotes; so I left it unquoted,
> and it would compile for me.
>
> It probably should be quoted, but that didn't compile for me, until I
> removed the quotes, but it seams like it still failed for PS Jenkins bot
> (ps-jenkins)
>
> with
> <default>exec "${COMPIZ_BIN_PATH}/compiz-decorator"</default>
> make gives
> .../build/generated/decor_options.cpp:83:68: error: expected ')' before '$'
> At global scope:
> cc1plus: error: unrecognized command line option
> "-Wno-unused-private-field" [-Werror]
> cc1plus: error: unrecognized command line option
> "-Wno-unused-private-field" [-Werror]
> cc1plus: error: unrecognized command line option
> "-Wno-unused-private-field" [-Werror]
> cc1plus: error: unrecognized command line option
> "-Wno-unused-private-field" [-Werror]
> cc1plus: error: unrecognized command line option
> "-Wno-unused-private-field" [-Werror]
> cc1plus: error: unrecognized command line option
> "-Wno-unused-private-field" [-Werror]
> cc1plus: all warnings being treated as errors
> make[2]: ***
> [plugins/decor/CMakeFiles/decor.dir/__/__/generated/decor_options.cpp.o]
> Error 1
> make[1]: *** [plugins/decor/CMakeFiles/decor.dir/all] Error 2
> make: *** [all] Error 2
>
> tried
> exec \"${COMPIZ_BIN_PATH}/compiz-decorator\"
> makes the default
> exec \"${COMPIZ_BIN_PATH}/compiz-decorator\"
>
> tried
> exec ""${COMPIZ_BIN_PATH}/compiz-decorator""
> makes the default
> exec ""${COMPIZ_BIN_PATH}/compiz-decorator""
>
> tried
> exec '${COMPIZ_BIN_PATH}/compiz-decorator'
> makes the default
> exec '${COMPIZ_BIN_PATH}/compiz-decorator'
>
> ME=Blah
> echo '${ME}/hi'
> {ME}/hi
>
> echo "${ME}/hi"
> Blah/hi
>
> with
> <default>exec &quot${COMPIZ_BIN_PATH}/compiz-decorator&quot</default>
> make gives
> not well-formed (invalid token) at line 104, column 21, byte 3100 at
> /usr/lib/perl5/XML/Parser.pm line 187
> make[2]: *** [gener...

Read more...

Revision history for this message
BryanFRitt (bryanfritt) wrote :

> You need to update the distro patch:
>
> sudo apt-get install quilt;
> export QUILT_PATCHES=debian/patches
> quilt push -fa
> *edit the file where hunks from the patch did not apply such that the patch
> is applied "by hand"*
> quilt refresh
> quilt pop -fa
> bzr commit

patching file plugins/decor/decor.xml.in
Hunk #4 FAILED at 101.
1 out of 4 hunks FAILED -- saving rejects to file plugins/decor/decor.xml.in.rej

<default>/usr/bin/gtk-window-decorator</default>
vs.
<default>exec \"${COMPIZ_BIN_PATH}compiz-decorator\"</default>
vs.
<default>exec ${COMPIZ_BIN_PATH}/compiz-decorator</default>
and
exec "${COMPIZ_BIN_PATH}/compiz-decorator"
Question:
Is COMPIZ_BIN_PATH set up automatically for this, or does the user have to set it up?
`ccsm` program->'Effects' section->'Window Decoration' plugin->'General' tab->'Command' option->...

Even though this can't put quote around the path (so the path could have a space), it's still better than <default>exec \"${COMPIZ_BIN_PATH}compiz-decorator\"</default>

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Unmerged revisions

3755. By BryanFRitt

https://code.launchpad.net/~bryanfritt/compiz/compiz-decorator_script-edit_1192376/+merge/176814/comments/397598
"update the distro patch"

3754. By BryanFRitt

improved comments

3753. By BryanFRitt

bzr merge, Merged lp:compiz

3752. By BryanFRitt

replaced tabs with 4 spaces
and replaced
COMPIZ_BIN_PATH=$(cd $(dirname "$0"); pwd)
with
COMPIZ_BIN_PATH="$(dirname $(readlink -e "$0"))"
https://code.launchpad.net/~bryanfritt/compiz/compiz-decorator_script-edit_1192376/+merge/171005/comments/391959

3751. By BryanFRitt

chmod +x

3750. By BryanFRitt

removed some '\n'

3749. By BryanFRitt

Changed an 'echo' to a 'verbose'.

3748. By BryanFRitt

replaced a printf "$*" with a echo "$@" ...

3747. By BryanFRitt

moved stuff around

3746. By BryanFRitt

expanded quoting range

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/patches/ubuntu-config.patch'
2--- debian/patches/ubuntu-config.patch 2013-07-23 23:30:23 +0000
3+++ debian/patches/ubuntu-config.patch 2013-07-25 07:29:27 +0000
4@@ -1,6 +1,8 @@
5 === modified file 'metadata/core.xml.in'
6---- a/metadata/core.xml.in
7-+++ b/metadata/core.xml.in
8+Index: compiz-decorator_script-edit_1192376/metadata/core.xml.in
9+===================================================================
10+--- compiz-decorator_script-edit_1192376.orig/metadata/core.xml.in 2013-06-27 20:22:24.000000000 -0400
11++++ compiz-decorator_script-edit_1192376/metadata/core.xml.in 2013-07-25 02:20:57.000000000 -0400
12 @@ -139,7 +139,7 @@
13 <option name="focus_prevention_match" type="match">
14 <_short>Focus Prevention Windows</_short>
15@@ -63,8 +65,10 @@
16 <min>1</min>
17 <max>32</max>
18 </option>
19---- a/plugins/animation/animation.xml.in
20-+++ b/plugins/animation/animation.xml.in
21+Index: compiz-decorator_script-edit_1192376/plugins/animation/animation.xml.in
22+===================================================================
23+--- compiz-decorator_script-edit_1192376.orig/plugins/animation/animation.xml.in 2013-06-27 20:22:24.000000000 -0400
24++++ compiz-decorator_script-edit_1192376/plugins/animation/animation.xml.in 2013-07-25 02:20:57.000000000 -0400
25 @@ -36,7 +36,7 @@
26 <extensible/>
27 <sort start="2"/>
28@@ -203,8 +207,10 @@
29 <min>0</min>
30 <max>1</max>
31 <precision>0.01</precision>
32---- a/plugins/decor/decor.xml.in
33-+++ b/plugins/decor/decor.xml.in
34+Index: compiz-decorator_script-edit_1192376/plugins/decor/decor.xml.in
35+===================================================================
36+--- compiz-decorator_script-edit_1192376.orig/plugins/decor/decor.xml.in 2013-06-27 20:22:24.000000000 -0400
37++++ compiz-decorator_script-edit_1192376/plugins/decor/decor.xml.in 2013-07-25 02:20:57.000000000 -0400
38 @@ -31,7 +31,7 @@
39 <option name="active_shadow_opacity" type="float">
40 <_short>Shadow Opacity</_short>
41@@ -232,17 +238,10 @@
42 <min>0.01</min>
43 <max>6.0</max>
44 <precision>0.01</precision>
45-@@ -101,7 +101,7 @@
46- <option name="command" type="string">
47- <_short>Command</_short>
48- <_long>Decorator command line that is executed if no decorator is already running.</_long>
49-- <default>exec \"${COMPIZ_BIN_PATH}compiz-decorator\"</default>
50-+ <default>/usr/bin/gtk-window-decorator</default>
51- </option>
52- <option name="mipmap" type="bool">
53- <_short>Mipmap</_short>
54---- a/plugins/fade/fade.xml.in
55-+++ b/plugins/fade/fade.xml.in
56+Index: compiz-decorator_script-edit_1192376/plugins/fade/fade.xml.in
57+===================================================================
58+--- compiz-decorator_script-edit_1192376.orig/plugins/fade/fade.xml.in 2013-06-27 20:22:24.000000000 -0400
59++++ compiz-decorator_script-edit_1192376/plugins/fade/fade.xml.in 2013-07-25 02:20:57.000000000 -0400
60 @@ -10,6 +10,7 @@
61 </requirement>
62 <relation type="after">
63@@ -260,8 +259,10 @@
64 </option>
65 <option name="visual_bell" type="bell">
66 <_short>Visual Bell</_short>
67---- a/plugins/gnomecompat/gnomecompat.xml.in
68-+++ b/plugins/gnomecompat/gnomecompat.xml.in
69+Index: compiz-decorator_script-edit_1192376/plugins/gnomecompat/gnomecompat.xml.in
70+===================================================================
71+--- compiz-decorator_script-edit_1192376.orig/plugins/gnomecompat/gnomecompat.xml.in 2013-06-27 20:22:24.000000000 -0400
72++++ compiz-decorator_script-edit_1192376/plugins/gnomecompat/gnomecompat.xml.in 2013-07-25 02:20:57.000000000 -0400
73 @@ -53,6 +53,7 @@
74 <option name="run_command_terminal_key" type="key">
75 <_short>Open a terminal</_short>
76@@ -270,8 +271,10 @@
77 </option>
78 </group>
79 </options>
80---- a/plugins/place/place.xml.in
81-+++ b/plugins/place/place.xml.in
82+Index: compiz-decorator_script-edit_1192376/plugins/place/place.xml.in
83+===================================================================
84+--- compiz-decorator_script-edit_1192376.orig/plugins/place/place.xml.in 2013-06-27 20:22:24.000000000 -0400
85++++ compiz-decorator_script-edit_1192376/plugins/place/place.xml.in 2013-07-25 02:20:58.000000000 -0400
86 @@ -20,8 +20,8 @@
87 <option name="mode" type="int">
88 <_short>Placement Mode</_short>
89@@ -283,8 +286,10 @@
90 <max>5</max>
91 <desc>
92 <value>0</value>
93---- a/plugins/resize/resize.xml.in
94-+++ b/plugins/resize/resize.xml.in
95+Index: compiz-decorator_script-edit_1192376/plugins/resize/resize.xml.in
96+===================================================================
97+--- compiz-decorator_script-edit_1192376.orig/plugins/resize/resize.xml.in 2013-06-27 20:22:24.000000000 -0400
98++++ compiz-decorator_script-edit_1192376/plugins/resize/resize.xml.in 2013-07-25 02:20:58.000000000 -0400
99 @@ -28,7 +28,7 @@
100 <option name="mode" type="int">
101 <_short>Default Resize Mode</_short>
102@@ -329,8 +334,10 @@
103 </default>
104 </option>
105 <subgroup>
106---- a/plugins/scale/scale.xml.in
107-+++ b/plugins/scale/scale.xml.in
108+Index: compiz-decorator_script-edit_1192376/plugins/scale/scale.xml.in
109+===================================================================
110+--- compiz-decorator_script-edit_1192376.orig/plugins/scale/scale.xml.in 2013-06-27 20:22:24.000000000 -0400
111++++ compiz-decorator_script-edit_1192376/plugins/scale/scale.xml.in 2013-07-25 02:20:58.000000000 -0400
112 @@ -19,14 +19,14 @@
113 <option name="spacing" type="int">
114 <_short>Spacing</_short>
115@@ -419,8 +426,10 @@
116 </option>
117 </group>
118 </options>
119---- a/plugins/staticswitcher/staticswitcher.xml.in
120-+++ b/plugins/staticswitcher/staticswitcher.xml.in
121+Index: compiz-decorator_script-edit_1192376/plugins/staticswitcher/staticswitcher.xml.in
122+===================================================================
123+--- compiz-decorator_script-edit_1192376.orig/plugins/staticswitcher/staticswitcher.xml.in 2013-06-27 20:22:24.000000000 -0400
124++++ compiz-decorator_script-edit_1192376/plugins/staticswitcher/staticswitcher.xml.in 2013-07-25 02:20:58.000000000 -0400
125 @@ -11,7 +11,6 @@
126 <relation type="after">
127 <plugin>composite</plugin>
128@@ -497,8 +506,10 @@
129 <desc>
130 <value>0</value>
131 <_name>None</_name>
132---- a/plugins/vpswitch/vpswitch.xml.in
133-+++ b/plugins/vpswitch/vpswitch.xml.in
134+Index: compiz-decorator_script-edit_1192376/plugins/vpswitch/vpswitch.xml.in
135+===================================================================
136+--- compiz-decorator_script-edit_1192376.orig/plugins/vpswitch/vpswitch.xml.in 2013-06-27 20:22:24.000000000 -0400
137++++ compiz-decorator_script-edit_1192376/plugins/vpswitch/vpswitch.xml.in 2013-07-25 02:20:58.000000000 -0400
138 @@ -95,13 +95,11 @@
139 <option name="next_button" type="button">
140 <_short>Move Next</_short>
141@@ -513,8 +524,10 @@
142 <internal/>
143 </option>
144 <option name="initiate_button" type="button">
145---- a/plugins/wall/wall.xml.in
146-+++ b/plugins/wall/wall.xml.in
147+Index: compiz-decorator_script-edit_1192376/plugins/wall/wall.xml.in
148+===================================================================
149+--- compiz-decorator_script-edit_1192376.orig/plugins/wall/wall.xml.in 2013-06-27 20:22:24.000000000 -0400
150++++ compiz-decorator_script-edit_1192376/plugins/wall/wall.xml.in 2013-07-25 02:20:58.000000000 -0400
151 @@ -30,12 +30,12 @@
152 <option name="miniscreen" type="bool">
153 <_short>Show Live Viewport Previews</_short>
154@@ -662,8 +675,10 @@
155 </option>
156 <option name="edgeflip_dnd" type="bool">
157 <_short>Edge Flip DnD</_short>
158---- a/tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp
159-+++ b/tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp
160+Index: compiz-decorator_script-edit_1192376/tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp
161+===================================================================
162+--- compiz-decorator_script-edit_1192376.orig/tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp 2013-06-27 20:22:24.000000000 -0400
163++++ compiz-decorator_script-edit_1192376/tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp 2013-07-25 02:20:58.000000000 -0400
164 @@ -46,7 +46,7 @@
165
166 namespace
167@@ -673,8 +688,10 @@
168 unsigned int DEFAULT_VIEWPORT_HEIGHT = 1;
169
170 bool Advance (Display *d, bool r)
171---- a/plugins/grid/grid.xml.in
172-+++ b/plugins/grid/grid.xml.in
173+Index: compiz-decorator_script-edit_1192376/plugins/grid/grid.xml.in
174+===================================================================
175+--- compiz-decorator_script-edit_1192376.orig/plugins/grid/grid.xml.in 2013-06-27 20:22:24.000000000 -0400
176++++ compiz-decorator_script-edit_1192376/plugins/grid/grid.xml.in 2013-07-25 02:20:58.000000000 -0400
177 @@ -23,17 +23,16 @@
178 <option name="put_center_key" type="key">
179 <_short>Put Center Key</_short>
180@@ -709,8 +726,10 @@
181 </option>
182 </group>
183 <group>
184---- a/plugins/ezoom/ezoom.xml.in
185-+++ b/plugins/ezoom/ezoom.xml.in
186+Index: compiz-decorator_script-edit_1192376/plugins/ezoom/ezoom.xml.in
187+===================================================================
188+--- compiz-decorator_script-edit_1192376.orig/plugins/ezoom/ezoom.xml.in 2013-06-27 20:22:24.000000000 -0400
189++++ compiz-decorator_script-edit_1192376/plugins/ezoom/ezoom.xml.in 2013-07-25 02:20:58.000000000 -0400
190 @@ -30,7 +30,7 @@
191 <option type="button" name="zoom_in_button">
192 <_short>Zoom In Button</_short>
193@@ -747,8 +766,10 @@
194 </option>
195 </subgroup>
196 </group>
197---- a/plugins/expo/expo.xml.in
198-+++ b/plugins/expo/expo.xml.in
199+Index: compiz-decorator_script-edit_1192376/plugins/expo/expo.xml.in
200+===================================================================
201+--- compiz-decorator_script-edit_1192376.orig/plugins/expo/expo.xml.in 2013-07-16 22:31:18.000000000 -0400
202++++ compiz-decorator_script-edit_1192376/plugins/expo/expo.xml.in 2013-07-25 02:20:58.000000000 -0400
203 @@ -17,6 +17,7 @@
204 <plugin>wobbly</plugin>
205 <plugin>animation</plugin>
206
207=== modified file 'plugins/decor/decor.xml.in'
208--- plugins/decor/decor.xml.in 2012-10-15 10:31:51 +0000
209+++ plugins/decor/decor.xml.in 2013-07-25 07:29:27 +0000
210@@ -101,7 +101,7 @@
211 <option name="command" type="string">
212 <_short>Command</_short>
213 <_long>Decorator command line that is executed if no decorator is already running.</_long>
214- <default>exec \"${COMPIZ_BIN_PATH}compiz-decorator\"</default>
215+ <default>exec ${COMPIZ_BIN_PATH}/compiz-decorator</default>
216 </option>
217 <option name="mipmap" type="bool">
218 <_short>Mipmap</_short>
219
220=== modified file 'plugins/decor/src/compiz-decorator'
221--- plugins/decor/src/compiz-decorator 2012-06-18 06:22:29 +0000
222+++ plugins/decor/src/compiz-decorator 2013-07-25 07:29:27 +0000
223@@ -1,6 +1,7 @@
224 #!/bin/sh
225+#
226 # Starts Compiz Decorator depending on the DE
227-#
228+#
229 # Copyright (c) 2007 CyberOrg <cyberorg@cyberorg.info>
230 # Based on compiz-manager script by Kristian Lyngstøl <kristian@bohemians.org>
231 # This program is free software; you can redistribute it and/or modify
232@@ -20,82 +21,81 @@
233 #
234 # Contributions by: crdlb
235 # Modifications by: Daniel van Vugt <daniel.van.vugt@canonical.com>
236-#
237-
238-if [ -z "$COMPIZ_BIN_PATH" ]; then
239- COMPIZ_BIN_PATH="/usr/bin/"
240-fi
241-KWIN=`which kwin`
242-METACITY="/usr/bin/metacity"
243-
244-#
245-# Default to gtk/kde4-window-decorator
246-#
247+# Additional Changes by: BryanFRitt
248+
249+# Default to gtk-window-decorator or kde4-window-decorator
250 USE_EMERALD="no"
251 DECORATOR=""
252-
253-#Do not leave users without decoration if decorator fails
254-if [ "$DESKTOP_SESSION" = "kde" ]; then
255- FALLBACKWM="${KWIN}"
256-else
257- FALLBACKWM="${METACITY}"
258-fi
259-FALLBACKWM_OPTIONS=" --replace"
260-
261-#
262 # Set to yes to enable verbose
263-#
264 VERBOSE="yes"
265-
266-#
267+
268 # Echos the arguments if verbose
269-#
270 verbose()
271 {
272- if [ "x$VERBOSE" = "xyes" ]; then
273- printf "$*"
274+ if [ "${VERBOSE}" = "yes" ]; then
275+ echo "$@"
276 fi
277 }
278
279+# Set COMPIZ_BIN_PATH if need be
280+if [ -z "${COMPIZ_BIN_PATH}" ]; then
281+ # two options to setup COMPIZ_BIN_PATH...
282+ # 1) set COMPIZ_BIN_PATH to a specific directory, like this one:
283+ #COMPIZ_BIN_PATH="/usr/bin/"
284+ # xor 2) set COMPIZ_BIN_PATH to the directory that this file is in, like this one:
285+ COMPIZ_BIN_PATH="$(dirname $(readlink -e "$0"))"
286+ #verbose "COMPIZ_BIN_PATH=\"${COMPIZ_BIN_PATH}\""
287+fi
288+
289 # Read configuration from XDG paths
290-if [ -z "$XDG_CONFIG_DIRS" ]; then
291- test -f /etc/xdg/compiz/compiz-manager && . /etc/xdg/compiz/compiz-manager
292-else
293- test -f $XDG_CONFIG_DIRS/compiz/compiz-manager && . $XDG_CONFIG_DIRS/compiz/compiz-manager
294-fi
295-
296-if [ -z "$XDG_CONFIG_HOME" ]; then
297- test -f $HOME/.config/compiz/compiz-manager && . $HOME/.config/compiz/compiz-manager
298-else
299- test -f $XDG_CONFIG_HOME/compiz/compiz-manager && . $XDG_CONFIG_HOME/compiz/compiz-manager
300-fi
301-
302-# start a decorator
303-if [ -x ${COMPIZ_BIN_PATH}emerald ] && [ "$USE_EMERALD" = "yes" ]; then
304- DECORATOR=emerald
305-elif [ -x ${COMPIZ_BIN_PATH}gtk-window-decorator ] && [ -n "$GNOME_DESKTOP_SESSION_ID" ]; then
306- DECORATOR=gtk-window-decorator
307-elif [ -x ${COMPIZ_BIN_PATH}kde4-window-decorator ] && [ x$KDE_SESSION_VERSION = x"4" ]; then
308- DECORATOR=kde4-window-decorator
309-fi
310-
311-# fall back to any decorator that is installed
312-if [ -z "$DECORATOR" ]; then
313- verbose "Couldn't find a perfect decorator match; trying all decorators\n"
314- if [ -x ${COMPIZ_BIN_PATH}emerald ]; then
315- DECORATOR=emerald
316- elif [ -x ${COMPIZ_BIN_PATH}gtk-window-decorator ]; then
317- DECORATOR=gtk-window-decorator
318- elif [ -x ${COMPIZ_BIN_PATH}kde4-window-decorator ]; then
319- DECORATOR=kde4-window-decorator
320- fi
321-fi
322-
323-if [ -n "$DECORATOR" ]; then
324- verbose "Starting ${DECORATOR}\n"
325- exec ${COMPIZ_BIN_PATH}$DECORATOR "$@"
326-else
327- verbose "Found no decorator to start\n"
328- exec $FALLBACKWM $FALLBACKWM_OPTIONS
329+if [ -z "${XDG_CONFIG_DIRS}" ]; then
330+ test -f "/etc/xdg/compiz/compiz-manager" && . "/etc/xdg/compiz/compiz-manager"
331+else
332+ test -f "${XDG_CONFIG_DIRS}/compiz/compiz-manager" && . "${XDG_CONFIG_DIRS}/compiz/compiz-manager"
333+fi
334+
335+if [ -z "${XDG_CONFIG_HOME}" ]; then
336+ test -f "${HOME}/.config/compiz/compiz-manager" && . "${HOME}/.config/compiz/compiz-manager"
337+else
338+ test -f "${XDG_CONFIG_HOME}/compiz/compiz-manager" && . "${XDG_CONFIG_HOME}/compiz/compiz-manager"
339+fi
340+
341+# Pick a decorator
342+if [ -x "${COMPIZ_BIN_PATH}/emerald" ] && [ "{$USE_EMERALD}" = "yes" ]; then
343+ DECORATOR="emerald"
344+elif [ -x "${COMPIZ_BIN_PATH}/gtk-window-decorator" ] && [ -n "${GNOME_DESKTOP_SESSION_ID}" ]; then
345+ DECORATOR="gtk-window-decorator"
346+elif [ -x "${COMPIZ_BIN_PATH}/kde4-window-decorator" ] && [ "${KDE_SESSION_VERSION}" = "4" ]; then
347+ DECORATOR="kde4-window-decorator"
348+fi
349+
350+# If a decorator wasn't picked out, fall back to 1st decorator found
351+if [ -z "${DECORATOR}" ]; then
352+ verbose "Couldn't find a perfect decorator match; using 1st decorator found"
353+ if [ -x "${COMPIZ_BIN_PATH}/emerald" ]; then
354+ DECORATOR="emerald"
355+ elif [ -x "${COMPIZ_BIN_PATH}/gtk-window-decorator" ]; then
356+ DECORATOR="gtk-window-decorator"
357+ elif [ -x "${COMPIZ_BIN_PATH}/kde4-window-decorator" ]; then
358+ DECORATOR="kde4-window-decorator"
359+ fi
360+fi
361+
362+# Start a decorator
363+if [ -n "${DECORATOR}" ]; then
364+ verbose "Starting ${DECORATOR}"
365+ #verbose "exec \"${COMPIZ_BIN_PATH}/${DECORATOR}\" \"$@\" \"--replace\" &"
366+ exec "${COMPIZ_BIN_PATH}/${DECORATOR}" "$@" "--replace" &
367+else
368+ # If there isn't a compiz decorator available, try not leave users without decoration
369+ if [ "${DESKTOP_SESSION}" = "kde-plasma" ]; then
370+ FALLBACKWM=`which kwin` # typically "/usr/bin/kwin"
371+ else
372+ FALLBACKWM=`which metacity` # typically "/usr/bin/metacity"
373+ fi
374+ FALLBACKWM_OPTIONS="--replace"
375+ verbose "Couldn't find a decorator to start, running fallback"
376+ verbose "exec ${FALLBACKWM} ${FALLBACKWM_OPTIONS} &"
377+ exec "${FALLBACKWM}" "${FALLBACKWM_OPTIONS}" &
378 fi
379

Subscribers

People subscribed via source and target branches

to all changes: