diff --git a/README.rst b/README.rst index 5b52fce..ea7a7d5 100644 --- a/README.rst +++ b/README.rst @@ -1,120 +1,96 @@ -======================================= - Installation of gtimelog for Mac OS X -======================================= +==================================== + Installation of gtimelog for Mac OS +==================================== + +Purpose +======= + +Run https://github.com/gtimelog/gtimelog like a native Mac OS app. Versions ======== -- Compatible with Mac OS 10.6 (Snow Leopard) to Mac OS 10.14 (Mojave) +- Compatible with Mac OS 10.6 (Snow Leopard) to Mac OS 13.6 (Ventura) -- Currently only used and tested with Mac OS 10.14! +- Currently only used and tested with Mac OS 13.6! Prerequisites ============= -- You need to install MacPorts from http://www.macports.org/ - -- You are able to install gtimelog for Quartz (native Mac OS UI) or X11 - where the former should be preferred because of the better integration in - the OS: - -Prerequisites for the Quartz variant --------------------------------------------- +MacPorts +-------- -Install XQuartz (https://www.xquartz.org). +- You need to install MacPorts from https://www.macports.org/ -To install gtk+ and the other needed components for Quartz call:: +- To install gtk3 and the other needed components call:: - sudo port install glib2 +quartz - sudo port install cairo +no_x11+quartz - sudo port install pango +no_x11+quartz - sudo port install gtk2 +no_x11+quartz - sudo port install py27-lxml - sudo port install py27-cairo -x11 - sudo port install py27-pygtk +quartz - sudo port install py27-virtualenv + sudo port install gtk3 +quartz + sudo port install libsecret -Prerequisites for the X11 variant --------------------------------------------- +- To use the last released version use:: -To install gtk+ and the other needed components for X11 call:: + sudo port install gtimelog - sudo port install cairo +x11 - sudo port install pango +x11 - sudo port install gtk2 +x11 - sudo port install glib2 +x11 - sudo port install py27-lxml - sudo port install py27-cairo +x11 - sudo port install py27-pygtk +x11 - sudo port install py27-virtualenv - sudo port install curl-ca-bundle +- Otherwise install it using a Git clone and ``pip install .``. -Switch between X11 and Quartz variant -------------------------------------- +Homebrew +-------- -- To switch between X11 and Quartz you have to install gtk+ for the new variant (see above). +- You need to install Homebrew from https://brew.sh/ -- Uninstall the previous variant:: +- To install gtk3 and the other needed components call:: - sudo port uninstall inactive + brew install gtk+3 + brew install gobject-introsprection + brew install libsoup + brew install libsecret -- Then you have to uninstall the python bindings and a variant dependent library:: +- Install `gtimelog`` using a Git clone and ``pip install .``. - sudo port uninstall py27-gtk py27-cairo libglade2 -- And reinstall them (Quartz):: - - sudo port install py27-cairo -x11 - sudo port install py27-gtk +quartz - - resp. (X11):: +Installation +============ - sudo port install py27-cairo +x11 - sudo port install py27-gtk +x11 +- Create a directory ``.gtimelog`` in your home directory -- Then you can restart gtimelog which than runs using the new UI variant. +- Copy ``contrib/gtimelogrc.example`` to ``$HOME/.gtimelog/gtimelogrc`` and change the + parameters as needed. +- If you are not using the ``gtimelog`` executable from + ``/opt/local/bin/gtimelog`` you have to set the environment variable + ``GTIMELOG_PATH`` to ``/bin/gtimelog``: -Installation -============ + - for Mavericks (10.9): see Stackoverflow_ -- Create a directory .gtimelog in your home directory + - for Yosemite (10.10): see Stackexchange_ -- Copy orig/gtimelogrc.example to $HOME/.gtimelog/gtimelogrc and change the - paramaters as needed. (See also orig/README.txt) + - as an example see the file ``contrib/my.gtimelog.plist``. -- Create a virtualenv for the python installed above with all installed - libraries:: +- To use VS Code as editor (new way, MacPorts), you - /opt/local/bin/virtualenv-2.7 --system-site-packages gtimelog - cd gtimelog - bin/pip install zc.buildout + - have to use https://github.com/gtimelog/gtimelog/pull/246 -- To use a released version get the latest release of ``gocept.gtimelog`` from - http://download.gocept.com/packages, extract it and change into the newly - created directory. + - ``sudo port install dconf`` -- To use a source checkout clone the repository from - https://github.com/gocept/gocept.gtimelog.git and change into the directory - of the checkout. + - ``dconf write /org/gtimelog/editor '"open -a Visual\\\\ Studio\\\\ Code.app %s"'`` + (The four slashes are important.) -- Install the dependencies:: +- To use VS Code as editor (new way, Homebrew), you - ../bin/buildout + - have to use https://github.com/gtimelog/gtimelog/pull/246 -- Set the environment variable ``GTIMELOG_PATH`` to - ``/bin/gtimelog``. + - Change the default app in MacOS for text files to VS Code. - - for Mavericks (10.9): see Stackoverflow_ +- To use VS Code as editor (old way), copy: - - for Yosemite (10.10): see Stackexchange_ + - ``contrib/vscode.desktop`` to ``~/.local/share/applications`` - - as an example see the file ``my.gtimelog.plist`` right beside this README. + - ``contrib/mimeapps.list`` to ``~/.config`` -- Create an application shortcut + - ``contrib/gio-launch-desktop`` to ``~/bin`` (make sure it is executable) - mkdir -p /Applications/gtimelog.app/Contents/MacOS - ln -s /bin/gtimelog /Applications/gtimelog.app/Contents/MacOS/gtimelog + - *Caution:* This currently only works when gtimelog is started in an + terminal, not when it is started as MacOS application. .. _Stackoverflow : http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x .. _Stackexchange : http://apple.stackexchange.com/questions/106355/setting-the-system-wide-path-environment-variable-in-mavericks @@ -123,16 +99,3 @@ Usage ===== - Double click on gtimelog.app in /Applications to start it. - -Update released version installation -==================================== - -Get the new version from http://download.gocept.com/packages an install it as described above. Than restart gtimelog.app. - -Update source checkout -====================== - -Go to directory where you checked out ``gocept.gtimelog`` and then call:: - - hg pull -u - bin/buildout diff --git a/contrib/gio-launch-desktop b/contrib/gio-launch-desktop new file mode 100755 index 0000000..2b83bb0 --- /dev/null +++ b/contrib/gio-launch-desktop @@ -0,0 +1 @@ +exec "$@" diff --git a/contrib/gtimelogrc.example b/contrib/gtimelogrc.example new file mode 100644 index 0000000..34eef58 --- /dev/null +++ b/contrib/gtimelogrc.example @@ -0,0 +1,15 @@ +# Example configuration file for GTimeLog +# Place it in ~/.gtimelog/gtimelogrc + +[gtimelog] +# Your name in activity reports +name = Anonymous + +# Email to send activity reports to +list-email = activity@example.com + +# How many hours work in a day. +hours = 8 + +# When does one work day end and another begin +virtual_midnight = 02:00 diff --git a/contrib/mimeapps.list b/contrib/mimeapps.list new file mode 100644 index 0000000..ab4ca47 --- /dev/null +++ b/contrib/mimeapps.list @@ -0,0 +1,2 @@ +[Default Applications] +text/plain=vscode.desktop diff --git a/my.gtimelog.plist b/contrib/my.gtimelog.plist similarity index 100% rename from my.gtimelog.plist rename to contrib/my.gtimelog.plist diff --git a/gtimelog.app/Contents/MacOS/gtimelog b/gtimelog.app/Contents/MacOS/gtimelog index d7ded8e..182235c 100755 --- a/gtimelog.app/Contents/MacOS/gtimelog +++ b/gtimelog.app/Contents/MacOS/gtimelog @@ -1,6 +1,6 @@ #!/bin/bash if [ -z "$GTIMELOG_PATH" ] ; then - GTIMELOG_PATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/gtimelog + GTIMELOG_PATH=/opt/local/bin/gtimelog fi exec $GTIMELOG_PATH diff --git a/gtimelog.app/Contents/Resources/PythonApplet.icns b/gtimelog.app/Contents/Resources/PythonApplet.icns index 8fbc51f..d37e17c 100644 Binary files a/gtimelog.app/Contents/Resources/PythonApplet.icns and b/gtimelog.app/Contents/Resources/PythonApplet.icns differ