gittech. site

for different kinds of informations and explorations.

Ohy – Lightweight, Privacy-First CLI for Packaging Web as Desktop Apps

Published at
Feb 3, 2025

ohy

"ohy" is derived from the Japanese word "γŠγ―γ‚ˆ" (good morning). It's a lightweight command-line tool written in Rust that converts web applications into desktop applications.

Key Features

  • Small single executable: Less than 5MB.
  • Data privacy isolation: Isolates based on the connection address and application name.
  • Multiple instances: Applications can be run concurrently with isolated session data by default.
  • Easy deployment: Simply copy the binary file for use; no need for sudo privileges.
  • Automatic icon retrieval: Automatically fetches the application icon.
  • Centralized caching: Local cache data is stored in a fixed directory, avoiding scattered data writes that could clutter system directories.

Usage

Usage: ohy --url <url> [-n <name>] [-w <width>] [-h <height>] [-a <user-agent>]

Options:
  --url             url example https://www.github.com
  -n, --name        name
  -w, --width       width default 1200
  -h, --height      height default 780
  -a, --user-agent  user agent
  --help, help      display usage information

Example

To create a desktop application for qwen chat:

ohy --url https://chat.qwenlm.ai -n qwen

Installation

  1. Install the application using Cargo
cargo install ohy
  1. Linux Dependencies (Windows and macOS do not require this step)

Arch Linux / Manjaro:

sudo pacman -S webkit2gtk-4.1

Debian / Ubuntu:

sudo apt install libwebkit2gtk-4.1-dev

Fedora

sudo dnf install gtk3-devel webkit2gtk4.1-devel

Centos

sudo yum install gtk3-devel webkit2gtk4.1-devel

Benefits

  • Lightweight and efficient resource usage
  • Enhanced privacy through session isolation
  • Simple and straightforward configuration
  • Cross-platform compatibility

Developers

The program has only been tested on Linux and Windows (since I'm a Linux user and don't have a Mac).
In theory, it should work on macOS (as the underlying dependency, wry, supports all platforms).
although there might be some bugs with crate imports. Mac users are welcome to submit issues.

screenshot

linux

qwen qwen-dark ohy-icon

linux app cache data directory $HOME/.config/ohy/*

app-context-dir

windows

app1 app2 app3 dark-mode icon

windows app cache data directory C:\Users\$USER_NAME\AppData\Roaming\ohy\*

web-content