Skip to main content

๐Ÿฆ Lion-OS

A complete graphical desktop operating system that runs inside Python.

Boot, login, a full window manager with snapping, a taskbar with desktop icons, and 15 built-in apps โ€” all rendered with Pygame. Installable from PyPI and started with a single command.

Install ยท Quick Start ยท Apps ยท Features ยท Themes ยท Development

Python License version tests


โœจ What is Lion-OS?

Lion-OS is a genuine desktop environment built from scratch in Python. It has its own boot sequence, a login screen, a window manager with drag / resize / snap-to-edge and corners, desktop icons, an Alt-Tab switcher, a taskbar with a live launcher, a working power menu, and a suite of 15 built-in applications โ€” including a built-in AI assistant that works with local and cloud models.

The v1.1 release ("Refined") added a performance engine (cached window chrome, prerendered wallpaper), window animations, animated theme transitions, and deep feature upgrades across the most-used apps.

The v1.1.1 patch release focuses on memory efficiency: the kernel now reuses full-screen overlay, glow, taskbar and fade surfaces instead of allocating them every frame; app-icon tiles and glass panels are cached; fonts are shared through a global cache instead of being rebuilt per draw call; and the System Monitor's graph no longer allocates a fresh fill surface each frame.

It's designed to be simple to run and genuinely fun to explore:

lionos

That's it. The desktop boots, you log in, and you have a working graphical OS.


๐Ÿš€ Install

Option 1 โ€” Install from source (recommended)

git clone https://github.com/ram1234598766-dotcom/Lion-OS.git
cd Lion-OS
python -m pip install .
lionos

Option 2 โ€” Install from PyPI

python -m pip install lionos
lionos

Requirements: Python 3.9+. On first run Lion-OS installs nothing extra โ€” Pygame and psutil are dependencies and come automatically.

Option 3 โ€” Run without installing

git clone https://github.com/ram1234598766-dotcom/Lion-OS.git
cd Lion-OS
python -m pip install pygame-ce psutil requests
python -m lionos

๐Ÿ–ฅ Quick Start

Command What it does
lionos Boot the desktop (windowed)
lionos --fullscreen Boot fullscreen
lionos --theme ocean Boot with a theme (dark, light, ocean, forest, violet, rose, sunset, midnight)
lionos --screen 1600x900 Boot at a specific resolution
lionos --reset Reset saved configuration
lionos --headless Run the smoke test (no display, for CI)
lionos --version Print the version

First-time use

  1. Run lionos. The OS boots with a progress bar, then shows the login screen.
  2. Press Enter to log in as the default user (or set a password in ~/.lionos/config.json).
  3. Click the ๐Ÿฆ Start button (bottom-left) to open the launcher, then search for any app.
  4. Double-click a desktop icon to launch an app, or right-click the desktop for a context menu.

Handy shortcuts

Key What it does
Win Toggle the launcher
Alt-Tab Switch between open windows
Alt-Tab โ†’ Tab Cycle through windows, release Alt to activate
Esc Close launcher / menus / power menu
โ†‘ โ†“ โ† โ†’ / Enter Navigate the launcher grid and launch

๐Ÿ“ฑ Built-in Apps

App Icon Description
AI Assistant ๐Ÿ’ฌ Chat with a built-in assistant โ€” Ollama, OpenAI or DeepSeek
Welcome ๐Ÿ‘‹ Getting-started tour of the OS
File Manager ๐Ÿ“ Breadcrumbs, back/forward history, right-click context menu (open/rename/delete/copy path)
Terminal โ–ฃ Full interactive shell with command history (โ†‘/โ†“), cwd prompt, built-in commands
Text Editor โœŽ Code editing with syntax highlighting, line numbers, Ctrl+S, Ctrl+F find
Calculator โˆ‘ Keyboard input, history panel, percent โ€” safe AST-based evaluation
Paint ๐ŸŽจ Canvas with brushes, shapes, fill, undo/redo, save to PNG
Notes ๐Ÿ—’ Autosaving per-note files in ~/.lionos/notes/, note sidebar, title from first line
System Monitor ๐Ÿ“Š Live CPU / RAM / disk / network graphs
Settings โš™ Themes, appearance, AI provider, system info, config reset
Media Player ๐ŸŽต Draggable seek bar, volume slider, playlist, next/prev, shuffle & loop
Browser ๐ŸŒ Lightweight web reader & search
App Store ๐Ÿ› Install Python packages via pip from inside the OS
About โ„น Version and platform info
UI Toolkit ๐Ÿงฐ Interactive demo of every widget

๐Ÿง  AI Assistant

Open AI Assistant, then configure the provider in Settings โ†’ AI Assistant:

Provider Endpoint Model
Ollama (default, local) http://localhost:11434/v1 llama3
OpenAI https://api.openai.com/v1 gpt-4o-mini
DeepSeek https://api.deepseek.com/v1 deepseek-chat

