'compiz-decorator' file changes

Bug #1192376 reported by BryanFRitt
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Compiz
In Progress
High
BryanFRitt

Bug Description

#!/bin/sh

# Starts Compiz Decorator depending on the DE
#
# Copyright (c) 2007 CyberOrg <email address hidden>
# Based on compiz-manager script by Kristian Lyngstøl <email address hidden>
# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Contributions by: crdlb
# Modifications by: Daniel van Vugt <email address hidden>
#

# changes made by BryanFRitt to compiz-decorator script:
# Does the '/' in paths work differently in script languages/systems?
# added '/' in paths,
# someone TODO:
# put this(or something like it) in as default for the decor plugin Command option:
# exec "${COMPIZ_BIN_PATH}"/compiz-decorator
# changed to `which metacity`
# changed string to compare $DESKTOP_SESSION with, 'plasma-kde'
# added '--replace &' in the calling function,
# --replace, that way it'll replace the current decorator,
# and the ' &' so that the terminal will be freed up.
# IDEA: rename FALLBACKWM_OPTIONS something different, and use the new name instead of the '--replace' I added
# default the bin path is the same as the path of this file, instead of /usr/bin <- if this isn't a good idea, please revert, or change
#

if [ -z "$COMPIZ_BIN_PATH" ]; then
   # COMPIZ_BIN_PATH="/usr/bin/"
   # default to the bin path is in the same path as this file, or do above?
    COMPIZ_BIN_PATH=$(cd $(dirname "$0"); pwd)
    #echo "$COMPIZ_BIN_PATH";
fi
KWIN=`which kwin`
#METACITY="/usr/bin/metacity"
METACITY=`which metacity`
#
# Default to gtk/kde4-window-decorator
#
USE_EMERALD="no"
DECORATOR=""

#Do not leave users without decoration if decorator fails
# try out `echo "$DESKTOP_SESSION"` it gives back "kde-plasma" on KDE
#if [ "$DESKTOP_SESSION" = "kde" ]; then
if [ "$DESKTOP_SESSION" = "kde-plasma" ]; then
 FALLBACKWM="${KWIN}"
else
    FALLBACKWM="${METACITY}"
fi
FALLBACKWM_OPTIONS=" --replace"

#
# Set to yes to enable verbose
#
VERBOSE="yes"

#
# Echos the arguments if verbose
#
verbose()
{
    if [ "x$VERBOSE" = "xyes" ]; then
        printf "$*"
    fi
}

# Read configuration from XDG paths
if [ -z "$XDG_CONFIG_DIRS" ]; then
    test -f /etc/xdg/compiz/compiz-manager && . /etc/xdg/compiz/compiz-manager
else
    test -f $XDG_CONFIG_DIRS/compiz/compiz-manager && . $XDG_CONFIG_DIRS/compiz/compiz-manager
fi

if [ -z "$XDG_CONFIG_HOME" ]; then
    test -f $HOME/.config/compiz/compiz-manager && . $HOME/.config/compiz/compiz-manager
else
    test -f $XDG_CONFIG_HOME/compiz/compiz-manager && . $XDG_CONFIG_HOME/compiz/compiz-manager
fi

# start a decorator
# slashes needed here too
if [ -x ${COMPIZ_BIN_PATH}/emerald ] && [ "$USE_EMERALD" = "yes" ]; then
    DECORATOR=emerald
elif [ -x ${COMPIZ_BIN_PATH}/gtk-window-decorator ] && [ -n "$GNOME_DESKTOP_SESSION_ID" ]; then
    DECORATOR=gtk-window-decorator
elif [ -x ${COMPIZ_BIN_PATH}/kde4-window-decorator ] && [ x$KDE_SESSION_VERSION = x"4" ]; then
    DECORATOR=kde4-window-decorator
fi

# fall back to any decorator that is installed
if [ -z "$DECORATOR" ]; then
    verbose "Couldn't find a perfect decorator match; trying all decorators\n"
# These needs '/' in them to get the path
    if [ -x ${COMPIZ_BIN_PATH}/emerald ]; then
        DECORATOR=emerald
    elif [ -x ${COMPIZ_BIN_PATH}/gtk-window-decorator ]; then
 DECORATOR=gtk-window-decorator
    elif [ -x ${COMPIZ_BIN_PATH}/kde4-window-decorator ]; then
 DECORATOR=kde4-window-decorator
    fi
fi

if [ -n "$DECORATOR" ]; then
    verbose "Starting ${DECORATOR}\n"
