Page 2 of 3

Posted: Mon 25 Apr 2011, 00:39
by big_bass
Could you add a file search function to step 4 like you have in step 3?
the reason here of not having a drop down box for the run command is many possible executables or scripts could be used the which
command is your friend for finding where the executable is located


*here is a simplified code base
It isnt better just simpler if you wish to hack at it a bit

Joe

Posted: Mon 25 Apr 2011, 08:31
by tasmod
Great for a menu entry.

However what I would like to see is a Category maker and menu entry maker to populate it. :lol: :lol:

Posted: Mon 25 Apr 2011, 16:27
by big_bass
tasmod wrote:Great for a menu entry.

However what I would like to see is a Category maker and menu entry maker to populate it. :lol: :lol:
Hey tasmod

The (maker) part for a new *.desktop relies on prior package building knowledge to make it work using any GUI because it is for advanced users trio did however make a tool
to guide people a bit further I would hope that this work continues we will get closer
to an automatic tool someday if we keep at it

The (editing of an already made *.desktop)
can have the fields auto generated in the GUI
since someone already did that part

nice coding trio I use Xdialog alot
and gtkdialog only a very little bit
its nice that you posted your example
I collect small apps to modify
thats why I simplified it only to understand
what was happening better with the gtkdiaolg part
Joe

Posted: Mon 25 Apr 2011, 23:21
by smokey01
Menu Entry Maker 1.1 is a great little GUI but I have noticed a couple of traps.

1. You must delete the hint text before populating the field.
2. When choosing an icon it really should be 16x16 pixels only
3. If you delete the .desktop file other than with MEM it doesn't delete it from the menu. Running fixmenus, restart JWM or Restart X Server didn't fix it either. Reboot did. I guess the info is live in memory.

It would be nice to be able to edit an existing entry. I guess it is possible to delete and create a new entry instead.

Thanks

Posted: Tue 26 Apr 2011, 07:02
by Geoffrey
bigpup wrote:trio,

Could you add a file search function to step 4 like you have in step 3?
Something like this, made the gui a bit smaller and gave it tool-tip text for the examples.
Edit: removed button icons making it even smaller, renamed to 1.1.3 due to smokey01 already posting
a updated version named 1.1.2

Posted: Tue 26 Apr 2011, 08:46
by smokey01

Posted: Tue 26 Apr 2011, 15:14
by big_bass
It would be nice to be able to edit an existing entry. I guess it is possible to delete and create a new entry instead.
even more hacking fun coming
your way
http://www.murga-linux.com/puppy/viewto ... 5&start=22
Joe

Posted: Wed 27 Apr 2011, 01:26
by Geoffrey
smokey01 wrote:Geoffrey I made some mods here:
http://www.murga-linux.com/puppy/viewto ... 170#517170
Sorry about that smokey, I was unaware that you had posted version 1.1.2

I've edited my post to make it 1.1.3

The reason I changed it the way I did, is that there are those that know how it works and the extra info text isn't really required

I guess for me, it's more or less a personal preference.

I find it useful, beats using the text editor

Posted: Sat 30 Apr 2011, 08:17
by Geoffrey
I've updated this script yet again, I hope nobody minds me doing this, but I could see where it could be improved a little more.

It now creates a tmp dir where it re-formats the file name, so now it does not matter if there are spaces in the name,
they will automatically be replaced with a minus sign "-".

Changed this part of the script from this

Code: Select all

echo "[Desktop Entry]" > /usr/share/applications/"$PACKNAME".desktop
	echo "Encoding=UTF-8" >> /usr/share/applications/"$PACKNAME".desktop
	echo "Name=$MENUNAME" >> /usr/share/applications/"$PACKNAME".desktop
	echo "Icon=$MENUICON" >> /usr/share/applications/"$PACKNAME".desktop
	echo "Comment=$MENUNAME"  >> /usr/share/applications/"$PACKNAME".desktop
	echo "Exec=$MENUEXEC" >> /usr/share/applications/"$PACKNAME".desktop
	echo "Terminal=false" >> /usr/share/applications/"$PACKNAME".desktop
	echo "Type=Application" >> /usr/share/applications/"$PACKNAME".desktop
	echo "Categories=$CATEGORY" >> /usr/share/applications/"$PACKNAME".desktop
	echo "GenericName=$MENUNAME" >> /usr/share/applications/"$PACKNAME".desk
