A simple background service that automatically tracks time spent in Godot Engine.
sudo apt install python3-psutilmkdir -p ~/.config/systemd/user
cat > ~/.config/systemd/user/godot-tracker.service << 'EOF'
[Unit]
Description=Godot Time Tracker
After=graphical-session.target
[Service]
Type=simple
ExecStart=/usr/bin/python3 /path/to/time-tracker.py # REPLACE THIS!
Restart=always
RestartSec=5
Environment=HOME=%h
[Install]
WantedBy=default.target
EOFchmod +x ~/Games/time-tracker.py
systemctl --user daemon-reload
systemctl --user enable godot-tracker.service
systemctl --user start godot-tracker.serviceecho 'alias godot-time="python3 /path/to/godot-time.py"' >> ~/.bash_aliases # or .bashrc if you don't have an aliases file. Also, remember to change the path
source ~/.bash_aliases- Check time:
godot-time - Reset time:
rm ~/.godot_time.json - Check service status:
systemctl --user status godot-tracker.service - Stop service:
systemctl --user stop godot-tracker.service - Start service:
systemctl --user start godot-tracker.service
- The service runs automatically in the background
- It detects when Godot is running and starts counting time
- Time is saved every minute to
~/.godot_time.json