Git Product home page Git Product logo

webos-vncserver's Introduction

webos-vncserver

An somewhat hacky VNC server for WebOS.

Requires root privileges.

Usage

Install provided package, launch VNC Server app, adjust configuration (mind default enabled password), press "Save settings", and switch "Running" on.

You should then be able to connect via a VNC client of your choice, on port 5900.

Here it is, running on a "headless" TV motherboard, being accessed via a VNC mobile app.

Demo

Alternatively, webos-vncserver can be launched via CLI for debugging/testing:

# ./webos-vncserver

This will immediately launch VNC server, regardless of autostart options.

For extra logging VNCSERVER_DEBUG=1 environment variable can be set.

In order to make the service register on Luna bus when running via CLI LS_SERVICE_NAMES=org.webosbrew.vncserver.service environment variable needs to be set. This is usually not required, unless debugging some deeper frontend-service integration, since the service shall be started automatically by ls-hubd when called by frontend.

Caveats

  • This does not capture any hardware-accelerated video surfaces, only the UI layers.

  • Capture may conflict with other applications or webOS services. If video display hangs or crashes, try stopping relevant services (eg. via pkill -f captureservice) before starting the service up/connecting using VNC. Notable conflicting services:

    • piccap: hyperion-webos
    • webOS 5.x+: captureservice
  • tigervnc: "React too big" error can be alleviated by adding Autoselect=0 option to command line

  • webOS limited network throughput (100mbps over ethernet) requires use of JPEG, make sure your VNC clients supports it.

  • All configuration changes cause client disconnects.

Keybindings

  • SUPER ("Windows") button is HOME
  • Right mouse button is BACK
  • Mouse scroll should properly be interpreted as scrollwheel

Luna service control

(advanced users only)

VNC server is implemented as a proper Luna service. In order to make it run as root elevate-service script of Homebrew Channel needs to be used after install or upgrade - this is done automatically on first "VNC Server" app launch.

Service can be controlled using Luna service bus calls:

  • luna://org.webosbrew.vncserver.service/start - start up the service
  • luna://org.webosbrew.vncserver.service/stop - stop the service
  • luna://org.webosbrew.vncserver.service/status - return current status and configuration
  • luna://org.webosbrew.vncserver.service/quit - shut down the service altogether
  • luna://org.webosbrew.vncserver.service/configure - change configuration, supports:
    • width - capture width
    • height - capture height
    • framerate - framerate limit
    • autostart - start automatically on boot (assumes correct Homebrew Channel autostart configuration)
    • password - basic authentication - can be set to empty string for no authentication

As usual - all these commands can be issued using luna-send command like so:

luna-send -n 1 'luna://org.webosbrew.hbchannel.service/configure' '{"password": "test"}'
luna-send -n 1 'luna://org.webosbrew.hbchannel.service/start' '{}'

Building

Service

To cross-compile for WebOS, you will need an toolchain.

cmake -S . -B build && cmake --build build --target webos-vncserver --target capture_gm --target capture_halgal

This should have produced a build/service/ directory. Copy it over to your TV and run ./webos-vncserver as root!

Frontend

Configuration frontend is based on web technologies - in order to build it you will need NodeJS (18.x) and use:

npm install
npm run build

A convenience shortcut for native build here is provided as:

npm run build-native

Then, in order to package and deploy an app, use:

npm run package
npm run deploy
npm run launch

webos-vncserver's People

Contributors

informatic avatar davidbuchanan314 avatar mariotaku avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.