npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@osmn-byhn/widget-core-linux

v1.0.0

Published

High-performance desktop widget manager library for Linux.

Readme

WidgetCore-Linux 🐧

@osmn-byhn/widget-core-linux is a high-performance, Linux-native library designed for developers who want to create beautiful, interactive, and persistent desktop widgets without the overhead of heavy frameworks.

Built with Node.js and C++, it leverages WebKitGTK to provide a lightweight alternative to Electron, optimized specifically for the Linux desktop experience.


🏗️ Architecture: Hybrid Power

WidgetCore uses a sophisticated hybrid model to ensure both developer productivity and runtime efficiency.

graph TD
    A[Node.js Runtime] --> B[DesktopWidget API]
    B --> C[WidgetRegistry (Persistence)]
    B --> D[AutostartManager (Systemd/XDG)]
    B --> E[Native C++ Addon (N-API)]
    E --> F[GTK3 Windowing]
    E --> G[WebKitGTK Rendering]
    F --> H[Wayland (gtk-layer-shell)]
    F --> I[X11 (EWMH/Xlib)]

⚡ Why WidgetCore-Linux?

Unlike generic cross-platform frameworks, WidgetCore-Linux is built from the ground up for the Linux ecosystem.

| Feature | WidgetCore-Linux | Electron | | :--- | :--- | :--- | | Memory Footprint | ~15MB - 30MB | 150MB+ | | Windowing | Native GTK Layers | Chromium Windowing | | Wayland Support | Native gtk-layer-shell | XWayland / Ozone | | System Integration | Linux-specific Autostart | Generic | | Security | Hardware-level Sandboxing | Software-level Isolation |


✨ Features at a Glance

  • 🚀 Performance First: Direct access to GTK widgets and WebKit rendering without Chromium's overhead.
  • 🖼️ Aggressive Transparency: Deep integration with window managers to ensure widgets blend perfectly with any wallpaper.
  • 🖇️ Universal Linux Support: Binary compatibility for Wayland and X11 (including GNOME, KDE, LXQt, and Tiling WMs).
  • 🖱️ Flexible Interactivity: Seamlessly toggle between "Click-through" passive mode and "Interactive" desktop utility mode.
  • 💾 Zero-Config Persistence: Built-in registry that remembers your widgets' positions, sizes, and states across reboots.
  • 🔒 Security Shield: A built-in security layer that sandboxes the widget's JS environment, blocking sensitive Node.js APIs by default.

🔒 Security Shield Architecture

Security is non-negotiable for desktop widgets that might load external content. Our "Security Shield" provides:

  1. Protocol Filtering: Restricts content to http:, https:, or vetted file: paths.
  2. Context Isolation: Each widget runs its JS in a separate WebKit context.
  3. Keyword Inspection: Prevents execution of strings containing dangerous keywords like require, process, or child_process.
  4. API Freezing: Injects a protective script that locks down sensitive globals before the widget content loads.

🚀 Getting Started

Installation

npm install @osmn-byhn/widget-core-linux

Basic Usage: Remote Widget

import { DesktopWidget } from '@osmn-byhn/widget-core-linux';

// Load a remote dashboard
const widget = new DesktopWidget('https://your-dashboard.com', {
  width: 400,
  height: 600,
  x: 100,
  y: 100,
  opacity: 0.9,
  interactive: true
});

// Ensure it starts when the system boots
await widget.makePersistent({ name: 'My Dashboard' });

Advanced Usage: Local HTML with Blur

const clockHTML = `
  <div style="font-size: 50px; color: white; filter: drop-shadow(0 0 10px blue);">Time: <span id="t"></span></div>
  <script>
    setInterval(() => document.getElementById('t').innerText = new Date().toLocaleTimeString(), 1000);
  </script>
`;

const clock = new DesktopWidget("", {
  html: clockHTML,
  width: 400,
  height: 200,
  x: 800,
  y: 10,
  blur: true, // Enable backdrop-blur via WebKit
  scroll: false
});

🛠️ API Documentation

DesktopWidget(url, options)

| Option | Type | Default | Description | | :--- | :--- | :--- | :--- | | width | number | Required | Window width. | | height | number | Required | Window height. | | x | number | Required | Initial X position. | | y | number | Required | Initial Y position. | | opacity | number | 1.0 | Global widget transparency (0-1). | | blur | boolean | false | Apply CSS backdrop-blur to the window. | | sticky | boolean | true | Pin to desktop (always below other windows). | | interactive | boolean | true | Allow clicks/scrolls. | | scroll | boolean | true | Show/hide scrollbars. | | permissions | string[] | [] | List of allowed system capabilities. |


🐧 Distribution & Environment

WidgetCore-Linux handles the complexity of Linux desktop protocols automatically.

  • Wayland Support: Uses gtk-layer-shell to anchor widgets to the desktop background layer.
  • X11 Support: Manages _NET_WM_STATE_BELOW atoms and sends periodic heartbeats to ensure the window stays at the bottom of the stack.
  • Autostart: Implements XDG Autostart specification by generating .desktop files in ~/.config/autostart/.

System Requirements

Ensure you have the following development libraries installed:

  • Debian/Ubuntu: libwebkit2gtk-4.0-dev, libgtk-3-dev, libgtk-layer-shell-dev
  • Arch: webkit2gtk, gtk3, gtk-layer-shell
  • Fedora: webkit2gtk4.0-devel, gtk3-devel, gtk-layer-shell-devel

🧪 Development & Testing

We use Vitest for unit testing and Xvfb for headless GUI verification.

# Install and build
npm install
npm run build

# Run tests
npm test

# Headless GUI test (requires xvfb)
xvfb-run -a node test_cyberpunk.js

📝 License & Authors

MIT License. Copyright (c) 2026 Osman Beyhan.

Special thanks to the Web Widgets Community for inspiring the widget engine.