Skip to content

Timeshift hint: say what Timeshift is doing, and show its progress - #142

Open
martin152 wants to merge 2 commits into
linuxmint:masterfrom
martin152:timeshift-hint-follows-timeshift
Open

martin152 wants to merge 2 commits into
linuxmint:masterfrom
martin152:timeshift-hint-follows-timeshift

Conversation

@martin152

@martin152 martin152 commented Nov 25, 2026 •

Copy link
Copy Markdown

Fixes #140.

The hint showed "A Timeshift system snapshot is being created." for any process called
timeshift, also while I was deleting a snapshot.

Timeshift already writes the kind of run that holds its lock to /var/run/lock/timeshift/lock
(backup for the hourly check, ondemand, delete, restore, nothing for the window), and has
for years. The hint now reads that, so it says whether a snapshot is being created, deleted or
restored, and quick --list calls don't flash the icon anymore. That part works with the
Timeshift in Mint today.

The hourly timeshift --check doesn't flash it either. When nothing is due it holds the lock for
one to three seconds (going by my Timeshift logs), so a scheduled check now only shows once it
publishes a task or has held the lock for more than 10 seconds. The 10 seconds are for Timeshift
versions that don't publish a status yet. Once it shows, it stays until the check is done, also in
the short pauses between steps when Timeshift publishes nothing.

If Timeshift also publishes its progress (linuxmint/timeshift#595), the percentage goes next to
the icon and the time remaining into the tooltip. Those are Timeshift's own numbers, the tray
doesn't estimate anything.

About my question in #140: with this the hint also shows while the window itself creates or
deletes a snapshot, because the window publishes the same status. If you'd rather keep it for
background runs only, it's one condition in is_running().

I tried it on my panel during a real snapshot made with the Timeshift branch from
linuxmint/timeshift#595: the icon showed the percentage next to it (10 % at 00:37, 65 % at
00:42). During a delete with the Timeshift from the Mint repositories it showed only the icon, as
before. I checked the tooltip texts for each kind of run, and the rule for the hourly check, with
fake lock and status files.

The hint said "A Timeshift system snapshot is being created." for any
process named timeshift, also while a snapshot was being deleted
(linuxmint#140), and it gave no idea of how far a snapshot had got.

Timeshift writes the kind of run that holds its lock to
/var/run/lock/timeshift/lock (backup, ondemand, delete, restore, or
nothing for the window). The hint now follows that file and says
whether a snapshot is being created, deleted or restored. Timeshift
versions that also publish their progress in
/var/run/lock/timeshift/status get the percentage next to the icon
and the time remaining in the tooltip; the numbers are Timeshift's
own. Quick listings no longer show the icon.

Fixes linuxmint#140.
The hourly timeshift --check holds the lock for a few seconds even when
nothing is due. Show a scheduled check only once it publishes a task, or
once it has held the lock for more than 10 seconds (Timeshift versions
without the status file), and keep it shown between its steps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Timeshift tray hint says a snapshot is being created while one is being deleted

1 participant