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 01-02-2012, 01:56 PM   #1
WS64
WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.
 
WS64's Avatar
 
Posts: 660
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
Midnight Commander: How to start mcedit from shell?

I have succesful installled Midnight Commander on my Kindle, and within mc I can edit files with its internal editor called mcedit.
But from the shell I cannot start mcedit.
Can someone point me in the right direction and can tell me what I have to do to start mcedit without starting mc first?
WS64 is offline   Reply With Quote
Old 01-03-2012, 08:52 AM   #2
danik
Member
danik began at the beginning.
 
Posts: 12
Karma: 14
Join Date: Sep 2011
Device: Kindle3 3G
you have to create a symbolic link to mc and call it mcedit:
ln -s <path-to-mc>/mc mcedit
Note that you can't create a link in /mnt/us, so you have to do it either in the root partition or in a ext3-image.
danik is offline   Reply With Quote
Advert
Old 01-04-2012, 02:33 AM   #3
WS64
WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.
 
WS64's Avatar
 
Posts: 660
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
Danik, thanks for your help.
But your reply will launch Midnight Commander itself (mc), not mcedit (the editor within Midnight Commander)
For mc itself I use the solution provided by inameiname, an alias:
alias mc='cd /mnt/us/local/terminal/ && ./mc && cd /mnt/us/'

I tried to modify this one for mcedit, e.g.
alias mcedit='cd /mnt/us/local/terminal/ && ./mcedit'
but I just get the error ms "Link:: not found"

Same for
alias mcedit='cd /mnt/us/local/mc/bin/ && ./mcedit'

Any ideas?

I also should be able to launch the editor with "mc -e". But this just starts Midnight Commander, not the editor...

Last edited by WS64; 01-04-2012 at 02:40 AM.
WS64 is offline   Reply With Quote
Old 01-04-2012, 05:09 AM   #4
danik
Member
danik began at the beginning.
 
Posts: 12
Karma: 14
Join Date: Sep 2011
Device: Kindle3 3G
mcedit is always just a link to mc. The decision, which part of mc to launch, is done according to the name of the program. So, if you don't like links , you can just copy mc-executable and call it mcedit:
Code:
cd  /mnt/us/local/terminal/
cp mc mcedit
and then you can use your alias to launch mcedit (but you won't be able to call it with a filename as a parameter (or you will have to provide the full path...))
Another possibility is to use OptWare and install everything you need, including mc (then the mcedit will be generated automatically )
danik is offline   Reply With Quote
Old 01-04-2012, 05:45 AM   #5
WS64
WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.
 
WS64's Avatar
 
Posts: 660
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
Quote:
Originally Posted by danik View Post
mcedit is always just a link to mc. The decision, which part of mc to launch, is done according to the name of the program. So, if you don't like links , you can just copy mc-executable and call it mcedit:
Code:
cd  /mnt/us/local/terminal/
cp mc mcedit
and then you can use your alias to launch mcedit (but you won't be able to call it with a filename as a parameter (or you will have to provide the full path...))
Sorry, still does not work...
I used the cd and cp command.
When I try from /mnt/us/local/terminal/ to start mcedit (./mcedit) again still mc starts, not mcedit...
WS64 is offline   Reply With Quote
Advert
Old 01-04-2012, 06:58 AM   #6
danik
Member
danik began at the beginning.
 
Posts: 12
Karma: 14
Join Date: Sep 2011
Device: Kindle3 3G
ok, I see. In the centaurian version of mc you have a script called mc, which runs mc. And now you have an alias mc, which runs a script mc, which runs mc...
Anyway, you can copy the mc script (as I said before):
Code:
cd  /mnt/us/local/terminal/
cp mc mcedit
and then open it in an editor and edit it:
exchange the line
Code:
./mc
with
Code:
./mcedit $@
danik is offline   Reply With Quote
Old 01-04-2012, 07:16 AM   #7
WS64
WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.
 
WS64's Avatar
 
Posts: 660
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
Danik, thanks again, but I found a solution before I saw your last message:

alias mcedit='/mnt/us/local/mc/bin/mc -e'

(before I always tried to do that in /mnt/us/local/terminal which did not work since this was not the executable)

mcedit will complain about missing libraries if you havn't started mc first, the missing lines to avoid these to be added to a start script are
export LD_LIBRARY_PATH=/mnt/us/local/lib
export HOME=/mnt/us/local/home
export LANGUAGE=cs

Last edited by WS64; 01-04-2012 at 07:29 AM.
WS64 is offline   Reply With Quote
Old 08-28-2016, 01:45 PM   #8
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
Resurrecting a quite old thread!
I installed midnight commander on my kt3 and was mucking around with it, when I came across this thread.
I can't remember the link in MR from where I downloaded the dump. It creates a folder 'local' in /mnt/us with 3 sub-folders: mc, terminal and lib. The total size is around 10 MB.
A KUAL button doesn't seem to be available. My attempts to create it failed. So I managed with a script in the /mnt/us/kterm folder: mc - which contains:

Code:
export LD_LIBRARY_PATH=/mnt/us/local/lib
/mnt/us/local/mc/bin/mc
The question asked here: how to create mcedit - remained incompletely answered. I created one more script: mcedit - containing:

Code:
export LD_LIBRARY_PATH=/mnt/us/local/lib
/mnt/us/local/mc/bin/mc -e $@
To round off things, I also created mcview with:

Code:
export LD_LIBRARY_PATH=/mnt/us/local/lib
/mnt/us/local/mc/bin/mc -v $@
The 3 flavours of mc can be started from kterm as: ./mc, ./mcedit and ./mcview

The KUAL button remains to be created - experts help needed!
Also, the /mnt/us/local folder seems to contain many unused files - need to identify and remove.

Quite nice to see the mc 2-pane view on the Kindle! See screenshot attached.
Attached Thumbnails
Click image for larger version

Name:	mc_screenshot.png
Views:	336
Size:	23.3 KB
ID:	151235  

Last edited by nasser; 08-28-2016 at 01:48 PM. Reason: missed file upload
nasser is offline   Reply With Quote
Old 08-29-2016, 09:09 AM   #9
encol
Evangelist
encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.
 
Posts: 415
Karma: 750442
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
Quote:
Originally Posted by nasser View Post
...
The KUAL button remains to be created - experts help needed!
...
mc is a terminal app, so if you launch it from kual you have to call it from inside kterm, something like this:

Code:
[PATH_TO]/kterm -e /mnt/us/local/mc/bin/mc
encol is offline   Reply With Quote
Old 08-29-2016, 02:19 PM   #10
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
Quote:
Originally Posted by encol View Post
mc is a terminal app, so if you launch it from kual you have to call it from inside kterm, something like this:

Code:
[PATH_TO]/kterm -e /mnt/us/local/mc/bin/mc
I already did that. But mc didn't load.
nasser is offline   Reply With Quote
Old 08-29-2016, 04:13 PM   #11
crane3
Guru
crane3 ought to be getting tired of karma fortunes by now.crane3 ought to be getting tired of karma fortunes by now.crane3 ought to be getting tired of karma fortunes by now.crane3 ought to be getting tired of karma fortunes by now.crane3 ought to be getting tired of karma fortunes by now.crane3 ought to be getting tired of karma fortunes by now.crane3 ought to be getting tired of karma fortunes by now.crane3 ought to be getting tired of karma fortunes by now.crane3 ought to be getting tired of karma fortunes by now.crane3 ought to be getting tired of karma fortunes by now.crane3 ought to be getting tired of karma fortunes by now.
 
Posts: 608
Karma: 5007204
Join Date: Sep 2014
Location: Calif
Device: Fire hdx 8.9, Tab S2, Tab S5e, Aura ONE
Quote:
Originally Posted by nasser View Post
I already did that. But mc didn't load.
You might try "total commander" which allows dual panes; I've got tc in single for portrait & dual in landscape. It's free & have it installed on the Fire HDX via Google Play store.

An apk may be available at the "usual" places for side-loading on the kt3 if possible. Some plugins are also available like for lan mode & another for ftp.

Dual pane does come in very handy....
crane3 is offline   Reply With Quote
Old 08-29-2016, 04:27 PM   #12
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 crane3 View Post
You might try "total commander" which allows dual panes; I've got tc in single for portrait & dual in landscape. It's free & have it installed on the Fire HDX via Google Play store.

An apk may be available at the "usual" places for side-loading on the kt3 if possible. Some plugins are also available like for lan mode & another for ftp.

Dual pane does come in very handy....
Except that a KT3 (nor any other grayscale Kindle) does not run Android.
knc1 is offline   Reply With Quote
Old 08-30-2016, 01:56 PM   #13
encol
Evangelist
encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.
 
Posts: 415
Karma: 750442
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
Quote:
Originally Posted by nasser View Post
I already did that. But mc didn't load.
Try to launch from kual this script (before check your paths!)
Attached Files
File Type: zip mc.sh.zip (445 Bytes, 111 views)
encol is offline   Reply With Quote
Old 09-01-2016, 10:50 AM   #14
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
Quote:
Originally Posted by encol View Post
Try to launch from kual this script (before check your paths!)
Added LD_LIBRARY_PATH=/mnt/us/local/lib to the top of the .sh file.. but still doesn't work. Kterm loads, but not mc..

Here are the files I used and their contents:
/mnt/us/extensions/mc/bin/mc.sh
Code:
#!/bin/sh

EXPORT LD_LIBRARY_PATH=/mnt/us/local/lib

EXTENSION=/mnt/us/extensions/kterm

PARAM=""

WIDTH=`xwininfo -root|grep Width|cut -d ':' -f 2`
# use wider keyboard layout for screen width greater than 600 px
if [ ${WIDTH} -gt 600 ]; then
  PARAM="-l ${EXTENSION}/layouts/keyboard-wide.xml -e /mnt/us/local/mc/bin/mc"
fi

${EXTENSION}/bin/kterm ${PARAM}

# when started from launcher kterm doesn't kill keyboard (why?) so:
killall matchbox-keyboard
/mnt/us/extensions/mc/config.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<extension>
	<information>
		<name>mc</name>
		<version>4.7.0.10</version>
		<author>various</author>
		<id>mc</id>
	</information>
	<menus>
		<menu type="json" dynamic="true">menu.json</menu>
	</menus>
</extension>
/mnt/us/extensions/mc/menu.json:
Code:
{
	"items": [
		{"name": "mc", "priority": 1, "action": "/mnt/us/extensions/mc/bin/mc.sh"}
	]
}
In addition to these, of course, is the mc package in /mnt/us/local
Where am I going wrong?
nasser is offline   Reply With Quote
Old 09-01-2016, 10:54 AM   #15
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
Re-read your script.
What is it suppose to do if the screen is NOT gt 600 pixels?

Hint: Right now, it is doing just what you told it to do if the test fails.
knc1 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Issues with Android Commander and 2.5.1 Softroot. chas0039 Nook Developer's Corner 10 12-07-2010 08:58 PM
DR800 Midnight Commander dima_tr iRex 8 10-22-2010 11:48 AM
Ghost Commander 1.18 leo315 enTourage eDGe 0 08-28-2010 03:04 AM
Android Ghost Commander 1.18 leo315 enTourage Archive 0 08-28-2010 03:02 AM
Midnight Commander yokos iRex 9 08-10-2008 07:12 AM


All times are GMT -4. The time now is 07:11 AM.


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