To this

Code: Select all

	echo "[Desktop Entry]" > /usr/share/applications/"$PACKNAME".desktop # modified by Geoffrey
	echo "Encoding=UTF-8
Name=$MENUNAME
Icon=$MENUICON
Comment=$MENUNAME
Exec=$MENUEXEC
Terminal=false
Type=Application
Categories=$CATEGORY
GenericName=$MENUNAME" >> /usr/share/applications/"$PACKNAME".desktop
Does the same thing

added tooltip-text to the app text, now if you hover over "Create a menu entry" it will popup a reference Trio as being the original script writer

Posted: Sat 30 Apr 2011, 10:24
by smokey01
Geoffrey I like the way you have implemented the help.

I don't get the same icon here as your screenshot. Mine still shows the brief case.

I rather like the idea of not having to type paths and filenames that why I made mine drag and drop. Less mistakes that way.

If you package it as a .pet file more will appreciate it.

good job.

Posted: Sat 30 Apr 2011, 11:18
by Geoffrey
Hi smokey01

Thanks for the kinds words, the icon in the screenshot is because I'm using the Blue-Moon icon theme.

As for drag and drop you can do the same with this version also.

I just made a pet package of it so I'll upload it here

Geoffrey

Posted: Sat 30 Apr 2011, 11:28
by smokey01
Geoffrey wrote:Hi smokey01

As for drag and drop you can do the same with this version also.

Geoffrey
Yes but it doesn't take you to where the icons are located which makes it easier to drag and drop them into the white space.

The same principle with the executable.

Sorry I must not have made myself clear.

Thanks

Posted: Sat 30 Apr 2011, 15:33
by Geoffrey
smokey01 wrote:
Geoffrey wrote:Hi smokey01

As for drag and drop you can do the same with this version also.

Geoffrey
Yes but it doesn't take you to where the icons are located which makes it easier to drag and drop them into the white space.

The same principle with the executable.

Sorry I must not have made myself clear.

Thanks
smokey01

Yes, I had a look at your script, I see what you mean now, though I'm thinking that I may find a more elegant way to do it.

It doesn't really need the path to the icon included, only the icon name as it will be found anyway as it is already in the path,

so you could just type the name of the icon and it will work just the same, you can try that and you will see what I mean.

icons will be found if they are in /usr/share/icons and /usr/share/pixmaps as well.

As an example if I want to add the icon /usr/local/lib/X11/mini-icons/abiword_16.xpm

I only need type in abiword_16 the xpm extension isn't needed either

the only time you need the path to the icon is if it's located in a different directory, such firefox for instance

then the path to the icon would be /usr/lib/firefox/icons/mozicon128.png.

Here's a test you can do to see how it works, copy the feed_icon.png to /usr/share/icons then create a menu entry, just give it a title and description

no need for a app and for the icon just type in "feed_icon" and look at the menu, it should have that icon.

Geoffrey

Posted: Wed 04 May 2011, 11:25
by Geoffrey
Well I've done some more work on this script,

before I get on with it, in my previous post I stated that "icons will be found if they are in /usr/share/icons and /usr/share/pixmaps as well."

I was wrong, they won't be found in /usr/share/pixmaps.

As for the script I've done some more improvements, this will be called 1.1.5, the first thing I've changed is that it now removes the

path text for the exec, only for /usr/bin, /usr/sbin, /usr/local/bin and the icons if their in /usr/share/icons and /usr/local/lib/X11/mini-icons.

It would have looked like this:

Code: Select all

[Desktop Entry]
Encoding=UTF-8
Name=menu entry maker 
Icon=/usr/local/lib/X11/mini-icons/mini.letter.xpm
Comment=menu entry maker 
Exec=/usr/sbin/menumaker
Terminal=false
Type=Application
Categories=AudioVideo
GenericName=menu entry maker 
But now looks like this, which is more inline with the standard:

Code: Select all

[Desktop Entry]
Encoding=UTF-8
Name=menu entry maker 
Icon=mini.letter.xpm
Comment=menu entry maker 
Exec=menumaker
Terminal=false
Type=Application
Categories=AudioVideo
GenericName=menu entry maker 
The other thing I did was to incorporate xdialog editbox, so now you can edit as well as delete existing menu entries.

I think someone was asking for that feature, which I feel is needed to make it a more useful application.

I will only upload a gz of it so those that are interested can test it for me, I did have a few bugs with the editor but it seems ok now.

once I know it's all ok I'll package it up,

Posted: Wed 04 May 2011, 22:23
by Geoffrey
well it still has a bug with the edit, if menumaker is run from the menu edit won't work, it's a path problem.

Edit looks for menumaker in root and can't find it, it works fine if the script is run directly no matter where it is.

I can't seem to be able to get my head around this, I must be missing something.
EDIT:
I found the problem it couldn't find the "pwd" for menuedit, so I defaulted it /usr/sbin, this means that menumaker as to be in that dir.

That should be ok it's a good place for it to live, I'll replace the gz file in the previous post, so the 7 people that downloaded it should get it again if they wish

It's still for testing, I just need some feedback as to whether it's acceptable as it is.

Posted: Fri 06 May 2011, 14:38
by Geoffrey
Here's another update, I added a conformation box for the delete, it was dangerous the way it was, resized the delete/edit menu window.

It's looking a lot better now, I haven't changed how it acquires icons or applications, if used with thunar file manager there is no drag and drop.

Will have to find another way to select icons, maybe a list with icon preview would be the way to go for stock icons.

It still needs to be in the /usr/sbin directory.
Image

Posted: Sun 08 May 2011, 05:39
by Geoffrey
Well this will be my last one, I'm happy with it, does all I need it to do.

this is version 1.1.7, basically a tidy up of the GUI's so that it is more uniform with different themes.

someone else maybe able to improve it.

Posted: Mon 20 Jun 2011, 07:58
by DaveS
Geoffrey wrote:Well this will be my last one, I'm happy with it, does all I need it to do.

this is version 1.1.7, basically a tidy up of the GUI's so that it is more uniform with different themes.

someone else maybe able to improve it.
Something is wrong with the code here. Try as a command line say,

Code: Select all

rox /root/'some directory'
and see what happens :)
Works in Trios original :)

Posted: Sat 25 Jun 2011, 01:30
by Geoffrey
DaveS wrote:
Geoffrey wrote:Well this will be my last one, I'm happy with it, does all I need it to do.

this is version 1.1.7, basically a tidy up of the GUI's so that it is more uniform with different themes.

someone else maybe able to improve it.
Something is wrong with the code here. Try as a command line say,

Code: Select all

rox /root/'some directory'
and see what happens :)
Works in Trios original :)
I don't seem to understand what you mean, It works fine for me, though I edited the script with and am using it with quirky 120 NOP.

With no rox only thunar I don't have drag and drop functionality using thunar.

All the fields need to be filled for it to function correctly, this is about the only fault I've found with it,

example, if were to miss a entry, all entries after that wouldn't be added to the "xxx.desktop" file

Could you explain in a little more detail the problem, or suggest what needs to be fixed, I find this script very useful and would like fix it.

edit: I found a error, don't know if it as anything to do with the problem your having thought, I'll upload a new pet.

Posted: Sat 25 Jun 2011, 06:19
by DaveS
Tried latest version, same problem. Here is the output when using rox /root/downloads/ as cmd line

Code: Select all

[Desktop Entry]
Encoding=UTF-8
Name=Downloads2
Icon=/usr/share/midi-icons/folder48.png
Comment=Downloads2
Exec=rox
Terminal=false
Type=Application
Categories=X-FilesystemUtility
GenericName=Downloads2
Exec=/root/downloads/
Terminal=false
Type=Application
Categories=X-FilesystemUtility
GenericName=Downloads2
Notice two exec commands. I did not use drag and drop to create command line, typed it in direct.