01-02-2012, 01:56 PM | #1 |
♫
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? |
01-03-2012, 08:52 AM | #2 |
Member
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. |
Advert | |
|
01-04-2012, 02:33 AM | #3 |
♫
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. |
01-04-2012, 05:09 AM | #4 |
Member
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 Another possibility is to use OptWare and install everything you need, including mc (then the mcedit will be generated automatically ) |
01-04-2012, 05:45 AM | #5 | |
♫
Posts: 660
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
|
Quote:
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... |
|
Advert | |
|
01-04-2012, 06:58 AM | #6 |
Member
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 exchange the line Code:
./mc Code:
./mcedit $@ |
01-04-2012, 07:16 AM | #7 |
♫
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. |
08-28-2016, 01:45 PM | #8 |
Evangelist
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 Code:
export LD_LIBRARY_PATH=/mnt/us/local/lib /mnt/us/local/mc/bin/mc -e $@ Code:
export LD_LIBRARY_PATH=/mnt/us/local/lib /mnt/us/local/mc/bin/mc -v $@ 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. Last edited by nasser; 08-28-2016 at 01:48 PM. Reason: missed file upload |
08-29-2016, 09:09 AM | #9 |
Evangelist
Posts: 415
Karma: 750442
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
|
|
08-29-2016, 02:19 PM | #10 |
Evangelist
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
|
|
08-29-2016, 04:13 PM | #11 |
Guru
Posts: 608
Karma: 5007204
Join Date: Sep 2014
Location: Calif
Device: Fire hdx 8.9, Tab S2, Tab S5e, Aura ONE
|
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.... |
08-29-2016, 04:27 PM | #12 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
|
|
08-30-2016, 01:56 PM | #13 |
Evangelist
Posts: 415
Karma: 750442
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
|
Try to launch from kual this script (before check your paths!)
|
09-01-2016, 10:50 AM | #14 |
Evangelist
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
|
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 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> Code:
{ "items": [ {"name": "mc", "priority": 1, "action": "/mnt/us/extensions/mc/bin/mc.sh"} ] } Where am I going wrong? |
09-01-2016, 10:54 AM | #15 |
Going Viral
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. |
|
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 |