WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Question: how to create a new wbar icon for "Midnight Commander"  (Read 4877 times)

Offline floppy

  • Hero Member
  • *****
  • Posts: 577
hello,
I use midnight commander as text editor, ftp..
I have to go into a terminal: "mc -x" or "sudo mc -x" (if I have to edit the "menu.lst". Is there a description here how to create a "MC user" or "MC root" as icon in the wbar?
Thanks.
AMD K6-IIIATZ 550MHz MB DFI K6xv3/+66
P4 HP DC7100 3GB 3GHz
Samsung NC10 boot from SD card port (via USB reader)
.. all TinyCore proofed

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: Question: how to create a new wbar icon for "Midnight Commander"
« Reply #1 on: January 30, 2011, 12:40:31 AM »
Try this.

Edit /usr/local/tce.icons as follows:

Find the trio of lines beginning with  i:   t: and  c: where the t:  and c:  lines refer to aterm and make an additional copy of them (in the same file).

On the new copy of the t: line, change "Aterm" to "MC user".
On the new copy of the c: line, change "exec aterm" to "exec aterm -e mc -x"

Save the file.
Right-click on your wbar to have it re-read the tce.icons file.

You should now see an additional icon that looks just like the Aterm icon but when you mouse-over the new one, the label will be  MC user and it will run  mc -x  when you click it.  You can find or create a more suitable icon and plug its path/filename into the  i:  line if you want.

32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: Question: how to create a new wbar icon for "Midnight Commander"
« Reply #2 on: January 30, 2011, 01:04:54 AM »
better for the community to add it in the tcz
dCore user

Offline Guy

  • Hero Member
  • *****
  • Posts: 1089
Re: Question: how to create a new wbar icon for "Midnight Commander"
« Reply #3 on: January 30, 2011, 01:31:11 AM »
I have not done this. I also don't use midnight commander.

I suspect Lee's method will not survive across reboots.

You could get a suitable picture file for the icon and put it in /usr/local/share/pixmaps/ in the midnight commander extension.

Do you know how to add files to an extension, and make a new extension with the added files?

Can midnight commander be started from the menu? I don't use it.

If not, you probably also need to add a menu entry for it.

The basic idea is to see how it is done in other extensions, and do it the same way. Do you understand enough to see how it is done in other extensions, and copy the idea?

I have not done it myself. This is just ideas for starting.
Many people see what is. Some people see what can be, and make a difference.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: Question: how to create a new wbar icon for "Midnight Commander"
« Reply #4 on: January 30, 2011, 02:54:21 AM »
Midnight commander is a pretty fast and light file manager that runs in a terminal.
It has a file viewer, editor, ftp, and a bunch of other stuff built in. It can be configured
as single pane, dual pane with files in each pane, or dual pane with files on one side
and statistics on the other.

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: Question: how to create a new wbar icon for "Midnight Commander"
« Reply #5 on: January 30, 2011, 10:20:28 AM »
I have to watch myself so I don't get too verbose, as I hate when my listeners fall asleep while I'm going on and on.  :)  I had to consciously suppress the urge to start about persistence and menus.  I didn't have so work too hard to avoid the bit about adding files to the extension - that's just way out of scope (Hmmm... I wish I could effectively use that phrase at work).

Big thanks to floppy for bringing this up and to Rich for describing mc.  I hadn't tried it out before and now I'm wondering why not.  What a useful little tool.  Does anyone remember Michael Mefford's "dirmagic" utility from the MS-DOS days?  If mc is half that good (and I suspect it is twice that good), it will stay in my toolbox!

And yeah, an icon and menu item in the extension would be great, especially now that those who don't want the icon can exclude it at will.  Other extensions could have icons, too (sgmixer...).
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: Question: how to create a new wbar icon for "Midnight Commander"
« Reply #6 on: January 30, 2011, 11:22:12 AM »
I don't recall ever using dirmagic. I used to use one called ffm, it was similar to mc. The
only problem was it was not maintained, so when drives finally exceeded 528Mb it
would choke. After that I found a better one called list. It could switch how it displayed
files from 1 through 5 columns wide by hitting one of the number keys. Fewer columns,
more info, and it was fast as hell.

