fathyb / carbonyl
- понедельник, 30 января 2023 г. в 00:35:56
Chromium running inside your terminal
carbonyl
Carbonyl is a Chromium based browser built to run in a terminal. Read the blog post.
It supports pretty much all Web APIs including WebGL, WebGPU, audio and video playback, animations, etc..
It's snappy, starts in less than a second, runs at 60 FPS, and idles at 0% CPU usage. It does not require a window server (i.e. works in a safe-mode console), and even runs through SSH.
Carbonyl originally started as html2svg
and is now the runtime behind it.
# Watch YouTube inside a Docker container
$ docker run -ti fathyb/carbonyl https://youtube.com
Wikipedia.mp4 |
Doom.mp4 |
YouTube.mp4 |
Few notes:
scripts/
directory are simple wrappers around gn
, ninja
, etc..Fetch Chromium's code.
$ ./scripts/gclient.sh sync
Any changes made to Chromium will be reverted, make sure to save any changes you made.
$ ./scripts/patches.sh apply
$ ./scripts/gn.sh args out/Default
Default
is the target name, you can use multiple ones and pick any name you'd like, i.e.:$ ./scripts/gn.sh args out/release $ ./scripts/gn.sh args out/debug # or if you'd like to build a multi-platform image $ ./scripts/gn.sh args out/arm64 $ ./scripts/gn.sh args out/amd64
When prompted, enter the following arguments:
import("//carbonyl/src/browser/args.gn")
# uncomment this to build for arm64
# target_cpu="arm64"
# uncomment this to enable ccache
# cc_wrapper="env CCACHE_SLOPPINESS=time_macros ccache"
# uncomment this if you're building for macOS
# use_lld=false
# uncomment this for a release build
# is_debug=false
# symbol_level=0
$ ./scripts/build.sh Default
This should produce the following outputs:
out/Default/headless_shell
: browser binaryout/Default/icudtl.dat
out/Default/libEGL.so
out/Default/libGLESv2.so
out/Default/v8_context_snapshot.bin
# Build arm64 Docker image using binaries from the Default target
$ ./scripts/docker.sh arm64 Default
# Build amd64 Docker image using binaries from the Default target
$ ./scripts/docker.sh amd64 Default
$ ./scripts/run.sh Default https://wikipedia.org