Metadata-Version: 2.4
Name: linux-desktop-manager
Version: 1.0.8
Summary: All-In-One Linux Desktop Environment & Remote Access Manager (XRDP, VNC, noVNC, X2Go, Tunnels) with Interactive Arrow-Key TUI & CLI
Author-email: Shashan Lumbhani <lumbhanishashan1510@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/soni-shashan/linux-desktop-manager
Project-URL: Repository, https://github.com/soni-shashan/linux-desktop-manager
Project-URL: Issues, https://github.com/soni-shashan/linux-desktop-manager/issues
Keywords: linux,desktop-environment,remote-desktop,xrdp,vnc,novnc,x2go,cloudflared,tunnelmate,tui,cli
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: System Administrators
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Terminals
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tunnelmate-cli>=1.1.8
Requires-Dist: rich>=13.0.0
Requires-Dist: questionary>=2.0.0
Dynamic: license-file

# ⚡ Linux Desktop Manager (`linux-desktop-manager`)

> **All-In-One Linux Desktop Environment & Remote Access Orchestrator**  
> *Interactive Arrow-Key TUI Menu, Full CLI Automation, 14 Desktops, 6 Remote Protocols, and Built-In TunnelMate Cloudflare Ingress.*

**Author:** [Shashan Lumbhani](mailto:lumbhanishashan1510@gmail.com)  
**License:** [MIT](LICENSE)  
**Supported Distros:** Ubuntu, Debian, RHEL, Fedora, Rocky Linux, AlmaLinux, Arch Linux, CachyOS, openSUSE, Alpine Linux  
**Environments:** Bare-Metal & Cloud VMs (Systemd) + Docker/LXC/Colab Containers (Non-Systemd)  
**Ingress Engine:** Powered by [TunnelMate (`tunnelmate-cli`)](https://pypi.org/project/tunnelmate-cli/)

---

## 🚀 Features

- **🎯 Interactive Arrow-Key TUI Menu:** Built with `questionary` and `rich` for seamless keyboard navigation over SSH.
- **🖥️ 14 Desktop Environments & Window Managers:**
  - *Full Desktops:* XFCE4 (Recommended), KDE Plasma, GNOME Shell, MATE, Cinnamon, LXQt, LXDE, Budgie, Deepin (DDE), Enlightenment.
  - *Lightweight & Tiling WMs:* i3wm, Openbox, IceWM, Fluxbox.
- **🌐 6 Remote Access Protocols & Web Consoles:**
  - **XRDP Server (Port 3389):** Microsoft Remote Desktop (`mstsc.exe`, Remmina, macOS RDP).
  - **OpenSSH Server + X11 Forwarding (Port 22):** Secure terminal with remote GUI application forwarding.
  - **TigerVNC Server (Port 5901):** Display `:1` RFB protocol for standard VNC viewers.
  - **noVNC HTML5 Web Desktop (Port 6080):** Zero-install browser desktop over WebSocket.
  - **X2Go Server (Port 22):** Low-bandwidth high-speed remote session over SSH.
  - **Cockpit Web Console (Port 9090):** Modern web administration console.
- **⚡ Built-In Public Cloud Ingress (Powered by TunnelMate):**
  - **TunnelMate Cloudflare TCP Tunnel (Windows RDP Port 3389):** Exposes Microsoft Remote Desktop over Cloudflare TCP protocol. Connect with `cloudflared access rdp --hostname <host> --url localhost:3389` and `mstsc.exe`.
  - **TunnelMate Cloudflare HTTP Tunnel (Browser noVNC Port 6080):** Instantly generates public HTTPS links (`https://*.trycloudflare.com/vnc.html`) for noVNC browser desktop.
- **🛡️ Integrated Security & Firewall:** 1-click port inspection and opening for UFW & Firewalld.
- **👤 Multi-User & Session Manager:** Automatic setup of `~/.xsession`, `~/.xsessionrc`, Polkit colord popup suppression, and DBus daemon handling.
- **🧹 Complete Clean Wipe:** Option to safely purge remote desktop services and restore server to clean state.

---

## 📦 Installation & Setup

### Option 1: Install from PyPI

```bash
pip install linux-desktop-manager
```

### Option 2: Install from Source

```bash
git clone https://github.com/shashansoni/linux-desktop-manager.git
cd linux-desktop-manager
pip install -e .
```

---

## 🎮 Usage

### 1. Interactive Arrow-Key TUI Menu (Default)

Launch the full interactive terminal menu with:

```bash
sudo linux-desktop-manager
# or short alias:
sudo ldm
```

Use your **Up/Down arrow keys**, **Space** to toggle checklist items, and **Enter** to select.

---

### 2. Command-Line (CLI) Automation

You can also use `linux-desktop-manager` in headless scripts, cloud deployment pipelines, and Docker containers:

```bash
# View real-time status of services, active DE, and listening ports:
sudo linux-desktop-manager --status

# Install a desktop environment:
sudo linux-desktop-manager --install-de xfce4

# Switch default active session for user:
sudo linux-desktop-manager --set-de xfce4 --user myuser

# Manage individual services:
sudo linux-desktop-manager --start xrdp
sudo linux-desktop-manager --stop xrdp
sudo linux-desktop-manager --restart tigervnc
sudo linux-desktop-manager --install-service novnc

# Control public cloud tunnels:
sudo linux-desktop-manager --tunnel rdp      # Start TunnelMate Cloudflare TCP tunnel for Windows RDP (Port 3389)
sudo linux-desktop-manager --tunnel cf       # Start TunnelMate Cloudflare HTTPS browser tunnel (Port 6080)
sudo linux-desktop-manager --tunnel stop     # Stop all public tunnels

# Open all remote desktop ports in firewall:
sudo linux-desktop-manager --allow-ports

# Clean wipe all remote desktop components:
sudo linux-desktop-manager --purge-all
```

---

## 🐍 Python Library API

You can import `linux_desktop_manager` directly in your Python projects and orchestration scripts:

```python
from linux_desktop_manager import (
    ServerEnv,
    DesktopEnvManager,
    RemoteServiceManager,
    TunnelManager,
    FirewallManager,
    UserManager
)

# 1. Inspect Server Environment
env = ServerEnv()
print("OS:", env.os_info["pretty_name"])
print("Package Manager:", env.pkg_mgr)
print("Runtime Mode:", env.env_type)
print("Listening Ports:", env.get_listening_ports())

# 2. Manage Desktop Environments
de_mgr = DesktopEnvManager(env)
de_mgr.install_desktop("xfce4", target_user="ubuntu", set_as_default=True)

# 3. Manage Remote Services
svc_mgr = RemoteServiceManager(env)
svc_mgr.install_service("xrdp", target_user="ubuntu")
svc_mgr.start_service("xrdp")

# 4. Manage Cloudflare Tunnels (Powered by TunnelMate)
tunnel_mgr = TunnelManager()

# Browser noVNC HTTP Ingress
url = tunnel_mgr.start_cloudflare_tunnel(port=6080)
print(f"Web Browser Desktop URL: {url}/vnc.html")

# Windows RDP TCP Ingress
rdp_url = tunnel_mgr.start_rdp_tcp_tunnel(port=3389)
print(f"Windows RDP Cloudflare TCP Address: {rdp_url}")
```

---

## 📄 License

This project is licensed under the **MIT License**. Created by [Shashan Lumbhani](https://pypi.org/project/tunnelmate-cli/).
