Signal Desktop stand-alone OS X Application

For quite some time I am an happy user of Open Whisper Systems’ Signal Messenger phone application as alternative to WhatsApp. The fact that this solution is open source and that the exchange of messages (and now also calls) is secure and that this can be verified by anyone are important and valuable. I use it on my phone but as I spend most of my time behind a laptop and still (call me old-fashioned) prefer a real keyboard over a touch screen I have been looking for a way to use it from my laptop as well.

Unlike the WhatsApp web solution, Open Whisper Systems is working on a local client that can be run in Chrome. I liked the solution though as I am not able (nor willing) to switch my browser to Chrome nor run a Chrome browser just for this purpose, this is not a practical solution. Quite some time ago I read Tim Taubert’s post with a guide to build your own Signal Desktop using NW.js instead of the Chrome Browser. I tried his approach at that time, but as he also indicates in his post, the Signal Desktop app was far from perfect at that time and also NW.js was still under heavy development (and not stable yet) so I left it at that time.

As I found myself using Signal a lot today, I decided to look into the NW.js solution again and noticed that both the Signal Desktop app as well as NW.js had progressed a lot since I last looked at it. Using the latest stable version of NW.js I was able to build my own Signal Desktop app for my MacBook and it was actually very usable! The only quirk I noticed was that every time you start it it will prompt to link it to a device. This does not appear to be necessary though, by simply closing that window Signal would still work (as it was already linked). I am not sure what this is though probably will raise an issue against the Signal Desktop for this later this week.

The build process has a few dependencies:

  • Node.js and npm are required to build the Signal Desktop app, install it using the node.js installer available on the project’s website.
  • Signal Desktop development use Sass to generate their CSS files. For the build process to work the Ruby Sass preprocessor is required. Install it with:
    gem install sass
    

Once these are installed, building and installing the Signal Desktop app for MacOS is very straightforward and can be done through the following 8 steps:

  1. Prepare (and enter) a working directory:
    mkdir SignalDesktop
    cd SignalDesktop
    
  2. Download the latest stable version of the NW.js (v0.20.3 at this moment) from the project’s site. The normal version should suffice, the SDK is only required if you expect to do debugging or analysis of problems.
    curl -O https://dl.nwjs.io/v0.20.3/nwjs-v0.20.3-osx-x64.zip
  3. Extract the NW.js MacOS Runtime App and use it as basis for the Signal Desktop app:
    unzip nwjs-v0.20.3-osx-x64.zip */nwjs.app/*
    mv nwjs-v0.20.3-osx-x64/nwjs.app/ SignalPrivateMessenger.app
    rmdir nwjs-v0.20.3-osx-x64
    
  4. Clone the Signal Desktop code repository from GitHub. The latest stable version at this time seems to be 0.31.0, which can be selected by adding -b 0.31.0 to the command below but I decided to go for the latest version and omitted that.
    git clone https://github.com/WhisperSystems/Signal-Desktop.git
    
  5. Next build signal desktop using npm and grunt and copy the distribution into the SignalPrivateMessenger.app structure we created in step #3
    cd Signal-Desktop/
    npm install
    node_modules/grunt-cli/bin/grunt
    cp -r dist ../SignalPrivateMessenger.app/Contents/Resources/app.nw
    cd ..
    
  6. Out of the Box the NW.js MacOS app comes with NW.js icons, execute the steps below to generate a simple Signal iconset using the icons available with Signal Desktop.
    Please note that iconutil will complain about missing @2x icons but that is expected and harmless.

    mkdir signal.iconset
    cp Signal-Desktop/images/icon_* signal.iconset/
    iconutil -c icns --output signal.icns signal.iconset
    cp signal.icns SignalPrivateMessenger.app/Contents/Resources/document.icns
    cp signal.icns SignalPrivateMessenger.app/Contents/Resources/app.icns
    
  7. That’s all, to run the app from the build directory start it with the following command.
    open SignalPrivateMessenger.app
    
  8. Although running it from the build directory works without problems, I preferred to have it available from the Launchpad and for all users so I moved it to /Applications with the command below. If you only want it installed for the current user, move it to ~/Applications instead.
    mv SignalPrivateMessenger.app /Applications/
    

That’s all, enjoy Signal Desktop on you Mac! To update it to the latest version simply execute these steps again. To build it for Windows or Linux requires similar steps (but there are some differences). I will document these whenever I have the need for a Signal Desktop app on these systems (generic instructions can be found in Tim Taubert’s post as well and in the NW.js documentation on packaging and distributing your application.

For me this solution works well so far, let me know in the comments in case you have any problems (or success stories).

One Reply to “Signal Desktop stand-alone OS X Application”

Leave a Reply

Your email address will not be published. Required fields are marked *