fsavje / math-with-slack

Rendered math (MathJax) with Slack's desktop client
MIT License
431 stars 62 forks source link

Can't use with Snap (Ubuntu) installation of Slack #32

Closed EpicWink closed 6 years ago

EpicWink commented 6 years ago

I'm on Ubuntu 18.04, and I've installed Slack (Direct Download 3.1.1 64-bit) via Snap (a multi-distribution package manager). I can't seem to be able to install the math-with-slack injection: it gives me errors:

$ sudo bash math-with-slack.sh /snap/slack/current
Cannot find Slack file: /snap/slack/current/ssb-interop.js
$ sudo bash math-with-slack.sh /snap/slack/current/usr/lib/slack/resources/app.asar.unpacked/src/static
Cannot write to Slack file: /snap/slack/current/usr/lib/slack/resources/app.asar.unpacked/src/static/ssb-interop.js

It seems to be the same error with the Windows Store version of Slack, where the program files are write-protected, however I haven't tested this.

fsavje commented 6 years ago

Thank you @EpicWink for the report.

Have you made sure that /snap/slack/current/usr/lib/slack/resources/app.asar.unpacked/src/static/ssb-interop.js exists? If so, it is probably the write protection that causes problems, as you suspect.

It's beyond the scope of the script to bypass the different types of write protections methods that package managers use, so I'm going to close this issue. However, if you find a way to write to the directory, then you should be able to install this. You could, for example, try to run the script as root or as the user Snap uses to install the apps.

BlackHC commented 5 years ago

Hello,

here are instructions to make it work:

  1. Install overlay (see https://github.com/kyrofa/overlay-snap): snap install overlay

  2. Make slack/current rewritable: /snap/overlay/current/overlay /snap/slack/current

  3. Run:

    sudo bash math-with-slack.sh /snap/slack/current/usr/lib/slack/resources/app.asar.unpacked/src/static
  4. (Restart Slack.)

Steps 2-4 have to be repeated after every reboot.