Skip to content

Instantly share code, notes, and snippets.

@kirb
Last active September 15, 2022 06:45
Show Gist options
  • Save kirb/bd6c3caab29234e453787b845ed8f9d1 to your computer and use it in GitHub Desktop.
Save kirb/bd6c3caab29234e453787b845ed8f9d1 to your computer and use it in GitHub Desktop.
Run gnome-control-center in Docker
#!/bin/bash
# I needed this because of bugs in a devel build of gnome-control-center.
# Use at your own risk.
xhost +local:
docker run \
--rm \
--privileged \
-it \
-e DBUS_SESSION_BUS_ADDRESS \
-e DISPLAY \
-e MYUID=$UID \
-e USER \
-e XAUTHORITY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v /dev:/dev \
-v /run:/run \
ubuntu:jammy \
bash -c 'apt-get update && \
apt-get install -y --no-install-recommends gnome-control-center && \
useradd -u $MYUID $USER && \
exec su $USER -c "gnome-control-center display"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment