File tree 4 files changed +41
-15
lines changed
4 files changed +41
-15
lines changed Original file line number Diff line number Diff line change
1
+ vncdesk /font_path.py
2
+
1
3
# Byte-compiled / optimized / DLL files
2
4
__pycache__ /
3
5
* .py [cod ]
Original file line number Diff line number Diff line change 15
15
16
16
vncdesk 2 drawing.fig
17
17
18
- The optional argument ``drawing.fig `` is passed to the startup script.
18
+ Optional arguments, here ``drawing.fig ``, are passed to the startup script.
19
19
20
20
Files:
21
21
@@ -75,11 +75,19 @@ Installation
75
75
76
76
- Python 3
77
77
78
- - TigerVNC _ 1.4 or a compatible VNC server
78
+ - A compatible VNC server such as TigerVNC _ 1.4 or TightVNC _
79
79
80
80
- gtk-vnc _ 0.5 or compatible
81
81
82
- 3. Run with sufficient permissions::
82
+ 3. If you want to set up an explicit font path for the VNC server, at the same
83
+ level as ``__init__.py `` create ``font_path.py ``. Example contents::
84
+
85
+ font_path = ','.join('/usr/share/fonts/misc/',
86
+ '/usr/share/fonts/75dpi/',
87
+ '/usr/share/fonts/100dpi/',
88
+ '/usr/share/fonts/Type1/')
89
+
90
+ 4. Run with sufficient permissions::
83
91
84
92
python setup.py install
85
93
Original file line number Diff line number Diff line change 1
- from distutils .core import setup
1
+ from setuptools import setup
2
+
2
3
exec (open ('vncdesk/version.py' ).read ())
3
4
4
5
setup (
11
12
scripts = ["bin/vncdesk" ],
12
13
license = "WTFPL" ,
13
14
description = "Runs applications via VNC. Allows scaling applications." ,
14
- long_description = open ('README.rst' ).read ()
15
+ long_description = open ('README.rst' ).read (),
16
+ zip_safe = True
15
17
)
Original file line number Diff line number Diff line change @@ -26,22 +26,36 @@ def wait_for_xvnc():
26
26
while not path .isfile (_xvnc_lock_filename ):
27
27
sleep (0.1 )
28
28
29
- def start_xvnc ():
29
+ def font_path ():
30
+ try :
31
+ from .font_path import font_path
32
+ return font_path
33
+ except :
34
+ return None
35
+
36
+ def xvnc_cmd ():
30
37
global _display , _number , port
31
38
32
39
geometry = settings ['desktop' ]['width' ] + "x" + \
33
40
settings ['desktop' ]['height' ]
34
41
port = 5900 + _number
35
- cmd = " " .join (["Xvnc" ,
36
- _display ,
37
- "-desktop xfig" ,
38
- "-geometry " + geometry ,
39
- "-rfbauth " + _password_filename ,
40
- "-rfbport " + str (port ),
41
- "-pn" ,
42
- "&" ])
42
+ fp = font_path ()
43
+ a = ["Xvnc" ,
44
+ _display ,
45
+ "-desktop xfig" ,
46
+ "-geometry " + geometry ,
47
+ "-rfbauth " + _password_filename ,
48
+ "-rfbport " + str (port ),
49
+ "-pn" ]
50
+ if fp :
51
+ a .append ("-fp " + fp )
52
+ a .append ("&" )
53
+
54
+ return " " .join (a )
55
+
56
+ def start_xvnc ():
43
57
terminate ()
44
- system (cmd )
58
+ system (xvnc_cmd () )
45
59
wait_for_xvnc ()
46
60
47
61
def write_password_to_file ():
You can’t perform that action at this time.
0 commit comments