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 (
39
39
"unsafe"
40
40
)
41
41
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
+
42
60
func init () {
43
61
ok := C .clipboard_test ()
44
62
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 )
49
64
}
50
65
}
51
66
You can’t perform that action at this time.
0 commit comments