Ubunto12.04-Gnome3 -- Show icon in alt-tab menu using .desktop file - icons

After Googling for hours, I didn't find any answer for the following issue and so glad if anyone could help.
I use Ubuntu 12.04 LTS with Gnome-shell 3.4.1. Consider the following simple program in file $HOME/a.py which I have made it executable:
#!/usr/bin/env python
import gtk
w = gtk.Window()
w.set_size_request(250, 150)
w.set_title("test program")
w.connect('destroy', lambda x: gtk.main_quit())
w.show_all()
gtk.main()
I've used MenuLibre to define a_run0.desktop in $HOME/.local/share/applications as below:
[Desktop Entry]
Version=1.0
Type=Application
Name=a_run
Comment=comm.
Icon=applications-development
Exec=/home/vsop/a.py
Path=
Terminal=false
StartupNotify=true
Categories=
Name[en_US]=a_run
Comment[en_US]=comm.
I made a_run0.desktop to be executable and I see a file named “a_run” in $HOME/.local/share/applications with proper icon (Icon=applications-development
). Running the program and using alt-tab, the icon is also shown in alt-tab menu quite well.
The question is, when I copy “a_run” file (actually a_run0.desktop) to $HOME/Desktop, the file is shown with correct icon in Desktop but after running it, the icon shown in alt-tab menu is changed to unknown-red-circle-icon with the name of original file “A.py” underneath.
What is made this problem and how can I see the defined-icon (in .desktop file) correctly in the alt-tab menu after running the program from $HOME/Desktop?

Try to add icon to your window using python and gtk. I think that icon in .desktop file only specify how .desktop file is shown in system not application.

