Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: manit123 on March 22, 2013, 09:20:53 AM

Title: [SOLVED]how to create right click menu entry
Post by: manit123 on March 22, 2013, 09:20:53 AM
i am using tiny core 4.7.3
say , when I install pcmanfm I get file manager entry in application submenu.
How can i create an entry named 'kundli' in that application submenu which when clicked will run a script kept in /home/tc .

Please suggest ?


Title: Re: how to create right click menu entry
Post by: bmarkus on March 22, 2013, 09:23:24 AM
Create a freedestop menu item
Title: Re: how to create right click menu entry
Post by: Rich on March 22, 2013, 12:00:03 PM
Hi manit123
Here is a quick example, create the following two files:
sysinfo.desktop
Code: [Select]
[Desktop Entry]
Name=CPU
Exec=aterm -e less /proc/cpuinfo
Terminal=false
Type=Application
Categories=Utility;
sysinfo~1.desktop    (That's a  tilde  left of the one, not a dash)
Code: [Select]
[Desktop Entry]
Name=Modules
Exec=aterm -e less /proc/modules
Terminal=false
Type=Application
Categories=Utility;
Copy them to:
Code: [Select]
/usr/local/share/applications/Then execute:
Code: [Select]
desktop.sh sysinfoThis will create a sub menu under  Applications  called  sysinfo. The sub menu will have two entries, CPU  and  Modules.
Name=  is what will appear in the menu. Exec=  is the command you wish to execute. I omitted icons in this example.
Take a look at some of the .desktop files in  /usr/local/share/applications/  to see how that's done. The Wiki may also help:
http://wiki.tinycorelinux.net/wiki:creating_personal_icons?
Title: Re: how to create right click menu entry
Post by: manit123 on March 24, 2013, 10:52:14 PM
i will try this & report outcome . Thank you.
Title: Re: how to create right click menu entry
Post by: manit123 on March 25, 2013, 06:04:19 AM
that went well .
I guess I can add more submenus by creating sysinfo~2.desktop .
Now how to remove mistakenly created desktop files ?

Title: Re: how to create right click menu entry
Post by: Rich on March 25, 2013, 07:47:50 AM
Hi manit123
If you create  apples.desktop  the contents of the  Name=  field will be listed under  Applications

If you create  oranges.desktop  oranges~1.desktop  oranges~2.desktop  oranges~3.desktop  the contents of their
 Name=  fields will be listed under  Applications->oranges

To remove the  oranges~2.desktop  entry, delete the  /usr/local/share/applications/oranges~2.desktop  file, delete
the   Name=  value it created in  /home/tc/.wmx/Applications/oranges, and run  desktop.sh oranges
Title: Re: how to create right click menu entry
Post by: manit123 on March 28, 2013, 07:54:16 AM
Thanks Rich .
It worked .
Now i have my menuitems which load an application on being clicked NOT on startup.

Unmounting a tcz is difficult . I think . What do you say ?
Title: Re: how to create right click menu entry
Post by: gerald_clark on March 28, 2013, 08:03:11 AM
Unmounting a tcz is difficult . I think . What do you say ?

Correct.  That is why we have .scm.
Title: Re: how to create right click menu entry
Post by: Rich on March 28, 2013, 08:34:43 AM
Hi manit123
Quote
Unmounting a tcz is difficult . I think . What do you say ?
Yes it is. Why are you asking?
Title: Re: how to create right click menu entry
Post by: manit123 on March 30, 2013, 07:12:41 AM
I needed wine for my windows xp program .
I have noticed that 'scm-load wine.scm' command did not work . No success or error reported.
Though using mouse clicks I am able to load it .
So currently I am using wine.tcz which works equally good.
But I do not know a way to unmount wine.tcz once the purpose of running windows XP program in current session is served.
Title: Re: how to create right click menu entry
Post by: Rich on March 30, 2013, 07:38:41 AM
Hi manit123
Quote
But I do not know a way to unmount wine.tcz once the purpose of running windows XP program in current session is served.
Still not sure why you feel you need to unmount it, just exit wine when you are done with it.
Title: Re: how to create right click menu entry
Post by: manit123 on April 01, 2013, 07:42:12 AM
I wanted to unload tcz to save space in RAM .
Can you tell me way to load & unload scm's using command
Title: Re: how to create right click menu entry
Post by: Rich on April 01, 2013, 07:55:33 AM
Hi manit123
Unless you are using the  copy2fs  mode, you won't really be saving any RAM since the extensions are loop mounted
and not copied to RAM. Sorry, I don't use SCMs, but I'm pretty sure it's been answered in the forum before.
Title: Re: how to create right click menu entry
Post by: manit123 on April 01, 2013, 11:43:48 PM
so far I have not used copy2fs since I thought extensions were  loaded into RAM.
Do you think it would help if I load application into RAM as I am booting  from USB stick whose frequent access will wear it . Would not it  be nice that all contents from USB drive are read at startup & then USB stick never accessed again in current session. That would help in life of USb stick.
Title: Re: how to create right click menu entry
Post by: Rich on April 02, 2013, 12:10:09 AM
Hi manit123
Reading does not wear out a USB stick, only writing does.
Title: Re: how to create right click menu entry
Post by: manit123 on April 03, 2013, 06:45:53 AM
you mean that loop mounts are read only so usb stick would not deteriorate . Also access to RAM is fast , my computer has 4GB of it . So copy2fs will help me in faster access ?
Title: Re: how to create right click menu entry
Post by: Rich on April 03, 2013, 06:55:55 AM
Hi manit123
Actually, the extensions are packaged in a read only file system so they can't be messed up. If you use copy2js, your
boot time will take longer, but applications will start faster.
Title: Re: how to create right click menu entry
Post by: manit123 on April 05, 2013, 09:19:01 AM
Won't they run fast too considering that they are loaded into RAM whose access time is much faster than USB ?
Also , can you tell me way to have copy2fs flag in boot (I have grub 0.97 ) ?
Title: Re: how to create right click menu entry
Post by: gerald_clark on April 05, 2013, 09:28:17 AM
All programs run from RAM.  The copy2fs.flg is a file in your tce directory
Title: Re: how to create right click menu entry
Post by: manit123 on April 06, 2013, 07:07:43 AM
i do not want to pester you .
Can you point me to link explaining copy2fs mode ?
Title: Re: how to create right click menu entry
Post by: Juanito on April 06, 2013, 07:19:09 AM
you can use the apps gui to set the copy2fs flag:

installation options -> toggle default install to file system flag

This will put a file named copy2fs.flg in your /tce folder and extensions will then be copied to ram
Title: Re: how to create right click menu entry
Post by: Rich on April 06, 2013, 07:45:45 AM
Hi manit123
Quote
Can you point me to link explaining copy2fs mode ?
Check out the diagrams for mount mode and copy mode found here:
http://wiki.tinycorelinux.net/wiki:tiny_core_file_architecture_diagrams
Title: Re: how to create right click menu entry
Post by: manit123 on April 06, 2013, 09:02:18 AM
That was wonderful .
As i thought - copy2fs will help my applications like dictionary , word-letter-combination-search-software-for-scrabble to run faster at the expense of longer startup time .
I think if I create an empty copy2fs.flg file in tce folder my usb stick  . I will get copy2fs mode . Is that right (why should I bother systemtool>apps for that) ?

The difference I think among the tcz & copy2fs is that - in tcz mode one can see  what has been loaded as there will be many loop mounts . In copy2fs mode I won't get so many mountpoints . Isn't it ?
Title: Re: how to create right click menu entry
Post by: Rich on April 06, 2013, 09:24:47 AM
Hi manit123
Quote
I think if I create an empty copy2fs.flg file in tce folder my usb stick  . I will get copy2fs mode . Is that right (why should I bother systemtool>apps for that) ?
Yes, that will work. The tool is suggested because that is one of the functions it provides.
The applications will run just as fast as mount mode. The time from when you start the application until you see
results on the screen will be a lot less (startup time).
Title: Re: how to create right click menu entry
Post by: tinypoodle on April 06, 2013, 09:33:35 AM
The applications will run just as fast as mount mode.

Hmm, isn't there a possibility where a mounted app would access squashfs while running (and therefore might be a bit slower, depending on storage medium throughput)?
Title: Re: how to create right click menu entry
Post by: Rich on April 06, 2013, 09:44:38 AM
Hi tinypoodle
The executables and libraries will be loaded into and running from RAM. If the application includes a data file in the
squashfs that it routinely opens and reads, that could slow things down a bit, though caching would probably serve
to reduce that.
Title: Re: how to create right click menu entry
Post by: tinypoodle on April 06, 2013, 12:10:01 PM
The executables and libraries will be loaded into and running from RAM. If the application includes a data file in the
squashfs that it routinely opens and reads, that could slow things down a bit

Request for clarification please:
1. Is statement referring to squashfs in particular or generally applicable (incl. e.g. uncompressed scatter files)?
2. Is statement referring to compiled code exclusively or generally applicable (incl. e.g. interpreted code)?

Quote
though caching would probably serve
to reduce that.

True, but OTOH even in copy2fs mode swapping to disk could lead to decrease speed.
Title: Re: how to create right click menu entry
Post by: Rich on April 06, 2013, 02:05:42 PM
Hi tinypoodle
1. The program will be loaded into RAM regardless of how/where it is stored.
2. Compiled code. I don't know how for example ash or a basic interpreter would handle it.
Quote
True, but OTOH even in copy2fs mode swapping to disk could lead to decrease speed.
I was referring to if the program routinely read from a data file, those reads would wind up being cached in RAM. If
the program went to read from that file again, it may already have been cached since reads are done in blocks of
4K in think.