Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-27-2013, 04:44 PM   #16
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
It's an open source project, and the conversion from ISO-8859-1 to utf-8 is trivial.

The first 7-bits of code points are identical
For high bit set, clear that bit and precede that byte with a 0x01 byte
If memory serves - that is all it takes.
knc1 is offline   Reply With Quote
Old 05-28-2013, 01:19 PM   #17
atordo
Connoisseur
atordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to behold
 
Posts: 89
Karma: 19669
Join Date: Apr 2012
Device: Kindle Touch
In fact it's so trivial I can do it by eye . No kidding, charset conversion errors are so frequent that you get used to interpret that numerical codes inside a square (or gibberish characters in the opposite direction).

So maybe I'll learn how to cross-compile, dig into the sources and try to fix it. Or maybe I'll just resort to the eye method. I don't have so much time for IRC these days, let alone IRC on a Kindle.

Anyway, I thought these matters were handled by locale now. 'locale -a' only shows utf locales on my KT and there's is not locale-gen, but I wonder if generating the proper locale and setting the corresponding LANG environment variable would suffice.

(this is now the topic of the thread )
atordo is offline   Reply With Quote
Advert
Old 05-30-2013, 03:43 PM   #18
NullNix
Guru
NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.
 
Posts: 916
Karma: 13928438
Join Date: Jan 2013
Location: Ely, Cambridgeshire, UK
Device: Kindle Oasis 3, Kindle Oasis 1
Quote:
Originally Posted by atordo View Post
Anyway, I thought these matters were handled by locale now. 'locale -a' only shows utf locales on my KT and there's is not locale-gen, but I wonder if generating the proper locale and setting the corresponding LANG environment variable would suffice.
localegen is a distro addition, anyway. The upstream glibc way is to say, e.g.

localedef -i en_GB -f ISO-8859-1 en_GB.ISO-8859-1
NullNix is offline   Reply With Quote
Old 05-30-2013, 05:19 PM   #19
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by NullNix View Post
localegen is a distro addition, anyway. The upstream glibc way is to say, e.g.

localedef -i en_GB -f ISO-8859-1 en_GB.ISO-8859-1
And if you put those generated files in the right place on the Kindle, it should "just work".

The "right place" will take a bit of research - - but there is a standard file tree for that information under glibc.
knc1 is offline   Reply With Quote
Old 06-02-2013, 01:47 PM   #20
atordo
Connoisseur
atordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to behold
 
Posts: 89
Karma: 19669
Join Date: Apr 2012
Device: Kindle Touch
Thanks both for the hints. I managed to copy some source files from my Linux desktop to /usr/share/i18n but localedef can't write to its destination:
cannot open locale archive "/usr/lib/locale/locale-archive": Read-only file system

The tricky part is that /usr/lib/locale is mounted:
Code:
/dev/loop/6 on /usr/lib/locale type cramfs (ro,noatime,nodiratime)
With cramfs, which according to Wikipedia is a read-only fs. I'm not confident enough with Kindle internals, so I'd rather leave the mount points as they are.
atordo is offline   Reply With Quote
Advert
Old 06-02-2013, 03:03 PM   #21
neutrak
Junior Member
neutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud of
 
Posts: 9
Karma: 27860
Join Date: May 2013
Device: kindle keyboard 3g
version 0.3 beta snapshot

Hey guys, hate to be relevant to the topic since you're all having such fun, but here is a build snapshot that includes some requested features (such as /alias and /time_format). New binary attached, new man page embedded.

This is not a final release; it should be considered a "beta"; after some additional testing/tweaking I'll release a stable version later this year.

One last note: whatever build chain twobob used didn't require libtinfo, but the version of ncurses I linked against here does. Also, I only tested this on my kindle (keyboard 3g); your mileage may vary.

MAN:
Spoiler:

ACCIRC
Section: User Commands (1)
Updated: 02 Jun 2013
Index
NAME
accirc - The accidental ncurses irc client
SYNOPSIS
accirc [ --help | --version ]
DESCRIPTION
accirc starts ncurses; functionality is available from there; config is read from ~/.config/accirc/config.rc ; logs are stored in ~/.local/share/accirc/logs/
Options

--help
tells you to read this man page
--version
outputs the version of this software, in the form <major int>.<minor int>; major counts redesigns, minor counts updates; for both, even numbers are stable, odd numbers are unstable/testing


Commands

