Zim

Iconify 0.42 on start

Asked by codemonkey

Hi,

I'd like the start zim iconified on KDE 4 (F12). Is there a way to do this? I looked at the --help and there doesn't appear to be an option to do this.

I saw a similar question here <https://answers.launchpad.net/zim/+question/41268> but the answer appears to be out of date. The --iconfiy switch is not recognized by 0.42.

Thanks,

~ray

Question information

Language:
English Edit question
Status:
Answered
For:
Zim Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) said :
#1

This is currently not supported in the python version. Please file a bug report.

On Thu, Jan 14, 2010 at 6:07 PM, codemonkey
<email address hidden> wrote:
> New question #97405 on Zim:
> https://answers.launchpad.net/zim/+question/97405
>
> Hi,
>
> I'd like the start zim iconified on KDE 4 (F12).  Is there a way to do this?  I looked at the --help and there doesn't appear to be an option to do this.
>
> I saw a similar question here <https://answers.launchpad.net/zim/+question/41268> but the answer appears to be out of date.  The --iconfiy switch is not recognized by 0.42.
>
> Thanks,
>
> ~ray
>
>
> --
> You received this question notification because you are an answer
> contact for Zim.
>

Revision history for this message
codemonkey (codemonkey-interthingy) said :
#2

Okay, thanks.

Revision history for this message
Nicholas Wastell (nickwastell) said :
#3

A workaround is to install wmctrl (from repository) and add the following to the session startups:

zim && sleep 1 && /usr/bin/wmctrl -c 'Zim'

You need the 'sleep 1' to allow time for Python to get going and produce the window, before wmctrl tries to find it.

Revision history for this message
Nicholas Wastell (nickwastell) said :
#4

(Not possible to edit comments?)

I should add, it is necessary to have the 'Tray Icon' plugin enabled in Zim for my wmctrl workaround to be effective.

It may also be necessary to call Zim with its full path:

/usr/bin/zim && sleep 1 && /usr/bin/wmctrl -c 'Zim'

Revision history for this message
Enzo Mancuso (garret88) said :
#5

Why if I execute this command from the terminal zim opens minimized in the traybar (so it works as it should). But if on Gnome I put the command to the session startups this trick doesn't work.

I think the option to start Zim minimized is really important, just see other notebook apps like tomboy and gnote. They also come with a gnome-applet.

Revision history for this message
Nicholas Wastell (nickwastell) said :
#6

To use the workaround in Gnome startup applications, a bit more is needed.

There are some timing problems at startup – there are many things starting at the same time and resources are stretched. (I think maybe the user environment is not established, too.)

This works for me:

Put the following code in a script file in ~/bin/zimstart. Don't forget to make the file executable:

#! /bin/bash

sleep 15 && /usr/bin/zim && sleep 2 && /usr/bin/wmctrl -c ' - Zim'

Then put a call to the script in Startup Applications. You will need to use the full path (use the 'Browse button when adding the startup command). Adjust the 'sleep' times to suit your machine. I'd suggest starting with longer times and reducing them when it works.

The Zim window will flash on the screen – there's no avoiding that, I think. (Some other applications with start-iconified built-in do that, too. It's only at log-on, not after that.)

I have also added space-hyphen-space in front of 'Zim' in the wmctrl argument to make sure I get the right window.

Revision history for this message
Enzo Mancuso (garret88) said :
#7

@Nicholas Wastell: Thanks, your tip works

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) said :
#8

Fixed in rev226. Now running "zim --plugin trayicon" should just start the trayicon without showing a notebook.

Can you help with this problem?

Provide an answer of your own, or ask codemonkey for more information if necessary.

To post a message you must log in.