Certainly in more recent versions of Gnome shell (I'm using 3.14.1) the entry Icon should point to the actual icon you want to use, e.g
Icon=/home/vsop/a_icon.xpm

Related

Electron : Mac Icon is not working

I try to create the Mac .DMG for my application with the following command :
electron-installer-dmg ./release-builds/automental-darwin-x64/automental.app Automental --out=release-builds --overwrite --icon=images/favicon.icns
For me, there is nothing anormally and the path is ok and the icon too.
When, I'm launching the DMG file generated, I still have the default Mac Application icon and the desired icon is visible in a small file called .VolumeIcon.icns
So, am I doing something wrong ? Because I want to display my icons, not the default Mac one. (I already check : Node package are all up to date)

Change virtual keyboard to AZERTY

I have a javafx application that is supposed to run in fullscreen mode on a Windows tablet.
My problem is, when the keyboard appears, it's in QWERTY whereas my tablet is in AZERTY.
So the question is : Is there a way to use the system virtual keyboard or to switch the javafx virtual keyboard to AZERTY?
I found you question while trying to accopllish the same thing.
I spent a day trying to make javafx display an AZERTY keyboard and i found a solution!
Well let me be clear : javafx gave no way at all to have an azerty keyboard so you have to hack a little.
The solution bellow is not a perfect one and you'll have to repeat it each time you update javafx, but it will allow you to extrem customize the keyboard far beyong querty and azerty.
SOLUTION 1 (dirty but works )
You will need to edit a file in javafx file shipped with the JDK
STEPS :
GO to the JDK (in Mac : /Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home)
Go inside jre/lib/ext and copy javafx jar called jfxrt.jar to a folder on your desktop.
Install EMACS if you don't have it and open the copied jar file with this software
Browse files list searching for com/sun/javafx/scene/control/skin/TextBoard.txt
the list is sorted from A-Z so use it (there is more than 6000 files).
Open it and HERE you are. Change characters to whatever order makes you happy. I joined the azerty order.
Save and copy back the jfxrt.jar to where it was. Done.
Note: don't try to extract the jar and rezip it, it won't work as jdk keeps an index list of files.
Result:azerty javafx virtual keyboard in action
SOLUTION 2 (Clean but i didn't finish it)
Whene i digged into javafx classes i found out that the class responsible for loading the TextBoard.txt file that lays out the keyboard is FXKVSkin
This class is meant to receive other type of keyboards than the lonly qwerty default one.
All you have to do is add this in your code :
textFieldThatYouUse.getProperties().put(FXVK.VK_TYPE_PROP_KEY,
"mykeyboard");
Where mykeyboard is a file you created like TextBoard.txt called MykeyboardBoard.txt (capitals letters are important).
FXKVSkin will look now for a file called MykeyboardBoard.txt, and here's where my adventure ended.
You will need to make FXKVSkin find your file, i tried by adding a file to the classpath at runtime solutions Here but it didn't work.
If anyone can solve this problem, please add it as an answer, it would be a less dirty solution.
Hope the solutions will help some non english speakers! :p
The definition of the layout is contained in jfxrt.jar (part of the Java install). It is described by TextBoard.txt. It is possible to browse in the jfxrt.jar with 7zip or similar programs. TextBoard.txt is in com/sun/javafx/scene/control/skin/
This file is loaded com/sun/javafx/scene/control/skin/FXVKSkin.java is responsible for loading the TextBoard.txt file. Browse the javafx source (included via the jdk and contained in javafx-src.zip) to see how it is processed. Maybe this will give you enough information to load your own TextBoard.txt file.

How to quickly open a resource file by hovering on the file name in the code

Suppose a Qt qmake project has a source with a following line of code:
loadTxt(":/libraryNotes.txt");
If I want to open the "libraryNotes.txt" files in the target's resources, I need to go the "Projects" tab, open the "Resources", and look for the file, then click and open it.
Is there any shortcut to do it directly from the code editor pane, when the mouse cursor or text cursor is over the filename? I'm thinking of a way similar to pressing F2 to follow the symbol to its declaration/definition.
Unfortunately, this doesn't seem to be supported in Qt Creator 3.2.2 at least. But it shouldn't be too hard to add, most of the support code is already there.

How to change JavaFx native Bundle exe icon

I am trying to chance the icon of the exe file created native bundling of javafx packaging but it still contains the default icon. Please suggest
primaryStage.getIcons().add(FileUtility.loadImage("icon.png"));
did not help, it only changes the title bar and task bar icon.
The ico file still gets generated and icon of the exe files remains the default one
I also tried to assign an icon in the project properties-> Deployment-> icon but did not help
I believe I have encountered the same issue and the solution is described in the following thread.
As a side note - neither specifying your icon in the build.xml file or via the project's options in the deployment section is going to work thus far, but it seems to be fixed in the upcoming release of 7u10.
I added response here How to set custom icon for javafx native package icon on Windows and thinks it is the same issue you started out with. However you seem to have moved on, but others might find it interesting...
I added src/main/deploy/package/windows/myapp.ico there and it finally worked :)
For you:
Create src/main/deploy/package/windows/ folder
Add icon with name ${project.build.finalName}.ico
Run mvn jfx:build-native
I haven't played with it extensively - just got it to work and wanted to share. So if you want to use icon with different name, I don't know how. Not yet at least. The ... section in the config section seems to be for webstart, so I haven't been using it. Hope you get it to work!
Answered at How to set custom icon for javafx native package icon on Windows

WindowIcon not showing up despite being valid in resource (and used elsewhere)

In my last question (Qt/C++: Icons not showing up when program is run) I asked how to get an icon to show up on a toolbar and was told I needed a Qt Resource, which I added and that fixed my problem, the icon did show up on the toolbar.
Now I'm trying to set the title icon of a window, using the same resource file, and it shows up fine in the Qt preview viewer but blank in the actual program. I am using a MainWindow which has an MDIArea and the children are MainWindows as well; neither the parent MDI nor child MDI windows icons will show properly. On the parent, I see the regular "Windows Application icon" and on the child, the icon is completely blank.
How can I solve this?
You will have to go through a standard resource file for windows. (That is, a .rc)
The process (as described in the documentation) is:
Store the ICO file in your application's source code directory, for
example, with the name myappico.ico. Then, create a text file called,
say, myapp.rc in which you put a single line of text:
IDI_ICON1 ICON DISCARDABLE "myappico.ico"
Finally, assuming you are using qmake to generate your makefiles, add this line to your myapp.pro
file: RC_FILE = myapp.rc
Regenerate your makefile and your application. The .exe file will now be represented with your icon in Explorer.
In the Visual Studio case you're simply able to add a resource to your project.

Resources