Back to all writing
Project Log

CleanMyDesktop: Development Notes for a Desktop Archiving Tool

A concise project log covering file migration, safe backups, tray background mode, packaging, and the bugs fixed along the way.

Goal

The tool solves a small but real problem: desktop files pile up, but deleting them is risky. CleanMyDesktop moves rather than removes, keeping files in timestamped backup folders so the desktop is clean and recovery is still possible.

Core Implementation

The migration logic lives in desktop_cleaner/core.py. It creates a CleanMyDesktopBackup_YYYY-MM-DD_HH-MM-SS folder and moves desktop items into it. It skips desktop.ini and thumbs.db, and appends suffixes to duplicate names to avoid overwrites.

One important edge case is that the backup folder may also live on the desktop. Without a guard, old backups could be moved into new backups. The fix is to detect and skip archive paths to avoid recursive nesting.

Background Mode

The interface is built with Tkinter. Auto mode uses after() to schedule the next migration without an extra service. Closing the window hides the app to the system tray, where it can be restored or fully exited.

Startup is implemented through the current user's Windows Run registry key. Settings are stored in %USERPROFILE%\.cleanmydesktop\settings.json, with compatibility for the older .desktopclean config so renamed versions keep user settings.

Fixes

One UI issue was truncated Chinese time units; this was fixed with more stable control widths. Another issue was long next-run timestamps overflowing the status panel, so v1.1.1 moved that display into a fixed status area.

The project also moved from DesktopClean to CleanMyDesktop. That touched launchers, backup folder prefixes, release packages, README text, settings paths, and tests, so it was more than a title change.

Validation and Release

Tests cover migration naming, duplicate files, backup-folder skips, path containment, and folder-size calculations. Before release, the project runs python -m unittest discover -s tests and python -m compileall desktop_cleaner tests scripts.

The release script copies source, assets, launchers, README, Release Notes, and LICENSE, removes cache files, then builds CleanMyDesktop-version.zip. The release structure stays predictable.

Summary

CleanMyDesktop is not about complex features. It is about reliable boundaries: no overwrites, no accidental recursive moves, recoverable backups, clear exit behavior, and repeatable releases.