View Single Post
Old 04-21-2023, 10:51 PM   #20
elinkser
Groupie
elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.
 
Posts: 185
Karma: 146236
Join Date: Oct 2022
Device: Kobo Clara HD
RUN einkvnc2 FROM NICKEL MENU

RUN einkvnc2 FROM NICKEL MENU


*NOTE: You must install NickelDBus to implement this NickelMenu entry because it requires the user to enter the last 3 digits of the VNC server address, since those digits seem to change with each session (when running the hotspot server from the same device as the VNC server).

And NickelDBus actually allows you to enter an input line of text, with onscreen keyboard and all, though there are not many examples out there that I could find. So I had to rely on this outdated example to get me started.


So, as before:

ROTATE THE VNC SERVER DEVICE TO LANDSCAPE ORIENTATION.

Put the ClaraHD in landscape mode using the SECOND nickel menu entry):
# Nickel_Orientation Actions
menu_item : main : Orientation - LANDSCAPE - handle above : nickel_orientation: landscape
menu_item : main : Orientation - LANDSCAPE - handle below : nickel_orientation: inverted_landscape
menu_item : main : Orientation - PORTRAIT - handle on left : nickel_orientation: inverted_portrait
menu_item : main : Orientation - PORTRAIT - handle on right : nickel_orientation: portrait
#


Create the following script /mnt/onboard/opt/vncNexus.sh:

#!/bin/sh
# vncNexus connect command
strip_qndb_prefix() {
printf "%s" ${1#dlgConfirmTextInput }
}
qndb -m dlgConfirmCreate true
qndb -m dlgConfirmSetTitle "Enter VNC address fourth octet:"
qndb -m dlgConfirmSetLEPlaceholder "einkvnc2 192.168.43.fourthoctet"
qndb -m dlgConfirmShow
result=$(qndb -s dlgConfirmTextInput)
fourthoctet=$(strip_qndb_prefix "$result")
vnccmd="/mnt/onboard/opt/einkvnc2 192.168.43.$fourthoctet 5900 --password mypw --contrast 2 "
qndb -m mwcToast 3000 "$vnccmd"
eval "$vnccmd"


You can start and stop the einkvnc2 VNC client (you created in the previous post) with the following NickelMenu entries (in /mnt/onboard/.adds/nm/config.txt):

menu_item :main :Einkvnc2 192.168.43.suffix :cmd_spawn :quiet:exec /mnt/onboard/opt/vncNexus.sh
chain_success :dbg_toast :Started einkvnc2
chain_failure :dbg_toast :Error
menu_item :main :Stop einkvnc2 :cmd_spawn :quiet:/usr/bin/pkill einkvnc2
chain_success :dbg_toast :Stopped einkvnc2
chain_failure :dbg_toast :Error

Last edited by elinkser; 04-24-2023 at 02:49 PM. Reason: corrected term
elinkser is offline   Reply With Quote