TECH HUD MOUNTER

OVERVIEW
Tech HUD Mounter is a futuristic, lightweight GTK3 / Cairo-rendered desktop widget and drive manager designed for Linux environments, including lightweight distros like Puppy Linux and EasyOS. It provides real-time monitoring, mounting, unmounting, and file manager launching for all available volumes with a sleek sci-fi HUD aesthetic.

FEATURES

* Vector-Rendered Sci-Fi UI: Built with custom Cairo rendering, supporting dynamic glowing LEDs, corner cuts, and futuristic panels.
* Extensive Theme Engine: Comes packed with 20 built-in color themes (Cyber Cyan, Matrix Emerald, Amber Terminal, Bio-Luminescent, etc.).
* Customizable Typography & Layout: Independent font family selection, plus separate font size controls for titles and statuses.
* Opacity & Scaling Controls: Adjustable opacity slider (10% to 100%) and UI scaling (0.75x to 2.0x).
* Workspace Integration: Supports window layer options (Normal, Keep Above, Wallpaper Glass) and sticky positioning across all workspaces.
* Lightweight & Fast: Written in Vala for native performance with a minimal memory footprint.

DEPENDENCIES
To compile and run tech-hud-mounter, ensure you have the following libraries and development tools installed:

* valac (Vala compiler)
* gtk+-3.0
* cairo
* pangocairo
* gio-2.0

BUILD & INSTALLATION

1. Open a terminal in the project directory.
2. Run make to compile the source code:
make
3. Install the binary system-wide (optional):
sudo make install

USAGE
Launch the application directly from your terminal or application launcher:
./tech-hud-mounter

* Left-click & drag: Move the HUD window anywhere on your screen.
* Right-click: Open the context menu to access Settings, Refresh Drives, or Quit.


---

README - TECH HUD MOUNTER

PART 1: GENERAL OVERVIEW AND SYSTEM COMPATIBILITY

Tech HUD Mounter is a lightweight, futuristic Vala and GTK3 desktop utility designed to monitor and control local block devices and storage partitions. It presents each partition in a sleek, customizable sci-fi HUD style element equipped with status indicators, mount/unmount buttons, and file manager shortcuts.

Different Linux environments handle storage permissions and mounting architectures quite differently. Understanding these differences ensures seamless cross-distribution reliability:

1. Standard Desktop Distributions (such as Manjaro, Arch Linux, Linux Mint, Ubuntu, and Debian):
On these systems, users normally run graphical desktop applications under a standard non-root user account. Storage management is heavily delegated to UDisks2 via D-Bus (`udisksctl`). UDisks2 automatically handles mounting partitions into system or runtime directories without requiring root privileges for everyday users. To prevent permission denial errors and allow unprivileged user file access, Tech HUD Mounter automatically maps local fallback mount points into the user's home directory under ~/mnt/.
2. Lightweight and Specialized Distributions (such as Puppy Linux / s15pup32):
Puppy Linux operates fundamentally differently from standard multi-user desktop distributions. In Puppy, users run entirely as the root user by default, and storage management is tightly integrated with ROX-Filer desktop icons and core system scripts. Puppy expects external partitions and drives to be mounted directly under /mnt/ rather than inside individual home directories. If an application attempts to mount partitions into /root/mnt/ while Puppy expects /mnt/, it creates path conflicts with native desktop shortcuts and file manager bookmarks.

Tech HUD Mounter includes built-in environment detection to automatically adapt to these differing behaviors. When running as root or inside a Puppy Linux environment, the utility seamlessly routes mount targets to /mnt/, ensuring absolute compatibility with native desktop file managers like ROX-Filer while keeping standard user environments safely isolated within ~/mnt/.

PART 2: TECHNICAL ARCHITECTURE, METHODS, AND FALLBACKS

Tech HUD Mounter employs a robust multi-layered architecture designed to guarantee resilience against restricted D-Bus permissions, dirty filesystems, and unmountable block device metadata.

1. Partition Discovery and Filtering:
The application invokes `lsblk -rno NAME,MOUNTPOINT,LABEL,FSTYPE` to fetch block device configurations. A filtering layer immediately discards loops, RAM disks, optical drives (`sr*`), and whole disks lacking partition numbers. Furthermore, partitions lacking an active file system type (`fstype == ""`), swap spaces, LVM2 members, and crypto_LUKS containers are filtered out to prevent errors when interacting with reserved system areas (such as Microsoft reserved partitions or raw EFI containers).
2. Primary Operations via UDisks2:
For standard operations, the app executes `udisksctl mount -b <device>` and `udisksctl unmount -b <device>`. This interacts cleanly with modern desktop session buses when policies permit.
3. NTFS Dirty State & ntfs-3g Fallback:
Windows partitions frequently retain a "dirty" status due to Fast Startup or improper unmounting, causing standard kernel drivers or UDisks2 to reject mounts with superblock errors. When such a failure is intercepted, Tech HUD Mounter prompts the user with an interactive Gtk Message Dialog asking whether to attempt a recovery mount. Upon confirmation, it invokes `sudo ntfs-3g -o remove_hiberfile <device> <target_dir>`, which strips the hibernation file lock and successfully mounts the volume.
4. Direct System Mount Fallback (D-Bus / UDisks2 Bypass):
In restricted environments, custom window managers, or when the UDisks2 D-Bus daemon is inactive or throws permission errors, `udisksctl` fails entirely. Tech HUD Mounter catches these exceptions and offers a direct mount fallback (`sudo mount <device> <target_dir>`). Unmounting follows a similar dual-tier approach, attempting `udisksctl unmount` first and automatically falling back to `sudo umount` if necessary.
5. Dynamic Path Resolution Logic:
The internal helper function `get_target_mount_dir()` checks `Posix.geteuid() == 0` and verifies the presence of `/etc/puppyversion`. If either condition is true, target directories are resolved to `/mnt/<label_or_device>`, aligning perfectly with Puppy Linux and root-level standards. Otherwise, it resolves to `~/mnt/<label_or_device>` for clean user-space isolation on standard desktop distributions.