API keys are read from the environment (OPENAI_API_KEY, DEEPSEEK_API_KEY) or stored in ~/.lionos/config.json. Nothing is hardcoded. For Ollama, run ollama serve locally first.


๐ŸŽจ Themes

Eight built-in themes with a glassmorphism look, switchable live from Settings. Theme changes animate smoothly between palettes:

  • Dark ยท Light ยท Ocean ยท Forest ยท Violet ยท Rose ยท Sunset ยท Midnight

๐Ÿš€ Features

  • Performance engine โ€” cached window chrome (shadow/body/titlebar), prerendered wallpaper, dirty-flag redraw and a font cache keep the desktop smooth at 60fps.
  • Desktop icons โ€” double-click to launch, single-click to select, right-click the desktop for a context menu.
  • Window manager โ€” drag, resize, snap to edges and corners, maximize, minimize with open/close/minimize animations, Alt-Tab switcher.
  • Power menu โ€” lock, sleep, restart and shutdown from the taskbar, with a fade-out animation.
  • Launcher โ€” search-first with category tabs, keyboard grid navigation and a recent-apps row.
  • Keyboard-first โ€” Win-key launcher, arrow-key navigation, Alt-Tab window switching.
  • Animated theme transitions โ€” switching themes cross-fades every color.
  • Shared icon tiles โ€” the same gradient app icons appear in the launcher, taskbar, desktop and About screen.

๐Ÿงฑ Architecture

lionos/
โ”œโ”€โ”€ cli.py          # `lionos` command-line entry point
โ”œโ”€โ”€ kernel.py       # desktop env: boot, login, icons, taskbar, launcher, power menu
โ”œโ”€โ”€ wm.py           # window manager: drag, resize, snap, focus, z-order
โ”œโ”€โ”€ theme.py        # color themes & blending
โ”œโ”€โ”€ config.py       # persistent user configuration (~/.lionos/config.json)
โ”œโ”€โ”€ widgets.py      # UI toolkit: buttons, inputs, sliders, lists, menus
โ”œโ”€โ”€ ai/             # AI provider backends (Ollama / OpenAI / DeepSeek)
โ””โ”€โ”€ apps/           # 15 built-in applications
    โ”œโ”€โ”€ base.py     # App base class + registry
    โ””โ”€โ”€ ...         # calculator, terminal, paint, notes, etc.

New apps are trivial to add:

from lionos.apps.base import App

class MyApp(App):
    name = "My App"
    icon = "โœจ"
    def draw(self, surface, rect):
        ...  # draw into the window

# register in lionos/apps/__init__.py

๐Ÿงช Tests & CI

Run the automated suite (headless โ€” no display needed):

python -m pip install -e ".[dev]"
pytest

Tests cover boot, login, app registration, app rendering, calculator math (mouse + keyboard), window move/snap/close, corner snapping, Alt-Tab, launcher keyboard nav, desktop icons, theme switching + transitions, window chrome caching, terminal history and notes autosave โ€” plus the headless smoke test.

CI (.github/workflows/ci.yml) runs the full suite on every push and automatically builds a wheel + sdist and attaches them to a GitHub Release on tags. Tag pushes create the GitHub release only; publishing to PyPI is opt-in via a manual workflow run.


๐Ÿ“ฆ Releases

Pre-built wheels are attached to GitHub Releases:

pip install https://github.com/ram1234598766-dotcom/Lion-OS/releases/download/v1.1.1/lionos-1.1.1-py3-none-any.whl

๐Ÿ›  Development

git clone https://github.com/ram1234598766-dotcom/Lion-OS.git
cd Lion-OS
python -m pip install -e ".[dev]"
pytest                      # run tests
python -m lionos --headless # smoke test
lionos                      # run the desktop

๐Ÿ“„ License

MIT ยฉ Mrityunjay. See LICENSE.

Made with ๐Ÿ’› and Pygame.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lion_os_desktop-1.1.1.tar.gz (114.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lion_os_desktop-1.1.1-py3-none-any.whl (87.9 kB view details)

Uploaded Python 3

File details

Details for the file lion_os_desktop-1.1.1.tar.gz.

File metadata

  • Download URL: lion_os_desktop-1.1.1.tar.gz
  • Upload date:
  • Size: 114.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for lion_os_desktop-1.1.1.tar.gz
Algorithm Hash digest
SHA256 0da97b38455f8cf29da139e03b3f955fa44fb7a60dd7aed39eeaf03aaeb5efd2
MD5 8f178973cb11a26c4d940209e0c09674
BLAKE2b-256 2c0e602877828326cc5c44ad7a1119274f3e96a92bbd4948a469457b14648860

See more details on using hashes here.

File details

Details for the file lion_os_desktop-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for lion_os_desktop-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 63e9355cd6c0671a538b185dec08087351af5cc06fa2713ac0debabb6c89c832
MD5 dc48128d1eea0094269cbde9a4bb6e1b
BLAKE2b-256 8a5b33abcf0abc2334a643e968617290c21fd77d30c8351027175316ed4d023b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page