File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -39,13 +39,28 @@ import (
3939 "unsafe"
4040)
4141
42+ const errmsg = `Failed to initialize the X11 display, and the clipboard package
43+ will not work properly. Install the following dependency may help:
44+
45+ apt install -y libx11-dev
46+
47+ If the clipboard package is in an environment without a frame buffer,
48+ such as a cloud server, it may also be necessary to install xvfb:
49+
50+ apt install -y xvfb
51+
52+ and initialize a virtual frame buffer:
53+
54+ Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
55+ export DISPLAY=:99.0
56+
57+ Then this package should be ready to use.
58+ `
59+
4260func init () {
4361 ok := C .clipboard_test ()
4462 if ok < 0 {
45- panic (`cannot use this package, failed to initialize x11 display, maybe try install:
46-
47- apt install -y libx11-dev
48- ` )
63+ panic (errmsg )
4964 }
5065}
5166
You can’t perform that action at this time.
0 commit comments