How suntzv/pratibimb works
1. Repository shape
- This is a Windows-only Chromium extension project with three deployable pieces:
- the browser extension under extension/
- the native Windows host under host/
- the installer under install/
- The top-level extension.zip and install/Pratibimb_Setup.exe are packaged artifacts, not core source.
2. Primary goal
- Pratibimb’s architecture is built around one key boundary: Chromium UI in the browser versus wallpaper access on Windows.
- The extension cannot read the desktop wallpaper directly, so it depends on a small native program to bridge that gap.
3. Browser extension subsystem
- extension/manifest.json defines the Chrome/Edge/Chromium extension.
- newtab.html + newtab.js implement the custom New Tab experience.
- customize.html + customize.js implement the settings/customization surface.
- ui.js appears to hold shared UI behavior for the extension pages.
- fastload.js likely exists to make the New Tab page render quickly and avoid a blank flash before wallpaper-driven styling is applied.
4. Wallpaper-to-UI data flow
- The native host reads the current Windows wallpaper and passes that information into the extension.
- The New Tab page then uses that wallpaper as the visual input for the entire UI theme: background, glassmorphism, lighting, and overall mood.
- The readme emphasizes that this is live and not polling-based, so the host is probably invoked or queried only when needed, rather than running a constant watcher loop.
5. Native host subsystem
- host/main.cpp is the Windows-side bridge.
- It is responsible for extracting wallpaper information from the OS and speaking the Chromium native messaging protocol.
- host/pratibimb_host.exe is the compiled host binary expected to be registered with the browser.
- stb_image.h and stb_image_write.h suggest the host may also decode or re-encode image data, not just forward file paths.
6. Installer subsystem
- install/installer.cpp is the setup program that automates the annoying parts:
- extracting files into AppData/local install locations
- registering the native messaging host with Windows/Chromium
- linking the browser extension ID to the native host
- install/resources.rc and install/resources.res indicate the installer has embedded UI/resources.
7. Installation boundary
- The readme’s manual steps match the architecture:
- install the extension folder in the browser
- copy the extension ID back into the installer
- let the installer wire up the native host
- That means the extension and host are loosely coupled through browser registration rather than being bundled as a single monolithic app.
8. Runtime integration model
- The browser extension is the always-visible front end.
- The native host is the privileged Windows bridge.
- Communication is indirect and sandbox-safe: the extension requests wallpaper data through Chromium’s native messaging mechanism, and the host returns the current wallpaper payload.
9. Customization surface
- The presence of customize.html/js implies the extension exposes configuration separate from the New Tab page.
- This likely covers visual or behavior options that alter how the wallpaper is interpreted or how the New Tab UI responds to it.
- From an architecture perspective, customization stays inside the extension boundary; it does not require changes to the Windows host.
10. Assets and presentation layer
- assets/, extension/icons/, and extension/fonts/ support the visual identity of the New Tab UI and installer.
- The repo is heavily presentation-driven: the wallpaper is not just a background image but the input to the page’s style system.
11. Platform and browser constraints
- The system is explicitly tied to Windows because the wallpaper source is Windows desktop state.
- It targets Chromium-based browsers that support native messaging and unpacked extension installation.
- The readme notes browser and Defender limitations, which are important operational constraints of the architecture.
12. What to diagram
- A good architecture diagram would show:
- Windows wallpaper source
- native host bridge (host/main.cpp / pratibimb_host.exe)
- Chromium extension (manifest.json, newtab, customize, shared UI)
- installer as the provisioning step that registers the bridge and installs files
- The key flow is: Windows wallpaper → native host → extension → themed New Tab UI.
Main entry points: installer.cpp Installer · main.cpp Host Main · newtab.js New Tab JS · customize.js Customize JS
Components 17
Browser Extension
Chromium extension UI and theming surface
- Manifest · Declares the Chromium extension and permissions
extension/manifest.json - New Tab · Custom new tab experience
extension/newtab.html - New Tab JS · Wallpaper-driven rendering and page behavior
extension/newtab.js - Fast Load · Avoids blank flash before theming applies
extension/fastload.js - Customize · User customization surface
extension/customize.html - Customize JS · Handles customization interactions and options
extension/customize.js - Shared UI · Common extension UI behavior
extension/ui.js - Wallpaper Theme · Turns wallpaper input into background, lighting, and glassmorphism
Native Host
Windows bridge that reads wallpaper and speaks native messaging
- Host Main · Reads wallpaper and responds over native messaging
host/main.cpp - Host EXE · Registered native messaging executable
host/pratibimb_host.exe - Image Decode · Embedded image decoding and writing support
host/stb_image.h
Installer
Provisioning and registration tooling
- Installer · Installs files and registers the native host
install/installer.cpp - Installer Resources · Installer UI assets and resource definitions
install/resources.rc - Setup EXE · Built installer artifact
install/Pratibimb_Setup.exe
Assets
Shared presentation resources
- Presentation Assets · Icons, fonts, and other visual resources
assets
Other components
- Windows Wallpaper · Current desktop wallpaper state on Windows
- Native Messaging · Chromium native messaging channel between extension and host
Connections 18
- Windows Wallpaper → Host Main: reads · Native host extracts the current wallpaper from Windows
- Host Main → Native Messaging: responds via · Host returns wallpaper payloads over Chromium native messaging
- Manifest → Native Messaging: declares · Extension is configured to talk to the native host
- New Tab → New Tab JS: uses · Page loads its behavior script
- New Tab → Fast Load: boots with · Fast-load script prepares the page before full theming
- New Tab JS → Shared UI: shares · New Tab reuses common UI behavior
- Customize → Customize JS: uses · Settings page loads its controller script
- Customize JS → Shared UI: shares · Customization UI uses shared helpers
- New Tab JS → Wallpaper Theme: builds · Wallpaper data is transformed into the themed interface
- Customize JS → Wallpaper Theme: adjusts · Customization changes how wallpaper-driven theming behaves
- Host Main → Image Decode: depends on · Host includes image processing helpers
- Host Main → Host EXE: builds · Source compiles into the registered host executable
- Installer → Host EXE: installs · Installer deploys the native host binary
- Installer → Manifest: registers · Installer wires the extension ID to the native host
- Installer → Installer Resources: packages · Installer embeds resources and UI definitions
- Installer → Setup EXE: builds · Source compiles into the setup executable
- Presentation Assets → New Tab: supports · Icons/fonts contribute to the extension presentation
- Presentation Assets → Customize: supports · Shared visual assets also support settings UI