DEV Community

sasakirooo
sasakirooo

Posted on

GrassLock - Limit Screentime for programmers

Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass Submission 🌿

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass

What I Built

Overview

GrassLock is an open-source, dual-ecosystem screen sentinel designed to break software developers out of hyperfocus tunnel vision and reconnect them with the physical world. It pairs an Electron desktop monitor on Linux with a native Android Jetpack Compose companion app, linked via local sockets over Wi-Fi or USB.

What It Does

Unlike soft notification reminders that developers reflexively dismiss, GrassLock enforces genuine behavioral change:

  1. Active Process Monitoring: The desktop sentinel tracks active window focus across developer tools (such as Antigravity IDE, VS Code, Firefox, and Chrome). The session timer only advances when active coding or research occurs.
  2. Real Operating System Process Freezing: When the designated focus threshold concludes, GrassLock suspends active target applications at the kernel level using Linux kill -STOP signals while displaying an unignorable fullscreen lockout veil.
  3. Dual-Gated Recovery Protocol: To unlock the computer and thaw frozen applications via kill -CONT, the developer must satisfy two strict criteria:
    • Authentic Nature Verification: Step outside and capture a live photo of outdoor greenery, foliage, sky, buildings, or natural daylight using the Android companion app. The image is evaluated via multimodal inference by Google's open-weight Gemma 4 AI model (gemma-4-26b-a4b-it) to verify genuine outdoor presence.
    • Mandatory 2-Minute Rest Cooldown: Even after nature is verified, the workstation remains locked until a full two-minute cooldown timer concludes, guaranteeing real physiological relaxation for the eyes and mind. ### How It Gets People Off the Screen and Into the World Most productivity tools rely on voluntary compliance, which invariably fails during intense debugging sessions. GrassLock changes the equation by making outdoor nature the cryptographic key to workstation recovery:
  4. Hardware Separation: Because the camera verification requires the mobile companion app, developers cannot cheat by uploading desktop wallpaper or stock images from their PC.
  5. Physical Relocation: The model rejects indoor office setups, monitors, dark blurry indoor shots, and ceiling lights. To pass verification, the developer must stand up, walk toward a window, step out onto a balcony, or walk into a garden or park.
  6. Enforced Pause: The mandatory 2-minute cooldown ensures developers do not immediately sprint back to their keyboard, providing an intentional window to stretch, breathe fresh air, and rest ocular muscles. ### Who It Is For GrassLock is built for software engineers, remote developers, competitive hackers, and students prone to multi-hour marathon desk sessions. It is tailored for knowledge workers who need an uncompromising safeguard against digital burnout, eye strain, and physical stagnation.

Demo

youtube

Code

github repo

How I Built It

Open-Source AI Core

GrassLock is built around Google Gemma 4 (gemma-4-26b-a4b-it), an open-weight multimodal vision-language model. Gemma acts as an automated field judge: it analyzes photos taken with the mobile app to verify authentic outdoor elements (grass, plants, sky, natural daylight) while rejecting indoor screens, keyboards, and desk setups.

Because Gemma is open-weight, the inference pipeline uses standard multimodal schemas. While our implementation queries Gemma 4 via Google AI Studio API for lightweight client execution, the architecture is fully swappable with local edge runtimes like Ollama or vLLM.

Architecture and Implementation

  1. Desktop Sentinel (Electron & Node.js)

    • Monitors active Linux developer windows (code, antigravity, firefox, chrome).
    • Executes real process suspension at the OS level using kill -STOP <pid> when the session timer ends, preventing work evasion.
    • Renders a fullscreen lockout overlay designed with Taste Skill soft-skill principles (calm obsidian palette, zero emojis).
  2. Dual-Gated Unlock Engine

    • Workstations thaw only when two independent conditions pass:
      • Gate 1: Gemma 4 confirms the photo shows genuine outdoor nature.
      • Gate 2: A mandatory 2-minute (120-second) cooldown timer completes.
    • Once cleared, the sentinel sends kill -CONT <pid> to safely resume all suspended processes.
  3. Android Mobile Companion (Jetpack Compose)

    • Native mobile client paired via USB reverse tethering (127.0.0.1:3847) or local Wi-Fi.
    • Enforces live hardware camera capture (TakePicturePreview) so developers must physically step away from their desk rather than selecting gallery images.

Why Does Open Innovation Matter?

Open innovation and open-weight models are vital for a project like GrassLock for three core reasons:

  1. Trail and Edge Resilience: Real outdoor activities (hiking, parks, rural trails) often suffer from degraded or absent mobile connectivity. Because Gemma is open-weight, model weights can be packaged and run directly on edge hardware or offline laptops via runtimes like Ollama and MediaPipe, ensuring the verification mechanism functions without dependency on centralized cloud servers.
  2. Physical Privacy and Domestic Security: Forcing developers to photograph their immediate physical environment (balconies, backyards, neighborhood streets) presents severe privacy risks under closed, proprietary AI platforms that retain user prompts and images for corporate training. Open models give users absolute sovereignty over their sensory and environmental data.
  3. Zero Financial Barriers: Closed multimodal APIs impose recurring per-token fees and strict rate limits that penalize frequent use. Open-weight models empower solo developers, open-source contributors, and students to deploy robust screen-time sentinels indefinitely with zero API bills.

My Agent Session

This project was pair-programmed and architected using an AI coding assistant. You can inspect the complete open-source codebase, commit progression, and modular architecture directly in the GitHub repository linked above.


Prize Categories

  • Best Use of Gemma ($200): GrassLock utilizes Google Gemma 4 (gemma-4-26b-a4b-it), an open-weight multimodal vision-language model, as the core automated field judge to verify authentic outdoor nature photos and reject indoor workstation environments.
  • Overall Winner ($250): Hacktoberfest Open-Source AI Challenge: Week 1 (Touch Grass)

Top comments (0)