FireTray icon indicating copy to clipboard operation
FireTray copied to clipboard

Global keyboard shortcut for toggling visibility of Thunderbird

Open Lekensteyn opened this issue 10 years ago • 10 comments
trafficstars

The README suggests that this is a work in progress, is there anything pending?

Lekensteyn avatar Jan 25 '15 16:01 Lekensteyn

Hi, no. This is a long since abandoned feature, as it's been replaced by the -firetrayShowHide command-line option. Basically, you need to create a link to firefox -firetrayShowHide (or thunderbird), and then bind it to a system keyboard shortcut. I guess you're on Windows. Here's a link explaining how to do it: http://windows.microsoft.com/en-us/windows/create-keyboard-shortcuts-open-programs Tell us how it goes.

For the record, I don't think FireTray should be using aHot Key Control.

foudfou avatar Jan 25 '15 17:01 foudfou

Wrong guess, Arch Linux user here trying to find a substitute for KMail. While I can configure a shortcut for thunderbird -firetrayShowHide (thanks, could not find this documented anywhere), is there any reason why it is not implemented in the icon?

I guess that the APIs do not expose this as a cross-platform feature?

Lekensteyn avatar Jan 25 '15 17:01 Lekensteyn

Also, for some reason, the icon cannot be assigned a keyboard shortcut via the conventional KDE System Tray settings either. I'll have a look at this next week.

Lekensteyn avatar Jan 25 '15 17:01 Lekensteyn

This is suggested in the README where you found the outdated information:

  • command-line -firetrayShowHide option (useful for window manager's keyboard shortcuts) I don't think icons can actually receive keyboard keystrokes: either the foreground window receives it, or the window manager: hence the global window manager shortcut solution. As for KDE shortcuts, tell us how it goes. Have you searched closed issues ?

foudfou avatar Jan 25 '15 17:01 foudfou

I grepped for shortcut and keyboard in src/, assuming it was a built-in option and found zero relevant results.

It is possible that icons cannot receive keystrokes themselves. I need to investigate why no shortcut can be assigned at System Tray settings. The KDE shortcut works, but I would prefer to hack a check for an existing thunderbird process before invoking the thunderbird -firetrayShowHide command (assuming that this does start a new process when none is running).

Also searched the list of closed issues, got something to read I guess ;)

Lekensteyn avatar Jan 25 '15 18:01 Lekensteyn

I don't think you need to hack anything, and check for an existing TB process. Just try thunderbird -firetrayShowHide from the command line and see how it works.

foudfou avatar Jan 25 '15 18:01 foudfou

You are right, thunderbird -firetrayShowHide does not start Thunderbird if it is not running. I do get a startup notification though and thunderbird briefly appears in the task manager so this approach needs some refinement. Maybe I could get Thunderbird to talk DBus.. hmm.

As for the KDE Shortcut key bindings, it looks like it only exists for "plasmoids" (kde-workspace/plasma/generic/applets/systemtray/ui/applet.cpp).

Lekensteyn avatar Jan 26 '15 21:01 Lekensteyn

Can this issue be closed ? Is there anything missing ?

foudfou avatar Jan 26 '15 21:01 foudfou

While mozilla uses dbus internally for some parts, it is not exposed as API.

I've settled with this:

  1. Open System Settings.
  2. Open Shortcuts and Gestures
  3. Select the Custom Shortcuts tab.
  4. Select the Edit button, follow the menu New -> Global Shortcut -> Command/URL.
  5. Fill in the names, select a Trigger and use this for Action:
sh -c 'exec thunderbird -firetrayShowHide >/dev/null 2>&1' # sh to avoid startup notif

It might help if you document at the Preferences screen that shortcuts can be set elsewhere.

Lekensteyn avatar Jan 26 '15 23:01 Lekensteyn

Agreed. Would you be willing to provide a patch ?

foudfou avatar Jan 27 '15 08:01 foudfou