Skip to content

Commit

Permalink
Add Compose for the text editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jan 27, 2024
1 parent b7571e3 commit a55a2a0
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ RUN go get -d -v ./...
RUN go install -v ./go-wayland-simple-shm
RUN go install -v ./go-wayland-smoke
RUN go install -v ./go-wayland-imageviewer
RUN go install -v ./go-wayland-texteditor
RUN go install -v ./go-wayland-texteditor/editor_backend
RUN go install -tags wayland -v ./go-wayland-cube

RUN echo "#!/bin/sh" > /go/bin/texteditor
RUN echo "cd /go/src/app/go-wayland-texteditor" >> /go/bin/texteditor
RUN echo "/go/bin/editor_backend & /go/bin/go-wayland-texteditor" >> /go/bin/texteditor
RUN chmod +x /go/bin/texteditor

RUN apt-get --assume-yes install unzip build-essential autoconf libtool libxext-dev libx11-dev x11proto-gl-dev
RUN wget https://github.com/NVIDIA/libglvnd/archive/refs/tags/v1.3.4.zip
Expand Down
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3'

services:
texteditor:
build:
context: .
dockerfile: Dockerfile
environment:
- XDG_RUNTIME_DIR=/tmp
- WAYLAND_DISPLAY
volumes:
- ${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY}:/tmp/${WAYLAND_DISPLAY}
user: "${UID}:${GID}"
command: ["/go/bin/texteditor"]
entrypoint:
- /go/bin/texteditor

27 changes: 27 additions & 0 deletions run-texteditor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

if [ ! -v XDG_RUNTIME_DIR ]
then
echo "XDG_RUNTIME_DIR not set!"
exit -1
fi

wld="$WAYLAND_DISPLAY"

if [ ! -f $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY ]
then
for i in {9..0}
do
if [ -f "$XDG_RUNTIME_DIR/wayland-$i" ]
then
wld="wayland-$i"
break
fi
done
fi

docker run -e=XDG_RUNTIME_DIR=/tmp \
-e=WAYLAND_DISPLAY=$WAYLAND_DISPLAY \
-v=$XDG_RUNTIME_DIR/$wld:/tmp/$wld \
--user=$(id -u):$(id -g) \
go-wayland-demos /go/bin/texteditor

0 comments on commit a55a2a0

Please sign in to comment.