# another spot with a '/' needed, also added --replace
    exec ${COMPIZ_BIN_PATH}/$DECORATOR "$@" --replace &
else
    verbose "Found no decorator to start\n"
    exec $FALLBACKWM $FALLBACKWM_OPTIONS
fi

Tags: patch

Related branches

Revision history for this message
BryanFRitt (bryanfritt) wrote :
description: updated
BryanFRitt (bryanfritt)
description: updated
MC Return (mc-return)
Changed in compiz:
milestone: none → 0.9.10.0
importance: Undecided → Medium
tags: added: patch
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Please propose merge requests for changes.

Changed in compiz:
status: New → Incomplete
status: Incomplete → Invalid
Revision history for this message
MC Return (mc-return) wrote :

@bryanfritt:
Can you do that ?

Revision history for this message
BryanFRitt (bryanfritt) wrote :

"Please propose merge requests for changes."

"@bryanfritt:
Can you do that ?"

I'm not sure how to "propose merge requests for changes.".
I suppose I can learn how.
You mean something like this?:
http://doc.bazaar.canonical.com/bzr.dev/en/user-guide/merging_changes.html
and beforehand I can of course make the file better looking for inclusion, like removing comments that are basically there just to show changes, etc...

Revision history for this message
BryanFRitt (bryanfritt) wrote :

I got a message:
"Committed revision 3743. "
Although, it didn't ask me for my password...

Revision history for this message
BryanFRitt (bryanfritt) wrote :
Revision history for this message
BryanFRitt (bryanfritt) wrote :
MC Return (mc-return)
Changed in compiz:
assignee: nobody → MC Return (mc-return)
status: Invalid → New
status: New → Triaged
Revision history for this message
MC Return (mc-return) wrote :

@bryanfritt:
Here you can find information on how to get set up:
https://wiki.ubuntu.com/UbuntuDevelopment/GettingSetUp

Here you can find current merge requests for Compiz:
https://code.launchpad.net/~compiz-team/compiz/0.9.10/+activereviews

If you have any questions, just ask. ;)

Revision history for this message
BryanFRitt (bryanfritt) wrote :

I setup launchpad 'SSH keys' and 'OpenPGP keys', and then ran
bzr push lp:~bryanfritt/compiz/compiz-decorator_script-edit_1192376
Using default stacking branch /+branch-id/736145 at chroot-65422288:///~bryanfritt/compiz/
Created new stacked branch referring to /+branch-id/736145.

Revision history for this message
BryanFRitt (bryanfritt) wrote :

Did that do it?
Is there a way I can view my submissions from a webpage?
What exactly are branch, commit, merge, pull, push, etc...?
and the order on how/when to use them.

Revision history for this message
MC Return (mc-return) wrote :

Very good. :)

You've now created your branch, which is your modified Compiz source.

Explanation of terms:
If you commit something you accept a change and add this change to the (in this case) bazaar version control.
This is the commit you already made: http://bazaar.launchpad.net/~bryanfritt/compiz/compiz-decorator_script-edit_1192376/revision/3743 - it is revision (commit number) 3743.
If you push something in the case of version control this means you upload the sourcecode.
To pull means download in this case.
Merging 2 branches means combining them to one.
If you run "bzr merge lp:compiz" in the console, while in the directory of your branch you can merge in http://bazaar.launchpad.net/~compiz-team/compiz/0.9.10/revision/3743 from trunk for example.
A "bzr diff" shows what has changed, but is not yet committed.
A "bzr commit" would commit this revision into your sourcecode/branch.
A "bzr push" would upload this change to your launchpad account.

Important webpages:
Your Code: https://code.launchpad.net/~bryanfritt
Compiz Home: https://launchpad.net/compiz
Recent lp:compiz Revisions: https://code.launchpad.net/~compiz-team/compiz/0.9.10
Active Code Reviews/Merge Proposals: https://code.launchpad.net/~compiz-team/compiz/0.9.10/+activereviews

Milestones/TODO for 0.9.10: https://launchpad.net/compiz/+milestone/0.9.10.0

Your TODO:
Propose your code for merging into lp:compiz. Do it from here: https://code.launchpad.net/~bryanfritt/compiz/compiz-decorator_script-edit_1192376 ;)

Hope this helps :)

Revision history for this message
MC Return (mc-return) wrote :

*trunk/sometimes also called master is the "main" branch all other branches/Merge Proposals are merged into, once they get approved.

Revision history for this message
MC Return (mc-return) wrote :

