Auto-start of Zotero on Linux, with _minimized_ window.

_[ Zotero 5.0-beta.172+8edd4b0 on Ubuntu 14.04 with FF 52.0.1 and LO 5.3.12]_

Hello everybody,
My setup works flawlessly. As I used Zotero pretty much all the time, I arranged for it to auto launch at boot time. However I'd like it to launch with a minimized window by default. How do I do that ?
Thank you.
-ced
  • Haven't tested, but have you tried the -tray flag?
  • edited April 4, 2017
    @adamsmith:

    Mmhh....

    Do you mean to "execute the app with the `-tray` flag" ?
    If so should I include that in the `zotero.desktop` file ?
    How should I go about doing this if the app is launched automatically at startup ?
    Cheers,
    -ced
  • How do you specify your start-up apps? I do this in the Startup Applications Preferences in Ubuntu, where you'd specify ~/pathtoZotero/zotero -tray as a command
  • @adamsmith:
    Tx for the answer. I experimented (only on my time off) with reboots and the flag `-tray` as you recommend. Nothing doing. specifying this in the Startup app with either `~/pathtoZotero/zotero -tray` or `~/pathtoZotero/zotero --tray` is ineffectual. Zotero always launches and opens its window on the desktop. I am stumped... Any other idea welcome.
  • nothing simple then, sorry. You can look at some of the general solutions here http://askubuntu.com/questions/20989/how-do-i-tell-a-start-up-program-to-start-minimized see if they work for you
  • I recommend the FireTray extension to you.
    https://addons.mozilla.org/en-US/firefox/addon/firetray/

    But some modification is necessary to make it installable for zotero 5.0:
    1. Download the the extension as an xpi file.
    2. Open the xpi file with archive manager.
    3. Edit the file install.rdf to make it installable for zotero 5.0. (Change the maxVerision from 4.* to 5.* in the Zotero section)
    4. Save the file and archive manager will ask you to update the file (choose update, of course).

    Install the modified xpi file and restart zotero if needed. Then you can change the preference of FileTray and check the option "start application hidden to tray".

    If you find it change the firefox icon to an ugly one, just replace the firefox icon in the xpi file (./chrome/skin/icons/linux/hicolor/22x22/apps/firefox.png) with the one in you system. (I use the one /usr/share/pixmaps/firefox.png.)

    Tested in ubuntu 16.04 with zotero 5.0 beta.
  • edited April 7, 2017
    @duguyipiao: Thanks, I did not know about Firetray. It was not included in the solutions proposed by @adamsmith. I choose not to go down the way you kindly indicate, because I don't want to add bloat to an already heavy Ubuntu 14.04.5 desktop install (Unity, FF and all).

    The `wmctrl` route was promising (simple and lightweight). But apparently lightweight also means incomplete in that case. As incredible as it may sound, there is no `wmctrl` option to minimize any window at all. (someone, please shout if I'm wrong).

    in the end, the cleanest most lightweight solution seems to be that of Jacob Vlijm's python script solution, at http://askubuntu.com/a/663288/72216.

    The basic issue though is now the strange fact that `zotero` doesn't include any handle for the corresponding "launch-minimized" option on cli. I find it truly strange...

    I summarized below the "minimize window" flags I tried, when launching from cli:
    -tray
    -starttotray
    -startmin
    -minimize
    -minimized
    -mini
    -silent
    -0
    -small

    plus all of the above with two hyphens instead of one. Result: zilch !
  • (If you read the description of the wmctrl option, they actually don't claim that minimize exists. It's for closing windows after they open, which might have a similar effect on some apps, though not Zotero).

    I don't think Zotero not having a minimize flag is all _that_ unusual. It's not like people ask for it a lot and if the default -tray from mozilla doesn't work, it'd likely have been a good chunk of work to implement.
  • edited January 8, 2018
    @duguyipiao Thanks, your solution worked for me! Even though Firetray is discontinued, I'll probably make a fork of it to produce an amended version.

    UPDATE: Okay, I did it. It's here: https://github.com/LaserTron/FireTray
    I even have a one line command there for lazy people to get the .xpi file instantly.
  • Minimizing Zotero 5 to tray

    For those of you who, like me, want to keep Zotero in tray, there are some third party apps that do that:
    Windows:
    - TrayIt! (https://winaero.com/blog/minimize-apps-to-system-tray-notification-area-with-trayit/)
    - RBTray, TrayEverything, Trayconizer (https://lifehacker.com/5061417/trayeverything-stashes-programs-in-the-system-tray)
    Linux:
    - you can make use of kdocker, because alltray is unsupported and does not work well anymore.
    I've made a bash script for using kdocker with zotero here:
    https://github.com/cyberalex4life/zotero-tray
  • This guide to run Firetray doesn't work any more. After starting Zotero it runs in full window and Firetray icon is not appearing in system tray.
    Ubuntu Mate 18.04, Zotero 5.0.80
  • Didn't work for me either, installs fine but Zotero still launches in fullscreen and exits instead of minimizes (I couldn't find an option in the menu or for the addon to change the behavior). If anyone else happens to be on i3, you can use this solution https://unix.stackexchange.com/questions/96798/i3wm-start-applications-on-specific-workspaces-when-i3-starts, which is not minimizing per se, but serves the same purpose of getting an application out of the way after launching it.
  • If you can manage autostart, and just need minimize, I could whip up a trivial Zotero extension that just minimizes Zotero at start and does nothing else.
  • That would be great, thank you for offering! I can manage autostart but I will also say that I am content with the solution for i3 that I linked in my previous post even though it would be ideal with an icon in the taskbar rather than a window on a different desktop/workplace. This is not a big issue for me though and I don't want to give you additional work unless it is really trivial as you said (I imagine there could possibly be issues getting the taskbar icon and minimization to work on different OSes though?).
  • I'd not do anything about that. It'd just minimize Zotero at start, same as had you clicked the minimize button wherever that sits for your OS.
  • It will take me an hour or so to get the distribution set up but the plugin is done.
  • Wow that was quick! Looking forward to testing it, thanks again!
  • https://github.com/retorquere/zotero-minimize

    I can't immediately hide Zotero; the window must be known before I can minimize it, and before that happens it has already shown ¯\_(ツ)_/¯
  • Thanks! I tried it on a windows computer I use sometimes and it works great! It doesn't work on my laptop, but that's because the i3 window manager doesn't support regular minimize, so I can use my previous solution there and yours elsewhere.
Sign In or Register to comment.