3

I'm trying to install the hamster time tracker in Kubuntu 20.04, but it seems quite difficult. Has anyone got it working?

hamster itself is not present in the official repos, but I installed hamster-snap from here. That works, but I'd also like to have a way to put it in the KDE system tray.

Earlier (in Kubuntu 16.04) that was possible with hamster-tray but that seems to be defunct now.

Supernormal
  • 837
  • 1
  • 7
  • 19

1 Answers1

5

It is possible by following two steps below.

Get hamster-time-tracker package from groovy:

cd ~/Downloads
wget http://archive.ubuntu.com/ubuntu/pool/universe/h/hamster-time-tracker/hamster-time-tracker_3.0.2-3_all.deb
sudo apt-get install ./hamster-time-tracker_3.0.2-3_all.deb

Clone Hamster unity-indicator repository and install the indicator to the system:

sudo apt-get install git python-is-python3 gir1.2-appindicator3-0.1 python3-gi-cairo
cd ~/Downloads
git clone https://github.com/projecthamster/unity-indicator.git

cd unity-indicator
sudo mkdir -p /usr/local/share/glib-2.0/schemas/
sudo cp data/hamster-indicator.gschema.xml /usr/local/share/glib-2.0/schemas/
sudo glib-compile-schemas /usr/local/share/glib-2.0/schemas
sudo cp hamster-indicator /usr/local/bin/hamster-indicator

mkdir -p ~/.local/share/applications
cp data/hamster-indicator.desktop ~/.local/share/applications
sed -i "s|Icon=hamster-time-tracker|Icon=hamster-indicator-active|" ~/.local/share/applications/hamster-indicator.desktop
sed -i "s|Exec=/usr/bin/hamster-indicator|Exec=/usr/local/bin/hamster-indicator|" ~/.local/share/applications/hamster-indicator.desktop

mkdir -p ~/.local/share/pixmaps
cp data/icons/hicolor/24x24/* ~/.local/share/pixmaps/
cp data/icons/hicolor/scalable/* ~/.local/share/pixmaps/

and enjoy:

Hamster with Indicator on Kubuntu 20.04 LTS

Also it is possible to make it working on MATE with commands below:

cd ~/Downloads/unity-indicator
mkdir -p ~/.local/share/icons/ubuntu-mono-dark/apps/24/
mkdir -p ~/.local/share/icons/ubuntu-mono-light/apps/24/
cp /usr/share/icons/ubuntu-mono-dark/index.theme ~/.local/share/icons/ubuntu-mono-dark
cp /usr/share/icons/ubuntu-mono-light/index.theme ~/.local/share/icons/ubuntu-mono-light
cp data/icons/ubuntu-mono-dark/24x24/* ~/.local/share/icons/ubuntu-mono-dark/apps/24/
cp data/icons/ubuntu-mono-light/24x24/* ~/.local/share/icons/ubuntu-mono-light/apps/24/
gtk-update-icon-cache ~/.local/share/icons/ubuntu-mono-dark
gtk-update-icon-cache ~/.local/share/icons/ubuntu-mono-light

to get the following:

Hamster with Indicator on Ubuntu MATE 20.04

N0rbert
  • 97,162
  • 34
  • 239
  • 423
  • This was working for some time, but since recently I get the an error `NotImplementedError: received ` when running `hamster-indicator`. Do you know why? (Or is that perhaps better to ask on github.) – Supernormal Jan 25 '21 at 07:21
  • You have to check changes in your python configuration, I think. Hamster uses python3, not python2. – N0rbert Jan 25 '21 at 07:28
  • I had the same strange issue `NotImplementedError: received `. To fix the problem I added these 2 lines to file `/usr/lib/python3/dist-packages/hamster/lib/stuff.py` after line 162: ``` elif hasattr(duration, 'total_seconds'): return duration.total_seconds() / 60 ``` – Mike Milkman Feb 22 '21 at 20:32