Btw., you can also link this bug report to your branch, by clicking "Link a related branch" on the top right side of this page...
This will trigger some automatic mechanisms once your branch is merged into trunk.

Revision history for this message
BryanFRitt (bryanfritt) wrote :

Thanks, I did the 'Merge Proposal'. and the 'Link a related branch'

Right after I submitted the merge proposal, I realized I left in some comments that I meant to remove:
"# These needs '/' in them to get the path", and // lol... and improper grammar too
"#another spot with a '/' needed",
Should I remove them and resubmit a 'merge proposal'? or ignore?

It looks like it shows me as submitting it as "bryan@(none)", and my "launchpad ssh key" is showing up as "bryan@localhost".
Is there a way to change these?

Revision history for this message
MC Return (mc-return) wrote :

Change the stuff you want to change in your branch, then commit it and afterwards push your change to upload it to your branch.

Regarding your name and ssh key: The information used is from here: https://launchpad.net/~bryanfritt
You can of course change it, just re-study https://wiki.ubuntu.com/UbuntuDevelopment/GettingSetUp

Revision history for this message
BryanFRitt (bryanfritt) wrote :

I tried
bzr merge
and got
ERROR: Working tree [tree] has uncommitted changes (See bzr status)

bzr status
gives
modified:
  plugins/decor/src/compiz-decorator
  src/plugin.cpp
pending merge tips: (use -v to see all merge revisions)
  Sam Spilsbury 2013-06-23 [merge] Only mark for no further instantiations...

bzr pull
gives
Using saved parent location: http://bazaar.launchpad.net/~compiz-team/compiz/0.9.10/
bzr: ERROR: These branches have diverged. Use the missing command to see how.
Use the merge command to reconcile them.

bzr missing
gives
You have 1 extra revision
You are missing 2 revisions

bzr commit
gives
modified plugins/decor/src/compiz-decorator
modified src/plugin.cpp
Commit message was not edited, use anyway? ([y]es, [n]o): no
bzr: ERROR: Empty commit message specified. Please specify a commit message with either --message or --file or leave a blank message with --message "".

I didn't make any changes to plugin.cpp.
I've only modified the ./plugins/decor/src/compiz-decorator file.
How can I set it so that it accepts any changes others have made, so I can commit, etc... my changes?

Revision history for this message
MC Return (mc-return) wrote :

Hey.
Probably you merged the latest trunk, which did make changes to plugin.cpp, see here: http://bazaar.launchpad.net/~compiz-team/compiz/0.9.10/revision/3743
but you forgot to commit that merge before you continued to hack on the source.
(You probably did a bzr merge lp:compiz, without a following bzr commit to accept merging trunk into your source)

"bzr revert src/plugin.cpp" will revert the changes to plugin.cpp in your local branch

then a

"bzr diff" will show you if everything is correct now (just your modifications to compiz-decorator should show)

"bzr commit" to accept those changes -> enter a commit message detailing what you did change -> Exit vim with :wq to save and quit

"bzr push" to upload to your branch

Here https://code.launchpad.net/~bryanfritt/compiz/compiz-decorator_script-edit_1192376/+merge/171005 you can check if everything is like you planned it to be ;)

Revision history for this message
MC Return (mc-return) wrote :

I have set your branch to "Work in Progress", please change that to "Needs Review" once your branch is ready for review... ;)

MC Return (mc-return)
Changed in compiz:
assignee: MC Return (mc-return) → nobody
assignee: nobody → BryanFRitt (bryanfritt)
Revision history for this message
BryanFRitt (bryanfritt) wrote :

It asked who I wanted to review it. I put down 'MC Return', if I should have put some one else down let me know.

Revision history for this message
BryanFRitt (bryanfritt) wrote :
MC Return (mc-return)
Changed in compiz:
status: Triaged → In Progress
importance: Medium → High
Changed in compiz:
milestone: 0.9.10.0 → 0.9.10.2
MC Return (mc-return)
Changed in compiz:
milestone: 0.9.10.2 → 0.9.11.0
Stephen M. Webb (bregma)
Changed in compiz:
milestone: 0.9.11.0 → 0.9.12.1
Stephen M. Webb (bregma)
Changed in compiz:
milestone: 0.9.12.1 → 0.9.12.2
Revision history for this message
Harvey Houston (ubuntu-who) wrote :
Download full text (12.8 KiB)

I ran Compiz from a terminal:

$ compiz --replace
compiz (core) - Info: Loading plugin: core
compiz (core) - Info: Starting plugin: core
compiz (core) - Info: Loading plugin: ccp
compiz (core) - Info: Starting plugin: ccp
compizconfig - Info: Backend : gsettings
compizconfig - Info: Integration : true
compizconfig - Info: Profile : unity
compiz (core) - Info: Loading plugin: crashhandler
compiz (core) - Info: Starting plugin: crashhandler
compiz (core) - Info: Loading plugin: composite
compiz (core) - Info: Starting plugin: composite
compiz (core) - Info: Loading plugin: opengl
compiz (core) - Info: Starting plugin: opengl
compiz (core) - Info: Loading plugin: place
compiz (core) - Info: Starting plugin: place
compiz (core) - Info: Loading plugin: compiztoolbox
compiz (core) - Info: Starting plugin: compiztoolbox
compiz (core) - Info: Loading plugin: move
compiz (core) - Info: Starting plugin: move
compiz (core) - Info: Loading plugin: imgsvg
compiz (core) - Info: Starting plugin: imgsvg
compiz (core) - Info: Loading plugin: annotate
compiz (core) - Info: Starting plugin: annotate
compiz (core) - Info: Loading plugin: widget
compiz (core) - Info: Starting plugin: widget
compiz (core) - Info: Loading plugin: switcher
compiz (core) - Info: Starting plugin: switcher
compiz (core) - Info: Loading plugin: imgjpeg
compiz (core) - Info: Starting plugin: imgjpeg
compiz (core) - Info: Loading plugin: grid
compiz (core) - Info: Starting plugin: grid
compiz (core) - Info: Loading plugin: mousepoll
compiz (core) - Info: Starting plugin: mousepoll
compiz (core) - Info: Loading plugin: session
compiz (core) - Info: Starting plugin: session
compiz (core) - Info: Loading plugin: regex
compiz (core) - Info: Starting plugin: regex
compiz (core) - Info: Loading plugin: resize
compiz (core) - Info: Starting plugin: resize
compiz (core) - Info: Loading plugin: imgpng
compiz (core) - Info: Starting plugin: imgpng
compiz (core) - Info: Loading plugin: animation
compiz (core) - Info: Starting plugin: animation
compiz (core) - Info: Loading plugin: workarounds
compiz (core) - Info: Starting plugin: workarounds
compiz (core) - Info: Loading plugin: fade
compiz (core) - Info: Starting plugin: fade
compiz (core) - Info: Loading plugin: trailfocus
compiz (core) - Info: Starting plugin: trailfocus
compiz (core) - Info: Loading plugin: expo
compiz (core) - Info: Starting plugin: expo
compiz (core) - Info: Loading plugin: scale
compiz (core) - Info: Starting plugin: scale
compiz (core) - Info: Loading plugin: unityshell
compiz (core) - Info: Starting plugin: unityshell
WARN 2017-01-25 22:49:47 unity.glib.dbus.server GLibDBusServer.cpp:593 Can't register object 'org.gnome.Shell' yet as we don't have a connection, waiting for it...
WARN 2017-01-25 22:49:47 unity.debug.interface DebugDBusInterface.cpp:217 Unable to load entry point in libxpathselect: libxpathselect.so.1.4: cannot open shared object file: No such file or directory -- full D-Bus introspection will not be available
WARN 2017-01-25 22:49:47 xim.controller XIMController.cpp:103 IBus natively supported.
WARN 2017-01-25 22:49:47 unity.dash.gsettingsscopereader GSettingsScopes.cpp:108 Error fetching protoc...

Revision history for this message
Harvey Houston (ubuntu-who) wrote :

If I posted my previous post in the wrong place, please move it to a more relevant place. Sorry for any inconvenience I may have caused!

Revision history for this message
BryanFRitt (bryanfritt) wrote :

@ Harvey Houston (trusty-goes-in-features)

If you have a new question you should start a new thread.

Are you reporting WARN messages?, or are you having problems with `compiz --replace` that you need help with? The post doesn't have questions in it.

For reporting bugs, etc...
https://bugs.launchpad.net/compiz
You can search through bugs reported with '[ ] Search'.
If you have a new bug goto 'Report a bug'(link is near the top right of the page).
Type in the 'Summary:[ ] Next' field a one line title for your bug.
Do you find your bug already reported? If so click on it and read about it.
If it's not listed, click on 'No, I need to report a new bug'.
Give it 'Summary:' and 'Furher information:', etc...
When completely done click on 'Submit Bug Report'.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.