1
clino 2015-03-14 15:46:04 +08:00 via Android
ssh -X
|
4
lululau 2015-03-14 16:58:04 +08:00
|
5
whoops 2015-03-14 16:58:13 +08:00 1
|
6
ETiV 2015-03-14 17:17:14 +08:00 via iPhone
确定有显示器的话就 DISPLAY=:1 后接命令。export 出来也可以。
我树霉派上用这个加 mplayer 看片儿的 LS的 0.0 是啥意思? |
7
whoops 2015-03-14 17:27:09 +08:00
@ETiV
DISPLAY后面的变量含义是这样的 [host]:<display>[.screen] 0.0是第一个显示器的第一屏 我的ubuntu启动并登陆x后export查看是declare -x DISPLAY=":0" |
8
whoops 2015-03-14 17:39:09 +08:00
man X
查看X的手册里面有详细说明 From the user's perspective, every X server has a display name of the form: hostname:displaynumber.screennumber This information is used by the application to determine how it should connect to the server and which screen it should use by default (on displays with multiple monitors): hostname The hostname specifies the name of the machine to which the display is physically connected. If the hostname is not given, the most efficient way of communicating to a server on the same machine will be used. displaynumber The phrase "display" is usually used to refer to a collection of monitors that share a common set of input devices (keyboard, mouse, tablet, etc.). Most workstations tend to only have one display. Larger, multi-user systems, however, frequently have several displays so that more than one person can be doing graphics work at once. To avoid confusion, each display on a machine is assigned a display number (beginning at 0) when the X server for that display is started. The display number must always be given in a display name. screennumber Some displays share their input devices among two or more moni‐ tors. These may be configured as a single logical screen, which allows windows to move across screens, or as individual screens, each with their own set of windows. If configured such that each monitor has its own set of windows, each screen is assigned a screen number (beginning at 0) when the X server for that display is started. If the screen number is not given, screen 0 will be used. |
10
google456 OP @lululau 不行 ssh: Could not resolve hostname remote: Name or service not known
如果用 ssh root@ip remote 'open /Applications/Firefox.app' 会说bash: remote: command not found |
11
whoops 2015-03-14 18:08:38 +08:00
|
12
google456 OP @whoops 嗯 nohup我也想到了 也确实没问题.
第一种方法 没看明白 本来不就是firefox ¨www.google.com¨ 这样吗 远程打开了google.com 但是关闭ssh窗口 firefox就直接关闭了. |
13
whoops 2015-03-14 18:29:21 +08:00
@google456 用第二个方法吧,我表述有问题,保持firefox运行,这里的firefox运行不是由ssh启动的,你可以放到开机启动脚本中,登陆x后自启动,当你用ssh执行firefox url 后,再关闭,这个firefox进程不会随着你的ssh退出而退出的,忘了它吧,有点繁琐.
|
14
xieyudi1990 2015-03-15 03:50:49 +08:00 via iPhone
用screen目测也可以
我的iPhone上就是用screen保持后台的. |