\
escapes the first character of the input string (in case you want a literal : or /)
:
sends raw data to the current server (if there is one)
/connect host port
connects to an irc server at <host> on port <port>
/exit [ message ]
sends a QUIT to every irc server you're connected to
/cli_escape new
changes the client command escape character to <new>, if possible
/ser_escape new
changes the server raw data escape character to <new>, if possible
/alias trigger substitution
registers an alias; when the client escape is used with the trigger the trigger will be substituted for whatever substitution is specified; for example "/alias part :part" would allow you to use /part in place of :part, note this is a direct text substitution and does no additional handling
/time_format new_format
sets the time format for viewing (the clock and timestamps on messages in ncurses); note that logs always use unix timestamps, and ignore this formatting
/reconnect
reconnect to the currently selected server if connection is lost for any reason
/no_reconnect
don't reconnect to the currently selected server
/log
keep logs for the currently selected server (this is the default)
/no_log
don't keep logs for the currently selected server
/sl
sets active server one left of current server
/sr
sets active server one right of current server
/cl
sets active channel one left of current channel
/cr
sets active channel one right of current channel
/me
sends CTCP ACTION message
/r
replies (by privmsg) to the last user we recieved a PM from on the currently selected server; if we have never gotten a PM, the default nick to reply to is the null string ""; parsing in some server implementations may treat this strangely, but it's out of my hands, the client will act as intended and send a "privmsg nick :msg" to the server
/sleep seconds
sleeps a given number of seconds
/usleep microseconds
sleeps a given number of microseconds
/comment
ignore this line, a comment (for an rc file)
/autojoin channel
join this channel on the current server as soon as we can (for an rc file)
/autoident password
auth for this nick on the current server as soon as we can (for an rc file)
/fallback_nick nick
set this as the backup nick if the nick specified is taken; if this nick is also taken _ is appended until one is unclaimed or we run out of characters allowed in the nick (for an rc file)
/rejoin_on_kick
for channels on current server, rejoin when kicked
/no_rejoin_on_kick
for channels on current server, don't rejoin when kicked


Key Bindings

f1 or alt+left
channel left (see /cl)
f2 or alt+right
channel right (see /cr)
f3 or alt+up
server left (see /sl)
f4 or alt+down
server right (see /sr)
f5 or alt+tab
literal tab character (f5 left for backwards compatibility, alt+tab is recommended)
f6
0x01 character, since screen intercepts literal ^A (for manually sending CTCP messages other than ACTION); displays as a bold \ in input area
f7
0x03 character for sending MIRC colors (MIRC color support is still experimental, and requires compilation with -D MIRC_COLOR); displays as a bold in input area
<tab>
complete a nickname based on nicks in current channel
PgUp
scroll up one line in the channel scrollback, if possible
PgDn
scroll down one line in the channel scrollback, if possible
Up
scroll up one line in the input history, if possible
Down
scroll down one line in the input history, if possible


FILES

~/.config/accirc/config.rc
The startup file to run
~/.local/share/accirc/logs/
The location of all logs from all servers
~/.local/share/accirc/error_log.txt
A log of any errors that couldn't be output through ncurses


EXAMPLE RC FILE

~/.config/accirc/config.rc
/comment set aliases and time for common preference, then connect to a server and join a channel

/alias quit /exit

/time_format %Y-%m-%d %R:%S

/connect daemonic.foonetic.net 6667

:nick accirc_user

:user 1 2 3 4

/autojoin #faid3.0

/comment some error handling just in case the desired nick is unavailable or connection gets lost, etc.

/fallback_nick accirc_user

/reconnect

/rejoin_on_kick


SEE ALSO
ncurses(3) strftime(3)
BUGS
MIRC colors don't work under screen; auto-reconnecting on drop is unreliable; flicker occurs frequently, since the clock updates every second (this is less noticable in screen or tmux for some reason)
WWW
http://somegenericsite.dyndns.org/index.php?p=code
Attached Files
File Type: zip accidental_irc-0.3_2013_06_02-kindle-binary.zip (34.4 KB, 280 views)
neutrak is offline   Reply With Quote
Old 06-07-2013, 07:11 AM   #22
atordo
Connoisseur
atordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to behold
 
Posts: 89
Karma: 19669
Join Date: Apr 2012
Device: Kindle Touch
Thanks neutrak, that was fast. Unfortunately on the Touch there are some unresolved dependencies:
Code:
./accirc-0.3: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
Perhaps you could build a version statically linked?
atordo is offline   Reply With Quote
Old 06-07-2013, 06:47 PM   #23
neutrak
Junior Member
neutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud of
 
Posts: 9
Karma: 27860
Join Date: May 2013
Device: kindle keyboard 3g
I attempted to build it statically-linked initially but was unsuccessful. I'll ask twobob what he did to compile it, since he did the initial kindle build (he hasn't been on IRC for like two weeks according to whowas). In the mean time, the libtinfo I used to link can be found in the ncurses package here https://www.mobileread.com/forums/att...7&d=1312879802

I've also attached the source code and the script I used to compile to this forum post. If anyone else wants to try compiling it or telling me some options to statically link post it here.
Attached Files
File Type: gz accidental_irc-0.3_2013_06_02-kindle.tar.gz (72.9 KB, 233 views)
neutrak is offline   Reply With Quote
Old 06-08-2013, 09:10 AM   #24
Cykotitan
Enthusiast
Cykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animals
 
