12-04-2021, 05:27 PM | #1 |
Member
Posts: 24
Karma: 10
Join Date: Jun 2021
Device: Kindle Touch K5
|
Custom Menu Options on Kterm
Greetings,
Where are the options set for the menu that pops up with two fingers on kterm? I want to fire off a custom script, either when I do the two-finger tap or, safer, as an option sibling to “rotate screen” or “toggle keyboard” so that I can potentially ssh into a raspi I’m using for a kindle berry project without using the kindle’s keyboard. Is this possible? I’ve been looking through the repo for kterm and have not found where those menu options or their behavior might be set. Eternally grateful, JBG |
12-04-2021, 05:43 PM | #2 |
Enthusiast
Posts: 35
Karma: 10
Join Date: Jan 2016
Device: PW2 PW3 DPT-RP1
|
This should get you started. Though you might want to spawn a shell first.
|
Advert | |
|
12-05-2021, 12:18 PM | #3 |
Member
Posts: 24
Karma: 10
Join Date: Jun 2021
Device: Kindle Touch K5
|
Thanks for the suggestion! I’ve never coded in c, but this looks relatively straightforward. I plan to use system() to run ssh, but some forums recommend this might not be the best method. Do you have a suggestion for using ssh from within c? Also thanks for the suggestion to spawn a shell; I don’t write in c much, so excuse my ignorance but why would I need to spawn a shell, and what’s your favorite method for spawning one?
Thanks again, JBG |
12-06-2021, 11:23 AM | #4 |
Member
Posts: 24
Karma: 10
Join Date: Jun 2021
Device: Kindle Touch K5
|
I'm at a loss here because I can't build kterm: I updated the kterm.c file with the following code: Code:
/* line 186, in between definitions for 'fontup' and 'fontdown' */ static void kindleberry(GtkWidget *widget, gpointer terminal) { UNUSED(widget); UNUSED(terminal); system("pi"); } /* line 406, immediately after GtkWidget *menu = gtk_menu_new(); */ GtkWidget *kindleberry_item = gtk_menu_item_new_with_label("Kindleberry"); /* a few lines later, on line 416, right after GtkWidget *quit_item = gtk_menu_item_new_with_label("Quit"); */ gtk_menu_shell_append(GTK_MENU_SHELL(menu), kindleberry_item); /* and finally, line 427, right after gtk_menu_shell_append(GTK_MENU_SHELL(menu), quit_item); */ g_signal_connect(G_OBJECT(kindleberry_item), "activate", G_CALLBACK(kindleberry), (gpointer) terminal); Code:
./configure Code:
No package 'vte' found Code:
meson _build Code:
meson.build:137: WARNING: Consider using the built-in option for language standard version instead of using "-std=gnu11". Compiler for C++ supports arguments -std=gnu++20: NO meson.build:144:0: ERROR: Assert failed: option -std=gnu++20 not supported by gcc Code:
$ cat /usr/bin/pi #!/bin/sh echo "baking up some kindleberry pi" eval $(ssh-agent -s) ssh-add /rsa/kindleberry ifconfig usb0 192.168.15.244 ssh pi@192.168.15.201 However, I cannot install vte, and therefore cannot build kterm myself. If a wizard were to build Code:
make dist-kindle |
12-06-2021, 01:18 PM | #5 |
rm -rf /
Posts: 219
Karma: 3333683
Join Date: Nov 2019
Location: United Kingdom
Device: K5, KT, KT2, KT3, KT4, KV, PW2, PW3, PW4, PW5
|
This sounds like an XY problem - if your goal is to autologin to the Pi, just pass your login script to kterm when it starts?
Try changing /mnt/us/extensions/kterm/bin/kterm.sh to something like this: Code:
#!/bin/sh EXTENSION=/mnt/us/extensions/kterm DPI=`cat /var/log/Xorg.0.log | grep DPI | sed -n 's/.*(\([0-9]\+\), [0-9]\+).*/\1/p'` #use different layouts for high resolution devices if [ ${DPI} -gt 290 ]; then PARAM="-l ${EXTENSION}/layouts/keyboard-300dpi.xml" elif [ ${DPI} -gt 200 ]; then PARAM="-l ${EXTENSION}/layouts/keyboard-200dpi.xml" fi export TERM=xterm TERMINFO=${EXTENSION}/vte/terminfo ${EXTENSION}/bin/kterm ${PARAM} -e "/usr/bin/pi" "$@" |
Advert | |
|
Tags |
kindle touch, kindleberry pi, kterm |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hide/remove some top menu options in Calibre. | vishwam | Calibre | 3 | 02-22-2019 10:14 PM |
How to access regular android menu options on stock rom? | Roseweave | Barnes & Noble NOOK | 1 | 12-26-2013 03:22 PM |
Items missing from the Reading Options menu | TheBFG | Amazon Kindle | 2 | 04-19-2013 07:33 AM |
PRS-900 Menu Options/Volume - Ghost in the Machine? | whalesong | Sony Reader | 1 | 02-19-2011 03:20 PM |
Firmware changed menu options? | Bob Russell | Sony Reader | 2 | 08-07-2007 11:09 PM |