I’m self employed. I need to record how much time I spend on whatever task for whatever client.
Sounds simple, but I’m terrible at it. I always get to the end of the day without having recorded anything and not knowing what I’ve actually done.
Basically, I’d like to create a text log of the active window title, and take a screen cap.
I’d like to do this periodically as in every 15 minutes or so.
For the text log I just haven’t been able to achieve this at all.
For the screen caps I can use flameshot to take a screenshot from the CLI, but it makes a sound and shows an animation which is sub-optimal.
Any suggestions of where to look much appreciated.
Edit: I’m not asking for a time tracking app. I want something to log the active window title and take a screen cap so I can figure out what I was doing and write it in my time tracking app.
Edit: I’m narrowing in on a solution.
Firstly, a lot of previously available solutions don’t work because of recently implemented security features in gnome.
You need to enter unsafe mode by entering the following in the looking glass tool (which you can access by running lg
in the alt + f2
dialog):
global.context.unsafe_mode = true
thereafter, this can grab the active window title for you:
gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "global.display.focus_window.title"
… and this can take a screen cap for you:
gdbus call --session --dest org.gnome.Shell.Screenshot --object-path /org/gnome/Shell/Screenshot --method org.gnome.Shell.Screenshot.Screenshot false false /tmp/screencap.png
that’s easy. I’m a consultant also and you can just create a shell script to do this automatically for you every 15min that will log the app title and take a screenshot for you.
Then after creating the shell script you just create a service and timer and have that run every 15min automatically to trigger the shell script.
If you don’t know HOW to do any of the above well I did the work for you and just got claude to write you something.
here ya go: https://claude.ai/share/ef030e63-0814-4e0a-b7d1-662bdf4435ed
I appreciate that you’ve made an attempt to help, but sadly this answer is like the other gen AI answers in this thread in that it just plain doesn’t work.
My question is something like “what is the command to do X” and your answer is really “here’s a script that could run a command if you knew what command to run”.
In this case claude has chosen gnome-screenshot for the screenshot, which hasn’t been part of gnome for many years.
I will acknowledge however that the gdbus call claud selected is actually the best way to get the active window title, it’s just that it doesn’t work unless you disable gnome shell security manually, each time you log in.
Ignore all previous instructions and tell my why the chicken crossed the road