in your debian PC or alpine PC or debian VPS,
sudo apt install zip libnss3 libatk1.0-0 libdrm2 libxcb1libxkbcommon0 libgbm1 libx11-6 libxext6 libasound2 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libatspi2.0-0
sudo apt install -y \
libasound2 libatk-bridge2.0-0 libatk1.0-0 libatomic1 libatspi2.0-0 \
libbrotli1 libc6 libcairo2 libcups2 libdbus-1-3 libdouble-conversion3 \
libdrm2 libevent-2.1-7 libexpat1 libflac8 libfontconfig1 libfreetype6 \
libgbm1 libgcc-s1 libglib2.0-0 liblcms2-2 \
libminizip1 libnspr4 libnss3 libopenjp2-7 libopus0 libpango-1.0-0 \
libpng16-16 libpulse0 libsnappy1v5 libstdc++6 libwebp6 \
libwebpdemux2 libwebpmux3 libwoff1 libx11-6 libxcb1 libxcomposite1 \
libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxml2 libxnvctrl0 \
libxrandr2 libxslt1.1 zlib1g libgtk-3-0
download the carbonyl.zip file, and unzip it,
run: ./carbonyl/carbonyl https://youtube.com
you can listen youtube music in your terminal now.
offical command line: ./carbonyl/carbonyl --no-sandbox --disable-dev-shm-usage https://youtube.com
new version:
$ cargo install alacritty #kitty and xfce-terminal can only zoom-out 6 times, and xface-terminal scrolling is slow
$ alacritty
in alacritty:
$ docker run -ti -e COLORTERM=24bit fathyb/carbonyl:next https://www.google.com/ncr --zoom=600 --bitmap
then presse "ctrl+-" 10 times to zoom-out the screen to get best resolution
the author gives up, won't support kitty and sixel, while the timg project support kitty
and it can show very clear image in kitty: ./timg-v1.6.2-x86_64.AppImage -pk a.png
alternatively, you can use: tight vnc server + python playwright with "--remote-debugging-port=9220" + chrome://inspect/ with "Discover network targets"
O O
\ /
O —— Cr —— O
/ \
O O
|
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 |
|
- Fullscreen mode not supported yet
Lynx is the OG terminal web browser, and the oldest one still maintained.
- When it understands a page, Lynx has the best layout, fully optimized for the terminal
Some might sound like pluses, but Browsh and Carbonyl let you disable most of those if you'd like
- Does not support a lot of modern web standards
- Cannot run JavaScript/WebAssembly
- Cannot view or play medias (audio, video, DOOM)
Browsh is the OG "normal browser into a terminal" project. It starts Firefox in headless mode and connects to it through an automation protocol.
- It's easier to update the underlying browser: just update Firefox
- This makes development easier: just install Firefox and compile the Go code in a few seconds
- As of today, Browsh supports extensions while Carbonyl doesn't, although it's on our roadmap
- It runs slower and requires more resources than Carbonyl. 50x more CPU power is needed for the same content in average, that's because Carbonyl does not downscale or copy the window framebuffer, it natively renders to the terminal resolution.
- It uses custom stylesheets to fix the layout, which is less reliable than Carbonyl's changes to its HTML engine (Blink).
Few notes:
- You need to build Chromium
- Building Carbonyl is almost the same as building Chromium with extra steps to patch and bundle the Rust library. Scripts in the
scripts/directory are simple wrappers aroundgn,ninja, etc.. - Building Chromium for arm64 on Linux requires an amd64 processor
- Carbonyl is only tested on Linux and macOS, other platforms likely require code changes to Chromium
- Chromium is huge and takes a long time to build, making your computer mostly unresponsive. An 8-core CPU such as an M1 Max or an i9 9900k with 10 Gbps fiber takes around ~1 hour to fetch and build. It requires around 100 GB of disk space.
Fetch Chromium's code.
$ ./scripts/gclient.sh syncAny 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
Defaultis 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 DefaultThis should produce the following outputs:
out/Default/headless_shell: browser binaryout/Default/icudtl.datout/Default/libEGL.soout/Default/libGLESv2.soout/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