Offline Guy

  • Hero Member
  • *****
  • Posts: 1089
Re: Question: how to create a new wbar icon for "Midnight Commander"
« Reply #7 on: January 30, 2011, 10:46:05 PM »
1. What is the general consensus? Do others think that mc, in the official repository, should have an icon?

If not, it is still possible for some users to add an icon.

2. If anyone can make or find a suitable image for the icon, share it.

3. I can explain how to add an icon to the extension, and make a new extension with the icon. However, there is more to it than that. There are other things needed to make it start from the icon. I don't fully understand. There are others who do.

4. Why do you start it with mc -x and not just mc?

5. Does anyone feel that any other apps, which don't have an icon, should have an icon?

6. If anyone can make or find suitable images for the icons, share them.
Many people see what is. Some people see what can be, and make a difference.

Offline Guy

  • Hero Member
  • *****
  • Posts: 1089
Re: Question: how to create a new wbar icon for "Midnight Commander"
« Reply #8 on: January 30, 2011, 10:54:48 PM »
If anyone can explain what other additions or modifications need to be made in the extension, it would be nice if you could explain it.

The command to start mc when not in the terminal is:

exec aterm -e mc -x

or

exec aterm -e mc

I am not thinking just about this situation. There may be others who want to add icons to other apps. This information may be useful them.
« Last Edit: January 30, 2011, 10:58:24 PM by Guy »
Many people see what is. Some people see what can be, and make a difference.

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: Question: how to create a new wbar icon for "Midnight Commander"
« Reply #9 on: January 30, 2011, 11:23:28 PM »
in the extension there should be a .desktop and of course the icon
dCore user

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: Question: how to create a new wbar icon for "Midnight Commander"
« Reply #10 on: January 31, 2011, 12:16:37 AM »
I'm thinking the icon for "mc" would just -have- to infringe the golden arches trademark.  That's just too good to pass up.   ;)
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Question: how to create a new wbar icon for "Midnight Commander"
« Reply #11 on: January 31, 2011, 04:14:29 AM »
You do not have to create an icon for mc, it has already its own. Why dont you visit the upstream vendors WEB site first?

I added icon to the extension, see how it looks like:



In general it is not a good idea to add icon for console applications, mc is one of the exceptions.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Guy

  • Hero Member
  • *****
  • Posts: 1089
Re: Question: how to create a new wbar icon for "Midnight Commander"
« Reply #12 on: January 31, 2011, 04:22:08 AM »
bmarkus

Is this available in the repository? Or will it be available in the repository in the future?
Many people see what is. Some people see what can be, and make a difference.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Question: how to create a new wbar icon for "Midnight Commander"
« Reply #13 on: January 31, 2011, 04:41:58 AM »
Is this available in the repository? Or will it be available in the repository in the future?

Repository was updated last time on January 10 due to Ibiblio issues, see

http://forum.tinycorelinux.net/index.php?topic=8497.0

I will submit the updated but don't know when it will appear. As a temporary solution I can email to those who need.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline floppy

  • Hero Member
  • *****
  • Posts: 577
Re: Question: how to create a new wbar icon for "Midnight Commander"
« Reply #14 on: February 01, 2011, 08:46:49 AM »
You do not have to create an icon for mc, it has already its own. Why dont you visit the upstream vendors WEB site first?

I added icon to the extension, see how it looks like:



In general it is not a good idea to add icon for console applications, mc is one of the exceptions.
MC with the blue icon in the WBAR would be great.
And additionally to this, the same Icon design with a red background for a sudo command "exec aterm -e sudo mc -x"?
AMD K6-IIIATZ 550MHz MB DFI K6xv3/+66
P4 HP DC7100 3GB 3GHz
Samsung NC10 boot from SD card port (via USB reader)
.. all TinyCore proofed