Tena koutou,
He maha nga tuhinga kei runga i te Ipurangi mo te kaupapa me pehea te whakarite hononga mamao ki tetahi huihuinga Xorg na roto i te x11vnc, engari kaore au i kitea ki hea me pehea te pehi i te kaitirotiro o te rohe me te whakauru kia taea e te tangata e noho ana i te taha o te rorohiko mamao. kaore koe e kite i taau e mahi ana, kaore hoki e pehi i nga paatene i to waahi. Kei raro i te tapahi ko taku tikanga mo te hanga x11vnc kia rite ki te hono atu ki te Matapihi ma te RDP.
Na, me kii kua mohio koe ki te whakamahi i te x11vnc, ki te kore, ka taea e koe te google, te panui ranei hei tauira.
Ka hoatu: ka whakarewahia e matou te x11nvc, hono atu ki te kiritaki, ka mahi nga mea katoa, engari kei te waatea ano te papatohu o te rohe o te rorohiko mo te tiro me te whakauru.
E hiahia ana matou: whakawetohia te papatohu o te rohe (aroturuki + papapātuhi + kiore) kia kore ai e kitea, ka uru ranei.
Te whakakore i nga kaitirotiro
Ko te mea tuatahi i puta ki te hinengaro ko te whakaweto noa i te aroturuki ma te xrandr, hei tauira penei:
$ xrandr --output CRT1 --off
engari i te wa ano, ko te taiao matapihi (kei ahau a KDE) ka timata ki te whakaaro kua tino whakakorehia te aroturuki ka timata ki te maka i nga matapihi me nga panui, ka neke nga mea katoa, ka pouri.
He huarahi pai ake, ko te tuku i te kaitirotiro ki te moe moe, ka taea e koe tenei hei tauira penei:
$ xset dpms force off
engari i konei hoki, kaore nga mea katoa i maeneene. Ka whakaohohia e te punaha te aroturuki i te huihuinga tuatahi. Ko te tootoo ngawari rawa atu i te ahua o te huringa ka awhina:
while :
do
xset dpms force off
sleep .5
done
Kaore au i whakaaro ake - he mangere ahau, ka mahi i tana kaupapa - kaore nga kaitirotiro e whakaatu i tetahi mea, ahakoa ka pehia e au nga paatene, nekehia te kiore, aha atu.
UPS:
Tuhinga
$ xrandr --output CRT1 --brightness 0
Te tapahi i te whakauru
Hei whakakore i te whakauru i whakamahia e ahau te xinput. Ina whakarewahia kaore he tawhā, ka whakaatuhia he rarangi o nga taputapu:
$ xinput
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Logitech USB Laser Mouse id=9 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Power Button id=7 [slave keyboard (3)]
↳ Sleep Button id=8 [slave keyboard (3)]
↳ USB 2.0 Camera: HD 720P Webcam id=10 [slave keyboard (3)]
↳ HID 041e:30d3 id=11 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=12 [slave keyboard (3)]
Pūrere Matua mariko... Kaore e taea e koe te whakakore - ka whakaatuhia he hapa, engari ko te toenga ka taea te whakahuri me te whakaweto, hei tauira, penei ka waiho koe kaore he kiore mo te meneti:
xinput disable 9; sleep 60; xinput enable 9
Whakamutunga Huringa
Mo taku keehi, i hanga e ahau he tuhinga ka whakahaerehia e au i roto i te waahi ssh. Ka pehia e ia te whakaurunga o te rohe me te whakaara i te tūmau x11vnc, ka mutu te tuhinga ka hoki mai nga mea katoa. Ko te mutunga mai, e toru nga tuhinga tuhi, kei konei (kua whakahoutia).
switch_local_console:
#!/bin/sh
case $1 in
1|on)
desired=1
;;
0|off)
desired=0
;;
*)
echo "USAGE: $0 0|1|on|off"
exit 1
;;
esac
keyboards=`xinput | grep -v "XTEST" | grep "slave keyboard" | sed -re 's/^.*sid=([0-9]+)s.*$/1/'`
mouses=`xinput | grep -v "XTEST" | grep "slave pointer" | sed -re 's/^.*sid=([0-9]+)s.*$/1/'`
monitors=`xrandr | grep " connected" | sed -re 's/^(.+) connected.*$/1/'`
for device in $mouses
do
xinput --set-prop $device "Device Enabled" $desired
done
for device in $keyboards
do
xinput --set-prop $device "Device Enabled" $desired
done
for device in $monitors
do
xrandr --output $device --brightness $desired
done
disable_local_console:
#!/bin/sh
trap "switch_local_console 1" EXIT
while :
do
switch_local_console 0
sleep 1
done
Ko te tikanga, ko te tuhinga matua (e rua aku kaitutei, ka whakatuu kotahi te tūmau noa me te kotahi mo ia aroturuki).
vnc_server:
#!/bin/bash
[[ ":0" == "$DISPLAY" ]] && echo "Should be run under ssh session" && exit 1
export DISPLAY=:0
killall x11vnc
rm -r /tmp/x11vnc
mkdir -p /tmp/x11vnc/{5900,5901,5902}
params="-fixscreen V=5 -forever -usepw -noxkb -noxdamage -repeat -nevershared"
echo "Starting VNC servers"
x11vnc -rfbport 5900 $params 2>&1 | tinylog -k 2 -r /tmp/x11vnc/5900 &
x11vnc -rfbport 5901 $params -clip 1920x1080+0+0 2>&1 | tinylog -k 2 -r /tmp/x11vnc/5901 &
x11vnc -rfbport 5902 $params -clip 1920x1080+1920+0 2>&1 | tinylog -k 2 -r /tmp/x11vnc/5902 &
echo "Waiting VNC servers"
while [ `ps afx | grep -c "x11vnc -rfbport"` -ne "4" ]
do
sleep .5
done
echo "Disabling local console"
disable_local_console
echo "Killing VNC servers"
killall x11vnc
Heoi ano. Takiuru ma te ssh ka whakarewahia vnc_server, i a ia e ora ana, ka taea e matou te uru ma te vnc ka mutu te papatohu o te rohe.
He mihi nui ki a koe mo to aro, he mihi ki nga taapiri me nga whakapainga.
Source: will.com