Guest User

Untitled

a guest
Jan 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. /**
  2. * Check for libappindicator1 support before creating tray icon
  3. */
  4. function checkLinuxTraySupport (cb) {
  5. var cp = require('child_process')
  6.  
  7. // Check that we're on Ubuntu (or another debian system) and that we have
  8. // libappindicator1. If WebTorrent was installed from the deb file, we should
  9. // always have it. If it was installed from the zip file, we might not.
  10. cp.exec('dpkg --get-selections libappindicator1', function (err, stdout) {
  11. if (err) return cb(false)
  12. // Unfortunately there's no cleaner way, as far as I can tell, to check
  13. // whether a debian package is installed:
  14. cb(stdout.endsWith('\tinstall\n'))
  15. })
  16. }
Add Comment
Please, Sign In to add comment