My app while run from source shows
<filename>.py. How can I avoid it and set a proper name? I tried this
GLib.set_application_name but it didn’t work. Do I have to use Desktop files to do that, or shall I change my filename from
Minimal working example
from gi.repository import GLib, Gtk
self.win = Gtk.Window(title="Hi")
self.win.add(Gtk.Label(label="Look at the app name at the panel"))
app = App()
No reply from anyone so far?
You don’t need a desktop file. Are you creating a
Gtk.Application instance? Can you post a minimal example that fails?
Yep I’m creating a
Gtk.Application instance. I’ve edited the question to include source and a screenshot
How do you know it hasn’t worked? Where are you looking at the app name?
See the name in the panel at the top of the screen in the screenshot, next to Places. I’m guessing that the app with focus is the Python app, not Kate.
Are you running it though a debugger?
Nope. Just normal execution.
TempX.py, is my app, the app with focus.
Yes, that is where an application’s name and icon come from.
If there is no .desktop file or we fail to match it to the window, then we create a “fake app” with fallbacks so that components like the app menu, alt-tab or the dash still can display something.
But it’s really just that: a fallback. Please don’t try to game the system by making the app fallback show up nicer, provide a .desktop file that allows it to properly integrate with the system.
If you want your users to be able to launch your application normally by clicking its icon, or add it as favorite to the dash, then you will need a .desktop file anyway.
Thanks for that. Expected the use of Desktop files here.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.