Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
On Ubuntu 21.04, this script enables gnome-terminal to show sixel images. (Ref: https://www.kofuk.org/blog/20210803-vte-sixel/, https://twitter.com/man_2_fork/status/1422514528886030337?s=19 )
#!/usr/bin/env -S bash -e
# REPO='https://gitlab.gnome.org/GNOME/vte.git'
REPO='https://github.com/GNOME/vte.git'
LIBPATH='/usr/local/lib/x86_64-linux-gnu'
LDCONFPATH='/etc/ld.so.conf'
# See Deps:
# https://github.com/GNOME/vte/blob/master/meson.build
# On Ubuntu 21.04, GNOME-Terminal 3.38.1:
sudo pip install meson
sudo apt install build-essential git libfribidi-dev \
libgirepository1.0-dev libglib2.0-dev \
libgnutls28-dev libpango-1.0-0 libpcre2-8-0 \
libpthread-stubs0-dev libsystemd-dev ninja-build \
python3-pip valac zlib1g-dev -y
(
[ -d "./vte/.git" ] || {
git clone --depth 1 "$REPO" vte
}
cd vte
meson . _build -Dsixel=true && cd _build && ninja
sudo ninja install
grep -q "$LIBPATH" "$LDCONFPATH" || {
sudo sed -i "1iinclude $LIBPATH" "$LDCONFPATH"
sudo ldconfig
}
)
echo -n "done! kill all gnome-terminal-server?(n/y): "
read -r i
[ "$i" = "y" ] && killall gnome-terminal-server
@eggplants

This comment has been minimized.

Copy link
Owner Author

@eggplants eggplants commented Aug 3, 2021

image

@eggplants

This comment has been minimized.

Copy link
Owner Author

@eggplants eggplants commented Aug 3, 2021

Test

go get github.com/mattn/go-sixel/cmd/gosr
sudo apt-get install -y libsixel-bin

byobu - Running

image

byobu - Not running

image

@eggplants

This comment has been minimized.

Copy link
Owner Author

@eggplants eggplants commented Aug 3, 2021

sudo apt install w3m
w3m -sixel google.com

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment