Nixpkgs: Slack URL handler

Created on 20 Sep 2016  Â·  10Comments  Â·  Source: NixOS/nixpkgs

Issue description

These are magic sign-in URLs. It would be a nice enhancement to the slack package to include the support files for that. It may already have pieces of it but support seems broken or incomplete.

Even with slack installed; firefox, chromium, and xdg-open do not understand slack:// URLs. Firefox just says the address wasn't understood and chromium attempts to use xdg-open, which chokes on it and opens a browser window.

The slack.desktop entry does reference a URL handler (which xdg-mime sees) but the package may not have adequate support files to hook register this x-schema-handler to the environment.

slack.desktop:

[Desktop Entry]
Name=Slack
Comment=Slack Desktop
GenericName=Slack Client for Linux
Exec=/usr/bin/slack --disable-gpu %U
Icon=/usr/share/pixmaps/slack.png
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Network;InstantMessaging;
MimeType=x-scheme-handler/slack;
$ xdg-mime query default x-scheme-handler/slack
slack.desktop
$ xdg-open slack://x
/run/current-system/sw/bin/xdg-open: line 656: : command not found

Steps to reproduce

  • Install slack.
  • Try to open a slack URL via firefox, chromium, or xdg-open.

Workaround is that i just use slack slack:// for any urls I get.

Technical details

  • System: 16.03.1287.6ac7ffd (Emu)
  • Nix version:nix-env (Nix) 1.11.2
  • Nixpkgs version: 16.03.1287.6ac7ffd
enhancement

Most helpful comment

i installed now ubuntu and slack, the local config it's the default, and i can't login

All 10 comments

Hi @sheenobu ,

Not sure if it was fixed recently of so, but it works correctly for me.
Could you confirm that it works correctly on an updated system ?

It may have been fixed by https://github.com/NixOS/nixpkgs/commit/7081325518c275b3d40f19c3be54fddfb7355c71 or https://github.com/NixOS/nixpkgs/commit/b6c80ee36c56071c99e016569a351eeadd408720

If fixed, would you mind closing this issue ?

@layus

The generated .desktop file looks good and xdg-mime query default x-scheme-handler/slack still reports slack.desktop but my browser (Chromium) decides to open slack via xdg-open, and xdg-open just launches a new chromium window. I'm going to try in an isolated vm to filter out any local garbage.

@layus Yes it's working with a very simple setup. Chromium opens slack:// urls with xdg-open and xdg-open launches slack properly. Whatever new issue is a local config one.

Calling this resolved.

@sheenobu Just to keep you updated. I recently had an issue where slack urls were not opened correctly. Was an issue with the mime/applications database. See #13134.

i installed now ubuntu and slack, the local config it's the default, and i can't login

Reopening; this is still not working with the Slack app and Firefox on NixOS 19.09.

  • When I install and start the Slack app, it shows the Sign In button.
  • Clicking it opens Firefox.
  • I enter my workspace name and it redirects to a page showing this:

image

Signing you in to Slack... -- You will be redirected in a few moments.

The Slack app does not open though.

Clicking the App didn't open? Try again link, I get this:

image

The address wasn’t understood

with slack://T0AEDEVFX/magic-login/91... in the Firefox URL bar.

Copying this URL into the clipboard, and re-focusing the Slack app then suddenly signs me in.


Trying the same thing again, at the time I click the App didn't open? Try again link, I now get a different page, not a Firefox "The address wasn’t understood" error:

image

It looks like your browser didn't redirect you back to the Slack app.

To finish signing in, copy your sign-in key below and open the Slack desktop app.

No need to paste the sign-in key anywhere — you'll be automatically signed in when you open the Slack app.

This explains why copy-pasting the link into the clipboard worked last time -- apparently the app watches the clipboard.


**I'm reopening this bug because the slack:// URL should have made Firefox xdg-open it, when it didn't.

Running xdg-open manually on the URL seems to work, so at least that part seems to have improved since this issue was filed. We just have to fix Firefox calling xdg-open. Anybody have an idea how to do that?

@nh2 Could it have been solved by https://github.com/NixOS/nixpkgs/pull/75825 ?

If so, you can ask there for a backport on 19.09.

It does work for me on 20.03, though I had to install it in the system rather than from user env, unsurprinsingly.

I have the same issue on Nixos 20.03, I installed the slack app (slack-black) directly in my configuration.nix
@nh2 your suggestion with putting it in to the clipboard worked great for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rzetterberg picture rzetterberg  Â·  3Comments

matthiasbeyer picture matthiasbeyer  Â·  3Comments

lverns picture lverns  Â·  3Comments

spacekitteh picture spacekitteh  Â·  3Comments

sid-kap picture sid-kap  Â·  3Comments