Skip to content

Instantly share code, notes, and snippets.

@VTimofeenko
Last active June 21, 2019 20:43
Show Gist options
  • Save VTimofeenko/43b7730e9743fe936ed1e97b89d72107 to your computer and use it in GitHub Desktop.
Save VTimofeenko/43b7730e9743fe936ed1e97b89d72107 to your computer and use it in GitHub Desktop.
Removing "react" button from Skypeforlinux ebuild

Skype for Linux comes packaged as Electron application. The code describing client behavior is in file app.asar. This file can be edited after emerging to hide the "React" button, which can be done by calling an ebuild hook

Installation

  1. Create /etc/portage/bashrc with content from below
  2. Create /etc/portage/hooks/net-im/skypeforlinux/post-install with content from below
  3. emerge skypeforlinux

Troubleshooting

The hook logs its actions and saves a backup. In case skype does not start after this - replace app.asar with the backed up version.

Notes

This also hides "Expression picker" to the left of chat pane

Credits & further reading

# /etc/portage/bashrc
PORTAGE_HOOKS_PREFIX=/etc/portage/hooks
PACKAGE_HOOKS_DIR="$PORTAGE_HOOKS_PREFIX/$CATEGORY/$PN"
CATEGORY_HOOKS_DIR="$PORTAGE_HOOKS_PREFIX/$CATEGORY"
function source_all() {
if test -d "$1"; then
for f in $1/*; do
if test -f "$f"; then
source "$f"
fi
done
fi
}
source_all "$CATEGORY_HOOKS_DIR"
source_all "$PACKAGE_HOOKS_DIR"
# /etc/portage/hooks/net-im/skypeforlinux/post-install
function post_pkg_postinst() {
_SKYPE_UUID=$(uuidgen)
_APP_ASAR_LOC=$(qlist skypeforlinux| grep /app.asar$)
_APP_ASAR_NEW_LOC="/tmp/app.asar_${_SKYPE_UUID}"
einfo "Copying app.asar from ${_APP_ASAR_LOC} to ${_APP_ASAR_NEW_LOC}"
cp /opt/skypeforlinux/resources/app.asar ${_APP_ASAR_NEW_LOC}
einfo "Backing up ${_APP_ASAR_NEW_LOC} to ${_APP_ASAR_NEW_LOC}_bkp"
cp ${_APP_ASAR_NEW_LOC}{,_bkp}
einfo "Applying emoticon patch to copied version"
perl -pi -e 's|EmoticonStroke=".*?"|EmoticonStroke=" " |' ${_APP_ASAR_NEW_LOC}
einfo "Copying the file back"
cp -f ${_APP_ASAR_NEW_LOC} ${_APP_ASAR_LOC}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment