Application icons in Linux
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Application icons in Linux
ok, it just has to work i see.
Ok i will test some more.
Maybe alpha in the image is an issue.
So i will try with another image(without transparency)to see what happens.
Will report back tomorrow.
Thanks!
Ok i will test some more.
Maybe alpha in the image is an issue.
So i will try with another image(without transparency)to see what happens.
Will report back tomorrow.
Thanks!
Re: Application icons in Linux
I didn't check for alpha in a png, I'll run that in a few. Look forward to hearing your results tomorrow
*Edit - to test alpha, I took the original image into GIMP, then took all the black out of it and saved it out as a .png file... Then re-ran makeLauncher. Seems to work here, so I'm out of ideas
*Edit - to test alpha, I took the original image into GIMP, then took all the black out of it and saved it out as a .png file... Then re-ran makeLauncher. Seems to work here, so I'm out of ideas
Re: Application icons in Linux
Hi Bogs,
i created a starter by clicking on the desktop to see what's happening.
So here i could choose just like in your program.
The text in the script is this:
(there is no category ,because it was made on the desktop)
Then i copied the entry which was made with your program to the desktop.
Checked the script:
Allthough the PNG was selected in you program, it was not written to the script.
So that must be why i don see the icon. Strange hey, that it works with you but not here.
So to make sure i used your last version, i've downloaded again, checked some in the script. But i see the line should be added. Created a x64 standalone, but same issue.
i created a starter by clicking on the desktop to see what's happening.
So here i could choose just like in your program.
The text in the script is this:
Code: Select all
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Icon=/home/jerry/Downloads/test.png
Icon[nl_NL]=/home/jerry/Downloads/test.png
Exec=/home/jerry/Downloads/Test
Terminal=false
Name[nl_NL]=test2
Name=test2
Then i copied the entry which was made with your program to the desktop.
Checked the script:
Code: Select all
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Categories=Development;
Name=Test
Exec="/home/jerry/Downloads/Test"
StartupWMClass=
Terminal=false
# File generated on Sat, 29 Dec 2018 12:09:47 +0100
So that must be why i don see the icon. Strange hey, that it works with you but not here.
So to make sure i used your last version, i've downloaded again, checked some in the script. But i see the line should be added. Created a x64 standalone, but same issue.
Re: Application icons in Linux
this piece rmoves the line where the icon is stated:
So if the comment field is not adjusted then there is no new line inserted in the script, but it removes the line with Icon=, because itś then on line 6.
So i commented out these 2 lines:
--else
-- delete line 6 of field 1
Now there is an icon, but not the png image.
**edit
i also see that with my installation the folder with the starters is: /usr/share/applications
you have this: "/.local/share/applications/"
So i could not find the starterscript, is that different per Linux Distribution?
Code: Select all
if field "txtComment" is not "Comment about the program..." then
put "Comment= " & field "txtComment" into line 6 of field 1
else
delete line 6 of field 1
end if
put "Comment about the program..." into field "txtComment"
So i commented out these 2 lines:
--else
-- delete line 6 of field 1
Now there is an icon, but not the png image.
**edit
i also see that with my installation the folder with the starters is: /usr/share/applications
you have this: "/.local/share/applications/"
So i could not find the starterscript, is that different per Linux Distribution?
Re: Application icons in Linux
Well, I think I know what the problem is now anyway, your still using the older version I posted about way back there, and I am using the version(s) linked to here.
*Edit - I have removed the previous versions to prevent confusion, and have gone back to link any past posts to the posts for the newer versions.
When you download the zip file, all you should see in the 'create launcher' folder is this... If there is anything else in that folder, delete it and turn the file 'AutomatedMakeLauncher' into an exe.
and you should now see a folder named ".local". This is (one of the places) where the menu draws from, and the place the newer launcher maker places the file.
/usr/share is a folder requiring root permission to write to, if you were installing a program for all the users on a machine. The approach I'm using writes only to the users folder, and therefore doesn't require priviledge escalation to root or sudo.
*Edit - I have removed the previous versions to prevent confusion, and have gone back to link any past posts to the posts for the newer versions.
When you download the zip file, all you should see in the 'create launcher' folder is this... If there is anything else in that folder, delete it and turn the file 'AutomatedMakeLauncher' into an exe.
You absolutely have the "/.local/share/applications/" folder. Open your file browser, go to your home directory, and if you don't see any folders that start with a '.' then on your keyboard hit
Code: Select all
ctrl+h
/usr/share is a folder requiring root permission to write to, if you were installing a program for all the users on a machine. The approach I'm using writes only to the users folder, and therefore doesn't require priviledge escalation to root or sudo.
Last edited by bogs on Sun Jan 13, 2019 2:10 pm, edited 3 times in total.
Re: Application icons in Linux
Yes!
Works perfectly! Great job! and thanks very much.
I will make a minor change, so that i can choose the category like in the first releases and hit the write button again. I liked that.
So now back to eating mucho mucho Oliebollen https://nl.wikipedia.org/wiki/Oliebol ,a tradition, for these last 2 days of this year
Happy new year Bogs!
Works perfectly! Great job! and thanks very much.
I will make a minor change, so that i can choose the category like in the first releases and hit the write button again. I liked that.
So now back to eating mucho mucho Oliebollen https://nl.wikipedia.org/wiki/Oliebol ,a tradition, for these last 2 days of this year
Happy new year Bogs!
Re: Application icons in Linux
Glad to hear it is finally working correctly for you!
This allows you to have a fixed number of lines that doesn't change, something that is so obvious I was embarrassed it wasn't how the first run of code went
I'll be busy straightening out my computer today since I was apparently the victim of a hack (if you see any wierd posts by me before I'm finished, I swear it wasn't me), but after I'm done I'll make the corrections and post the update for any others that come along behind us.
Happy (and hopefully safe!) New Year to you and yours, and everyone else that I don't see before then
That should be easy to do, the major corrections I made were instead of 'put into line x', I put the variable 'after line x', and stopped deleting any of the lines.
This allows you to have a fixed number of lines that doesn't change, something that is so obvious I was embarrassed it wasn't how the first run of code went
I'll be busy straightening out my computer today since I was apparently the victim of a hack (if you see any wierd posts by me before I'm finished, I swear it wasn't me), but after I'm done I'll make the corrections and post the update for any others that come along behind us.
Happy (and hopefully safe!) New Year to you and yours, and everyone else that I don't see before then
Re: Application icons in Linux
Guided by your comments along this thread, I've revised the script a bit.
You don't have to turn off messages anymore when opening it in the IDE, simply click the answer dialogs "Yes" button when it opens.
When the program launches, after it gathers the base information, it will put up an answer dialog asking if you want to add a comment or change the category. If you answer yes, you can make any changes before the file is written with the combo box for categories, or the field for comments, or even in the field the file text itself is in.
For instance, if your program works in the terminal, then change 'terminal=false' to 'true', and then you can write the file out (it won't pause again) and the program will close.
If you answer no, the program will simply write out the base file and close. The file will be written out to 2 places, the sub folder of the program '/AutomaticCreateLauncher/launcherRes/', and the local menu entry folder '~/.local/share/applications/'.
If you decide you want the program to be fully automated for something, like to include with your program on some one else's machine, just comment out the answer dialog line, and change the custom property template directly to change the category and comment. Optionally, if you include it for distribution, you may also want to launch it so it doesn't show the window, which might confuse a user, but that is up to you
All the rest of it is pretty much what it was before, heavily commented and with minor code change. Enjoy and let me know if you hit any problems
*Either version (or both) can be downloaded from here.
You don't have to turn off messages anymore when opening it in the IDE, simply click the answer dialogs "Yes" button when it opens.
When the program launches, after it gathers the base information, it will put up an answer dialog asking if you want to add a comment or change the category. If you answer yes, you can make any changes before the file is written with the combo box for categories, or the field for comments, or even in the field the file text itself is in.
For instance, if your program works in the terminal, then change 'terminal=false' to 'true', and then you can write the file out (it won't pause again) and the program will close.
If you answer no, the program will simply write out the base file and close. The file will be written out to 2 places, the sub folder of the program '/AutomaticCreateLauncher/launcherRes/', and the local menu entry folder '~/.local/share/applications/'.
If you decide you want the program to be fully automated for something, like to include with your program on some one else's machine, just comment out the answer dialog line, and change the custom property template directly to change the category and comment. Optionally, if you include it for distribution, you may also want to launch it so it doesn't show the window, which might confuse a user, but that is up to you
All the rest of it is pretty much what it was before, heavily commented and with minor code change. Enjoy and let me know if you hit any problems
*Either version (or both) can be downloaded from here.
Last edited by bogs on Sun Jan 13, 2019 2:09 pm, edited 2 times in total.
Re: Application icons in Linux
You're quicker than me Bogs
I was busy with it, so that a few lines would be changed before writing, but had to do something else too.
So i was not finished yet.
But this makes it perfect! I can stop doing my adjustments and use your version
I think you've helped a lot of other people too with this nice tool.
Muchos Gracias!!
ps. I will reboot to Ubuntu and check it out.
I was busy with it, so that a few lines would be changed before writing, but had to do something else too.
So i was not finished yet.
But this makes it perfect! I can stop doing my adjustments and use your version
I think you've helped a lot of other people too with this nice tool.
Muchos Gracias!!
ps. I will reboot to Ubuntu and check it out.
Re: Application icons in Linux
Well, let me know if there are any issues with it as it sits. I was thinking about adding a way to browse to the folder holding the exe you want to create the launcher for, but at that point you are basically just getting the native tool to create a launcher
Re: Application icons in Linux
This is great as it is.
I've made a x64 Linux standalone in LC902. and it works superb.
Thanks for your effort !
I've made a x64 Linux standalone in LC902. and it works superb.
Thanks for your effort !
Re: Application icons in Linux
My pleasure, glad it works for you. You'll have to tell me how it goes if you ever include it with a program as part of a setup
Re: Application icons in Linux
No problem.
Of course will do that
Of course will do that
Re: Application icons in Linux
That would make my year
*Edit -
Well, I found a problem already with the program. Looks like I will have to look at the long files version to score the executable after all
*Edit 2 - Actually, found an even better way than that
*Edit -
Well, I found a problem already with the program. Looks like I will have to look at the long files version to score the executable after all
*Edit 2 - Actually, found an even better way than that
Last edited by bogs on Fri Jan 04, 2019 12:10 pm, edited 1 time in total.
Re: Application icons in Linux
So, one of the problems I found was that my method for detecting the executable file was pretty poor, as I only evaluated the names of the files in the folder, and not their permissions. I found a lot of circumstances where this really showed how bad a method that was
The new version will only pick an executable marked file for the initial run (if you manually override that, well, there isn't much I can do about that )
Some other issues I found were that it works out better naming the launcher after the folder the file is in, rather than relying on the exe name for the entry (go figure). I found this out when testing it on the Lc IDE files, which are all named the same One thing I found annoying in my original design was moving the creator to all the different program folders. It works well if your going to package it as part of an installer, since it is already setup to run when opened, but as a desktop utility it was rather tedious
That has been eliminated in this version, but if you plan to use one of the versions as part of an installer routine, your better off with the other version (which I will be correcting the deficiencies and reposting).
I'll be posting this one when I finish testing it a bit further, hopefully I'll be able to call it done after that
Even used it on itself
* You can download either version (or both) from here.
The new version will only pick an executable marked file for the initial run (if you manually override that, well, there isn't much I can do about that )
Some other issues I found were that it works out better naming the launcher after the folder the file is in, rather than relying on the exe name for the entry (go figure). I found this out when testing it on the Lc IDE files, which are all named the same One thing I found annoying in my original design was moving the creator to all the different program folders. It works well if your going to package it as part of an installer, since it is already setup to run when opened, but as a desktop utility it was rather tedious
That has been eliminated in this version, but if you plan to use one of the versions as part of an installer routine, your better off with the other version (which I will be correcting the deficiencies and reposting).
I'll be posting this one when I finish testing it a bit further, hopefully I'll be able to call it done after that
Even used it on itself
* You can download either version (or both) from here.
Last edited by bogs on Sun Jan 13, 2019 2:07 pm, edited 2 times in total.