← Back to team overview

zim-wiki team mailing list archive

mac: upon launch have zim come to the foreground

 

When I launch zim on MacOS its window doesn't come to the foreground. I have to select the window before I can start typing.

This is a hack, but it works with a tiny bit of patience:


```
#!/bin/bash

python2 $HOME/bin/zim-0.68/zim.py -D -V --geometry 900x1000-0-0 --standalone &


# run every half second since I don't know how long zim will take to appear
sleep 0.5
osascript -e 'tell application "Python" to activate windows where name contains "Zim"'
sleep 0.5
osascript -e 'tell application "Python" to activate windows where name contains "Zim"'
sleep 0.5
osascript -e 'tell application "Python" to activate windows where name contains "Zim"'
sleep 0.5
osascript -e 'tell application "Python" to activate windows where name contains "Zim"'


```