Created
September 10, 2019 08:10
-
-
Save 5n00p4eg/bb66842f684f51abdbfd75b853413f66 to your computer and use it in GitHub Desktop.
This file contains 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 | |
FILEPATH=/var/lib/flatpak/app/com.slack.Slack/current/active/files/extra/lib/slack/resources/app.asar.unpacked/src/static/ssb-interop.js | |
COMMENT_START="//SolorizePatchStart//" | |
COMMENT_END="//SolorizePatchEnd//" | |
CODE=" | |
document.addEventListener('DOMContentLoaded', function() { | |
$.ajax({ | |
url: 'https://raw.githubusercontent.com/nakedsushi/solarized-slack/e6bf977ed15d1fdfeb91b354e500a87ce455e985/css/solarized.css', | |
success: function(css) { | |
\$(\"<style></style>\").appendTo('head').html(css); | |
} | |
}); | |
}); | |
" | |
if grep -q "$COMMENT_START" "$FILEPATH"; then | |
echo "File $FILEPATH elready patched" | |
else | |
echo "Patching file $FILEPATH" | |
echo "$COMMENT_START" >> $FILEPATH | |
echo "$CODE" >> $FILEPATH | |
echo "$COMMENT_END" >> $FILEPATH | |
echo "File patched" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment