Last active
November 5, 2017 05:52
-
-
Save CzBiX/8608f3520b92a77c79e0 to your computer and use it in GitHub Desktop.
Patch unity to fix this bug: https://bugs.launchpad.net/ubuntu/+source/unity/+bug/1170647
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: CzBiX | |
# URL: https://gist.github.com/CzBiX/8608f3520b92a77c79e0 | |
DEST_PACKAGE="unity" | |
DEST_VERSION="7.3.2+15.10.20151016-0ubuntu1" | |
DEST_FILE="/usr/lib/compiz/libunityshell.so" | |
DEST_FILE_HASH="d1be69f0dc23f8a69441359b9aea27f4" | |
PATCH_DATA="341b76: 909090909090" | |
SUCCESS_MSG="Please log out to make patch work." | |
function failed { | |
echo >&2 $1; | |
exit 1; | |
} | |
[ $(arch) == 'x86_64' ] || failed "only support x86_64." | |
type xxd >/dev/null 2>&1 || failed "xxd not found, please install vim." | |
[ $(apt-cache policy $DEST_PACKAGE | grep Installed | cut -d ' ' -f 4) == $DEST_VERSION ] || failed "$DEST_PACKAGE version not match with '$DEST_VERSION'." | |
[ $(md5sum $DEST_FILE | cut -d ' ' -f 1) == $DEST_FILE_HASH ] || failed "dest file hash not match" | |
echo $PATCH_DATA | sudo xxd -r - $DEST_FILE || failed "patch failed." | |
echo $SUCCESS_MSG |
After running this for a few days (I have rebooted since I installed this), I have noticed that it seems to work sometimes - however, for some reason, now occasionally (for no clear reason) when I click the Files icon, it will open a new Files window - EVEN IF I only have a location/locations open that are inside my home directory. It has also done this for when the Trash is open. Is this a bug in the patch?
Also, I'm not going to revert this for now (the problem above is less annoying than the problem this patch was designed to fix), but I would suggest adding a line to the script to echo information on how to remove this if you need to.
Thanks, worked like charm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Hitechcomputergeek Thanks your suggest, I think log out should be safer way than
unity --replace
. When I useunity --replace
at past, the window will lost decoration at sometimes.This script will check
unity
package version before patch the file, it's should be safe enough. But you are right, check file hash is the safest way to avoid break user's system. I'll update script later.