![]() Sudo desktop-file-install -dir=/usr/share/applications. For sake of completeness, the latter method was used as follows: sudo desktop-file-install -dir=/usr/share/applications. Both methods have been attempted, with the same results. ![]() sktop is as follows (again, " (my home folder)" is simply a placeholder for this example): #!/usr/bin/env xdg-openĮxec=/(my home folder)/Projects/HelloWorld3,4/HelloWorld4Īccording to the article I referenced at the top of this post, the desktop files can either be copied to $HOME/.local/share/applications or installed under /usr/share/applications using desktop-file-install. #!/usr/bin/env xdg-openĮxec=/(my home folder)/Projects/HelloWorld3,4/HelloWorld3Ĭomment=Hello World with Application-Specific Icon ![]() Of course, " (my home folder)" is simply a placeholder for this example the actual file on my system contains the correct full path to the executable. There is already an icon called "preferences-color.png" under /usr/share/icons/hicolor/ (icon size)/apps. To simplify matters for this example, I am not installing any custom icons. Gcc `pkg-config -cflags gtk4` HelloWorld.c -o HelloWorld4 `pkg-config -libs gtk4` The file resides in a folder called "$HOME/Projects/HelloWorld3,4" and is compiled to produce executables named HelloWorld3 and HelloWorld4 as follows: gcc `pkg-config -cflags gtk+-3.0` HelloWorld.c -o HelloWorld3 `pkg-config -libs gtk+-3.0` Status = g_application_run (G_APPLICATION (app), argc, argv) G_signal_connect (app, "activate", G_CALLBACK (activate), NULL) Gtk_window_present (GTK_WINDOW (window)) Īpp = gtk_application_new ("", G_APPLICATION_FLAGS_NONE) Gtk_window_set_default_size (GTK_WINDOW (window), 200, 200) Gtk_window_set_title (GTK_WINDOW (window), "Window") Window = gtk_application_window_new (app) To test this behavior, I have created a file called HelloWorld.c that contains the following code, which is derived from The GTK Project's Getting Started page and compiles successfully under both GTK3 and GTK4: #include One thing to mention up front is that I am running Ubuntu 22.04 LTS with the latest updates inside a VirtualBox VM hosted under Windows 10. I am seeing an issue where the application icons display correctly with GTK3 apps, but the default widget icon displays for GTK4 apps. This article in particular is very helpful in explaining how to deploy desktop files and icons. Recent articles about GTK4 detail the changes required for displaying application icons.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |