How to make a app icon for phosh

I made an app for Phosh with Python 3 and Gtk and it runs perfectly fine but can’t figure out how to make an app icon for it. Anyone got any advice?

I made an app for Phosh with Python 3 and Gtk and it runs perfectly fine but can’t figure out how to make an app icon for it. Anyone got any advice?

For gnome it may be like this:

  1. make a very small picture (reduce a normal one to less pixels)
  2. put in /Documents (or wherever you like)
  3. make a .desktop file in ~/.local/share with the relevant info
    example .desktop:
    #!/usr/bin/env python3
    [Desktop Entry]
    Comment=Renames pictures and movies
1 Like

Sweet, I’ll give that a go in a bit. I saw examples with Icon equal to something like applets-screenshot but never knew what available options there were. Thank you again for the info. I’m definitely not an app developer but I use Python every day at work and thought it’d be a fun time to try a new challenge.

This isn’t working for me for some reason. I am in .local/share and made scale.desktop with virtually the same entries that you have aside from obviously the different path to the code and picture but it isn’t showing up in my apps. Do I need to restart or something?

~/.local/share/applications is where you would want to put your scale.desktop file.
After that, I think it should automagically show up in the applications menu.

You might have to run the .desktop file and tell the OS that its OK to run it first

Maybe this page can help:

It says:

I created a desktop link for it so it was easy to launch from the desktop. To do this I created a new file called /home/purism/.local/share/applications/screenshot.desktop :

and then the contents of that file including the line Icon=applets-screenshooter, although it doesn’t say where the “applets-screenshooter” icon file itself is, probably it’s taken from some default location.

That page was what I was originally going off of and it didn’t work so I came here for help.

How would I do that? From the link below and a few others they say to use gtk-launch and the .desktop file name but that isn’t installed and I don’t know how to install that.

Did you try sudo apt install gtk-launch?

Did you try logging out and in again? I have to do that sometimes in order to have the icon of newly installed applications in the grid.

I did, yeah. It says it’s unable to locate the package gtk-launch

I haven’t logged out but I did restart. I guess I’ll try logging out and see if that solves it. Edit: Unfortunately that didn’t work.

Also there’s a menu editor you can install for gnome, but I can’t remember the name of it. Menulibre? I think if you search the software center for menu editor you’ll find it, then you can manually add it.

I’m checking Menu Libre out right now. It is saying the desktop files are valid and not it’s not sure why they aren’t working. Oh well though. I’ll try to manually make one within here.
Edit: This officially worked for me so thank you!

1 Like

Another guess: Did you create the desktop file as root? I’m not deep into that but I can imagine if you chose a user desktop file directory and worked with sudo that it wouldn’t work.

I did not make it as root. I just looked at the file made by Menu Libre and it uses my .desktop file as it’s exec so it obviously works or else the Menu Libre file wouldn’t have worked. Super weird but oh well.

Now I see why this issue is familiar, you also reported this in the Mobian project issue tracker.
I am assuming you are using Mobian?

With PureOS the steps described in the tutorial linked above worked.

Right, I just reported it there. I figured it was a Phosh thing for how they were made and not the OS itself.

I am in the mobian matrix room, there a bot there that announces new tickets, that is how I saw it :smiley: