Created
September 7, 2014 16:31
-
-
Save hsharrison/e54c9334fd8446229146 to your computer and use it in GitHub Desktop.
make-zotero-pane-collapsable
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 | |
# Invoke on zotero-*.xpi Firefox extension file. | |
# Changes zoteroPane.xul to make right pane collapsable. | |
TARGET=chrome/content/zotero/zoteroPane.xul | |
TMP_DIR=/tmp/$(basename "$0") | |
SCRIPT='/<splitter id="zotero-items-splitter"/ { | |
N | |
N | |
s#<.*/>#<splitter id="zotero-items-splitter" resizebefore="closest" resizeafter="closest" collapse="after"\ | |
onmousemove="ZoteroPane_Local.updateToolbarPosition()"\ | |
oncommand="ZoteroPane_Local.updateToolbarPosition()">\ | |
<grippy/>\ | |
</splitter># | |
}' | |
if [ -d "$TMP_DIR" ]; | |
then rm -r "$TMP_DIR" | |
fi | |
mkdir "$TMP_DIR" | |
cp "$1" "$TMP_DIR" | |
cd "$TMP_DIR" > /dev/null | |
unzip "$1" "$TARGET" | |
sed -i "$SCRIPT" "$TARGET" | |
zip "$1" "$TARGET" | |
cd - > /dev/null | |
mv "$TMP_DIR/$(basename $1)" "$1" | |
rm -r "$TMP_DIR" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment