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
... show moreI'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

Trivial example: Under Ubuntu 20.04, the following command:
gdbus call -e -d org.gnome.Shell -o /org/gnome/Shell -m org.gnome.Shell.Eval true
produces this output:
(true, 'true')
but under 22.04...
Ask Ubuntu
RedWizard [he/him, comrade/them]
in reply to null_dot • • •null_dot
in reply to RedWizard [he/him, comrade/them] • • •HelloRoot
in reply to null_dot • • •maybe:
github.com/Svahnen/openrecall_…
GitHub - Svahnen/openrecall_wayland: OpenRecall is a fully open-source, privacy-first alternative to proprietary solutions like Microsoft's Windows Recall. With OpenRecall, you can easily access your digital history, enhancing your memory and productivity
GitHubnull_dot
in reply to HelloRoot • • •Kinda cool, interesting. Thanks for the suggestion.
It's not really suitable for me though. This kinda takes periodic screenshots and makes them searchable.
I need to know what I was doing at different times. So really it's just the periodic screenshots that I need and the search functionality isn't useful to me.
HelloRoot
in reply to null_dot • • •"searchable" in the sense that you can ask an AI what you were doing at certain times.
I am pretty sure you could ask it to generate per project timetables from that.
Or at the very least, you can use the codebase to see how they take continuous screenshots. Especially since all the wayland code is clearly seperated in the fork.
null_dot
in reply to HelloRoot • • •Yeah there's a video on the upstream project page that shows how it works. It's notreally "AI" so much as OCR. Like if you search "wayland" it will show you the times at which that word was visible on the screen.
I don't think it accepts a "prompt" like "make a list of activities for me".
I did have a quick look at how they're doing it. It's just a different python lib.
I did however discover, from looking at this project, that the sound and animation from taking a screenshot originates from gnome, not the thing taking the screen shot. There's some notes in this project explaining how to disable that.
With this in mind, other screenshot apps like flameshot will be fine.
HelloRoot
in reply to null_dot • • •Ah I see, my bad.
Another idea that might or might not work is filming a video at 0.0011 fps (1 frame every 15 min). Not sure if it accepts values that low or handles them correctly.
Or maybe do a 1 frame video on a loop
As that will use a different interface it might not flash the screen.
Just random ideas, no clue if they would work.
Good luck with your project.
BCsven
in reply to null_dot • • •Chatgt says build a scrip using a few tools. xdotool and scrot. I don't know if this code is good or not. And some hashes are making markdown headers. How do we paste code on here?
#!/bin/bash
Set interval (in seconds)
INTERVAL=10
Output directories
LOG_FILE="$HOME/window_log.txt"
IMG_DIR="$HOME/window_snaps"
mkdir -p "$IMG_DIR"
while true; do
# Get timestamp
TS=$(date "+%Y-%m-%d_%H-%M-%S")
done
MasterOKhan
in reply to BCsven • • •There is an etiquette to not just copy and pasting from ChatGPT. The fact you couldn’t verify the code yourself is a bigger issue.
I understand you may have thought this may help, it really does not.
like this
eshep likes this.
BCsven
in reply to MasterOKhan • • •I find LMM is typically trash, but can get you started. But your etiquette note is noted
null_dot
in reply to MasterOKhan • • •There's several answers like this in this thread.
I feel like the community would benefit from a sticky explaining some basic etiquette and how not to "help".
It's not just dumping gen AI output in a thread, there's other poorly considered answers here too.
null_dot
in reply to BCsven • • •Maybe ask chatgpt whether xdotool is compatible with wayland.
I get that you're trying to help but, this is not the way.
like this
eshep likes this.
BCsven
in reply to null_dot • • •null_dot
in reply to BCsven • • •This might shock you but... I have actually spent some time looking into this.
The tools you've suggested aren't compatible with Wayland. It seems that alternatives don't really exist, or cause the problems I mentioned in my post.
Additionally, I have a few decades experience with Linux and while I'm not some amazing Linux guru I do know what a bash script is and how to "link two programs together".
Finally, like everyone on the planet I also know what chatgpt is and might even consider using it to create a bash script if I knew what tools were compatible with Wayland.
BCsven
in reply to null_dot • • •null_dot
in reply to BCsven • • •BCsven
in reply to null_dot • • •null_dot
in reply to BCsven • • •It's funny you say that. I was thinking exactly the same thing about your comments.
I've asked for help, you posted a chatgpt response, and now you've claimed eleventy times that I seem like I don't know where to start or don't seem like the type to search things.
"OP should've googled it first" is one of the hallmarks of toxic communities.
monovergent
in reply to BCsven • • •eshep
in reply to BCsven • •@BCsven
This is so much less helpful than just posting "I don't know" or "beats me".
First, if you're gonna post code, put it in a code block. And nevermind you not knowing if the ""code is good"", it doesn't even adhere to the question that was asked; the two programs you suggested are not even wayland compatible tools.
@null_dot
Linux reshared this.
BCsven
in reply to eshep • • •OP seemed like they didn't know where to start, so linking programs together was my suggestion. With a rough example. If thats against etiquette the noted.
As for helpfulness, where are the code block entries. I have preview, hyperlink, inage, bold, italic,quotes,lists and spoilers across the bottom, and no codeblock.
As for Wayland compatible this is where, somebody reads between the lines. If those two aren't Wayland compatible search for Wayland compatible tool like "xxxxxx".
arcterus
Unknown parent • • •eshep
in reply to null_dot • •Haven't ever done this in wayland, but in X, I always used to
xdotoolto grab the title of the active window. I'd guess you could do the same using one of the wayland alternatives likeydotool,wlrctl,dotool, or whatever else is out there. And something likegrimto grab an image of the window.Linux reshared this.
null_dot
Unknown parent • • •hollyberries
in reply to null_dot • • •What’s your window manager?
You can use grim+slurp to take screenshots. Scroll down to the Wayland section for a snippet:
wiki.archlinux.org/title/Scree…
I keep my desktop muted so I am not sure if it makes a sound or not. If you wrap the commands into a timer loop it will do what you’re looking for.
For the window title you can likely use your window manager’s IPC calls to get the active window title or list of windows on a workspace. My wayland experience is limited to hyprland and if you haven’t found a solution when I get home from work I can post the jank utility I made in rust to output the data I needed for my Eww bar.
Screen capture - ArchWiki
wiki.archlinux.orgnull_dot
in reply to hollyberries • • •I'm using a default debian / gnome setup, so that's mutter + wayland.
Grim seems to error with
compositor doesn't support wlr-screencopy-unstable-v1which I don't really understand. Searching that term suggests that gnome will never support wlr-anything.zigmhount
in reply to null_dot • • •Eugenia
in reply to null_dot • • •There's nothing like you ask. Most time tracker apps are just a calendar where you write manually how much time you spent on something. So you can use something like Kimai, or use a paper calendar and write on it.
But text log of the active window and a screencap, that's the stuff of Microsoft Recall AI nightmares that Linux developers wouldn't be keen to implement. What you're asking is intrusive AI for others. Maybe you need to actually learn to be punctual and write down your activities, or simply, buy a Snapdragon laptop with Windows AI on it. And even then, that info stays with the AI, I don't think it's shared much with the user.
null_dot
in reply to Eugenia • • •That's not what I asked for.
You don't really understand time tracking, I see.
How is logging the title of the active window an AI nightmare ?
Like this you mean? Yes, surely that doesn't exist.
Maybe you need to try being... a bit less of a dick ?
Kinda speechless at this one. Well done.
GitHub - openrecall/openrecall: OpenRecall is a fully open-source, privacy-first alternative to proprietary solutions like Microsoft's Windows Recall. With OpenRecall, you can easily access your digital history, enhancing your memory and productivity with
GitHublike this
eshep likes this.
myotheraccount
in reply to null_dot • • •It's been a while since I looked into details of wayland, but one thing I recall is that a lot of things depend on the specific compositor / desktop environment you are using.
X is very open: you can easily query open windows etc, while on wayland things are less standardized / more hidden.
Which compositor do you use?
Antithetical
in reply to null_dot • • •PipeWire - ArchWiki
wiki.archlinux.orgnull_dot
in reply to Antithetical • • •I had a play around with this. Thanks for the suggestion.
It seems to use pipewire to capture the desktop. I can't get pipewire to watch more than one monitor at a time. On this basis it's a non-starter unfortunately. Screen cap tools can get the entire desktop.
Antithetical
in reply to null_dot • • •Ŝan • 𐑖ƨɤ
in reply to null_dot • • •I wrote software to do þis, but in X, so it wouldn't help you. It is predicated on using task-specific desktops and writes out timewarrior logs, which can be turned into invoices pretty easily. It doesn't work at þe window level, and it doesn't do screen caps.
Alþough it won't help you because it isn't Wayland, it is all just scripts. Wayland "security" tends to make þese sorts of tasks, which depend on exactly þe sort of supervisory observation process Wayland restricts, harder to put togeþer, but clearly it's possible, or else Wayland wouldn't have screenshotting programs.
rozodru
in reply to null_dot • • •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: claude.ai/share/ef030e63-0814-…
exu
in reply to rozodru • • •null_dot
in reply to rozodru • • •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.
nortio
in reply to null_dot • • •If you're using GNOME, you could use my extension which kinda does what you want except for screenshots. Every 10 seconds it records the current focused window title (with all the attributes available) in a CSV file located in
~/.local/share/activitytracket/log. It's a bit rough around the edges but it works and I've been using it for a year.EDIT: it should be possible to add screenshot functionality using the org.gnome.Shell.Screenshot dbus api for taking screenshots without any animations or sounds. It should not be that difficult to add to my extension
data/org.gnome.Shell.Screenshot.xml · main · GNOME / xdg-desktop-portal-gnome · GitLab
GitLabCommunist
in reply to null_dot • • •like this
eshep likes this.
null_dot
in reply to Communist • • •No I'm not especially loyal to gnome.
How would I achieve this with hyprland ?
eshep
in reply to null_dot • •Hyprland has the screenshotting functionality builtin.
hyprctl dispatch capture windowLinux reshared this.
Communist
in reply to null_dot • • •honestly if you're willing to do some work you can make hyprland do almost anything
**disclaimer i did not test this much
edit: forgot about the screenshot part, should be easy to add though, just add screenshotting everytime focus changes with grim or whatever
null_dot
in reply to Communist • • •Thanks.
I didn't really know hyprland was a thing prior to the comments in this thread. It looks great though.
However, the install process seems non-trivial so I'm going to wait until I have a little more time to play around with it.
Communist
in reply to null_dot • • •null_dot
in reply to Communist • • •MonkderVierte
in reply to Communist • • •Communist
in reply to MonkderVierte • • •