Posts: 44
Karma: 6550
Join Date: May 2013
Location: Bosnia & Herzegovina
Device: Kindle Paperwhite 1 WiFi
Another thing I would find useful personally are clickable http(s) links. One could open them in a browser such as skipstone, for instance, which overlays accirc/kterm just fine.
Cykotitan is offline   Reply With Quote
Old 06-08-2013, 08:50 PM   #25
neutrak
Junior Member
neutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud of
 
Posts: 9
Karma: 27860
Join Date: May 2013
Device: kindle keyboard 3g
Unfornately to my knowledge ncurses has no concept of "links"; that is up to your terminal (in this case kterm). It is impossible to make links "clickable" from within ncurses; ncurses is made on the assumption you're not using a mouse. I know that gnome-terminal does have this ability on desktop computers, so I'm sure it could be added to kterm, but I don't develop that so I'm not sure how easy it would be.

accirc could be given a concept of links, but it could not under any circumstances make them clickable; they'd have to be opened via a command (which is not planned at the moment).
neutrak is offline   Reply With Quote
Old 06-10-2013, 11:13 AM   #26
atordo
Connoisseur
atordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to behold
 
Posts: 89
Karma: 19669
Join Date: Apr 2012
Device: Kindle Touch
Quote:
Originally Posted by neutrak View Post
I attempted to build it statically-linked initially but was unsuccessful. I'll ask twobob what he did to compile it, since he did the initial kindle build (he hasn't been on IRC for like two weeks according to whowas). In the mean time, the libtinfo I used to link can be found in the ncurses package here https://www.mobileread.com/forums/att...7&d=1312879802.
Nice, I copied just the required library in the same directory as accirc, then exported LD_LIBRARY_PATH and it works! So no need to install the full ncurses package in the root filesystem

The alias command makes it much more usable for me, you know, it's difficult to change some inveterate customs.
atordo is offline   Reply With Quote
Old 06-10-2013, 03:38 PM   #27
Cykotitan
Enthusiast
Cykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animals
 
Posts: 44
Karma: 6550
Join Date: May 2013
Location: Bosnia & Herzegovina
Device: Kindle Paperwhite 1 WiFi
I was wondering how does the nano editor implement mouse support. I didnt run nano inside kterm though, but on a remote Linux server that I SSH'd into.
Cykotitan is offline   Reply With Quote
Old 06-10-2013, 04:26 PM   #28
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by Cykotitan View Post
I was wondering how does the nano editor implement mouse support. I didnt run nano inside kterm though, but on a remote Linux server that I SSH'd into.
http://en.wikipedia.org/wiki/GPM_%28software%29
knc1 is offline   Reply With Quote
Old 09-21-2013, 08:56 PM   #29
neutrak
Junior Member
neutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud ofneutrak has much to be proud of
 
Posts: 9
Karma: 27860
Join Date: May 2013
Device: kindle keyboard 3g
accirc v0.4

version 0.4, everyone

Notable changes since 0.2
alias command
time_format command
hi and bye commands for PMs in a faux channel context
ssl support via the sconnect command
stability improvments / internal cleanup that you probably won't notice
some other things I'm probably forgetting

binaries are attached (thanks to NiLuJe for that).

For some reason the forums won't let me upload a man page or html-converted man page, so that can be found in the tarball here: http://neutrak.kaycare.co.uk/code/ac...irc-0.4.tar.gz
Attached Files
File Type: gz accirc-all.tar.gz (440.9 KB, 229 views)
File Type: gz accirc-k3.tar.gz (24.5 KB, 221 views)
File Type: gz accirc-k5.tar.gz (526.0 KB, 231 views)
neutrak is offline   Reply With Quote
Old 09-21-2013, 09:05 PM   #30
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
To clarify the three sets of binaries:

-k3: Targets the CPU used by the K2/DX/3, will work on FW 2.x/3.x. (+ 4.x, although I'd recommend the -k5 one for a K4).
-k5: Targets the CPU used by the K4/K5/PW, will work on FW 4.x/5.x

Those are built the exact same way I build my usual stuff.

The -all is a compromise built with my K3 toolchain, it targets the 'older' family of CPU (armv6), but with OpenSSL linked statically (since there's a switch from 0.9.8 to 1.0.0 somewhere in FW 5.0.x) in an attempt to make it run on everything we care about (FW 2.x/3.x/4.x/5.x) .

Last edited by NiLuJe; 09-21-2013 at 09:48 PM.
NiLuJe is offline   Reply With Quote
Reply

Tags
irc, native

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
#kindle-dev THE IRC channel for Kindle development. JOIN US. (IRC ≈ CHAT CLIENT) twobob Kindle Developer's Corner 56 01-17-2022 05:11 PM
IRC chat on irc.freenode.net Jaapjan Lounge 1 02-09-2018 02:05 PM
IRC broke? knc1 Kindle Developer's Corner 8 02-01-2013 05:11 PM
IRC from the kindle qlob Kindle Developer's Corner 17 12-24-2012 09:55 PM


All times are GMT -4. The time now is 03:57 AM.


MobileRead.com is a privately owned, operated and funded community.