Skip to content

Commit

Permalink
Use upstream gtimelog on gtk3 (#1)
Browse files Browse the repository at this point in the history
* Update from gocept.gtimelog to upstream gtimelog on gtk3.
* Update docs for editor feature.
* Hint about unreleased version.
* Add Homebrew installation instructions.
* Update to a new icon.

---------

Co-authored-by: Michael Howitz <[email protected]>
  • Loading branch information
icemac and Michael Howitz authored Nov 30, 2023
1 parent 1a43071 commit deae9f2
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 91 deletions.
143 changes: 53 additions & 90 deletions README.rst
Original file line number Diff line number Diff line change
@@ -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 ``<absolute path of gtimelog directory>/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
``<absolute path of gtimelog directory>/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 <Path to gtimelog virtualenv>/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
Expand All @@ -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
1 change: 1 addition & 0 deletions contrib/gio-launch-desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exec "$@"
15 changes: 15 additions & 0 deletions contrib/gtimelogrc.example
Original file line number Diff line number Diff line change
@@ -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 = [email protected]

# How many hours work in a day.
hours = 8

# When does one work day end and another begin
virtual_midnight = 02:00
2 changes: 2 additions & 0 deletions contrib/mimeapps.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Default Applications]
text/plain=vscode.desktop
File renamed without changes.
2 changes: 1 addition & 1 deletion gtimelog.app/Contents/MacOS/gtimelog
Original file line number Diff line number Diff line change
@@ -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
Binary file modified gtimelog.app/Contents/Resources/PythonApplet.icns
Binary file not shown.

0 comments on commit deae9f2

Please sign in to comment.