Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

I built a free Mac app that hides Desktop icons by flipping one bit

Описание и применение

Приложение Bare скрывает только скриншоты на рабочем столе macOS, меняя бит UF_HIDDEN, и позволяет быстро переключать видимость через глобальную горячую клавишу.

Задача

Hide Desktop icons on macOS without paying for paid apps and without moving files.

Результат

Bare hides only screenshots on the Desktop by flipping the UF_HIDDEN flag, allowing quick toggle via a global hotkey, and automatically hides new screenshots as they appear.

Рабочий процесс

  • 1. Scan ~/Desktop for items
  • 2. Classify items by type (aliases, apps, folders, screenshots, others)
  • 3. For each item, if it matches hide criteria, set UF_HIDDEN flag via lstat/lchflags
  • 4. Track hidden items by name to allow selective unhide
  • 5. Use a DispatchSource to watch for new screenshots and hide them automatically
  • 6. Provide a global hotkey (⌃⌥⌘H) via RegisterEventHotKey to toggle visibility
  • 7. For disk icons, toggle Finder preference ShowHardDrivesOnDesktop and relaunch Finder

Доказательства

I wanted to hide the icons on my Mac Desktop. That was the whole requirement.

Источник

Bare: a small menu bar app with one job. Click the eye, the Desktop is clean. Click again, everything is back.

Источник

macOS already has a "hidden" flag on the filesystem: UF_HIDDEN, the same one chflags hidden sets.

Источник

If you'd already hidden some files yourself, a simple "unhide everything" would reveal them. So Bare keeps a set of the names it hid.

Источник

The edge case I haven't solved: Tracking by name means that if you rename a file while it's hidden, it leaves the set, and "Show" won't bring it back.

Источник

A DispatchSource file-system object watches ~/Desktop. Saving a file can fire several events, so the rescan is debounced by 0.4 seconds.

Источник

Most global-hotkey code asks for Accessibility access. Carbon's RegisterEventHotKey doesn't need it, and it's still the simplest way to do one global shortcut on macOS.

Источник

  • Дата записи: 2026-10-17T03:56:00.221Z