How to activate the favorites icon on the taskbar? - python-3.x

My application is in the selected taskbar(GNOME, dash-to-panel). When a window opens, a new icon appears in the taskbar. How to make so that the favorites icon is activated and a new one does not appear (as in other applications: Gedit, Nautilus)
Answer: Need a correct StartupWMClass entry. Find entry: in a terminal xprop WM_CLASS

Sounds like you don't have a launcher, in GNOME environments usually a .desktop file. This file tells the desktop which kind of application your app is, allows you to create right-click actions (such as New Window, New Private Window, etc.). Here is an example:
[Desktop Entry]
Name=<Name of Your App>
Exec=<command to execute>
Terminal=<true/false depending on whether you run it on a terminal>
Icon=<name of the icon for your app (icon has to be installed on the system)>
Type=Application
Categories=<Office;Game;etc; (semi-colon separated)>
Keywords=Something;Other Thing;
There is a good guide by GNOME here.

Related

What do I do to make Sublime text stop ignoring filenames that start with a dot

I am using Sublime Text editor and I need to change the settings for Sublime 3 to open files that start with a dot like .gitignore. Please let me know where in the settings I need to make the change. I am using Windows OS fyi.
This isn't a Sublime-specific option, but an operating system one, as the OS determines what is displayed in file dialogs as well as the file system explorer. To set the option on Windows, first open Windows Explorer and navigate to the folder containing the dotfile you want to view. Then, in the View tab, click the Options button on the far right, then select Change folder and search options.
You can also find Options under the File menu.
The Options window will now pop up. Select the View tab, then select the option Show hidden files, folders, and drives. Next, click on the Apply to Folders button at the top.
Similar options are also available on macOS and Linux.

Same executable with different icons

I want to open a pdf-viewer (okular) with different icons from the gnome-console.
Basically I want to differentiate between pdfs I am reading. Some would have the default okular icon, but I would like to have a different/special icon for the pdf generated by the LaTeX document I am editing.
Thinking about how to do this, I realized that I am not sure how gnome knows what icon to use when I execute /usr/bin/okular from the console. How is that bin related with an icon, no .desktop file involved right?
Applications set their icon at launch, to a compiled-in value. Most do it using the API of their graphics toolkit (Gtk provides various forms of the gtk_window_set_icon API call), but it has its roots in an X Windows window-manager property that's as old as dirt — which is why, for example, okular still has an application icon in Gnome Shell even though it's a KDE application.
You can see a grayscale representation of the icon(s) an application is exporting if you type xprop in a terminal, then click the application's window. (You need to have the correct utilities package installed, it's called xorg-x11-utils in Fedora.)
The application icon doesn't depend on Gnome or on the .desktop file under any circumstances.
(In fact, you could create your own $HOME/.local/share/applications/okular.desktop file that represented the application with a different icon, and launch it by clicking that icon, but it would be ignored in favor of the one that's compiled in to the application once it started. I have some custom launchers in my Favorites panel for different VNC sessions, using a different icon for each, but they all show up as TigerVNC with the standard icon when launched.)
AFAIK the only way to do what you want would be to compile your own separate version of okular with the icon changed to something else. That's just not the way application icons were meant to be used, sorry.

No title bar in qpdfview

I have qpdfview installed on linuxmint 18.The app doesn't show titlebar and is always in fullscreen(f11) mode.there is no max/minnimize or close buttons nor the taskbar.I am not able to have a floating window.
The reason this happened was once I pressed and holded the f11 button for a few seconds and then from then the titlebar was gone.
I uninstalled the software cleaned the directories then reinsatlled a few times but still the same result.
Image of the qpdfview
Then I observed this unusual output for wmctrl -l command
output
If this issue is related to qpdfview, try to check the local configuration file:
qpdfview uses a configuration file usually located at
"~/.config/qpdfview/qpdfview.conf",
which allows configuration of the toolbars and thumbnails.
look for something that uses fullscreen or no borders
If this is not working or its system wide, check the compositing options of your desktop environment
2.8. You can improve graphical performance of your Linux Mint Mate like this:
Menu button - Preferences - Windows
Deselect: Enable software compositing window manager

GitBash duplicate taskbar icon

I've just re-installed Git on my Win10 PC and tried to pin Git Bash to my taskbar.
For some reason now, when I open Bash from my taskbar shortcut, it displays duplicate icon on the taskbar. I tried to pin that icon but once I end the terminal session, that shortcut is deleted. I've tried multiple Win10 sites but most just say to repin the new icon.
Prior to updating I could pin it fine with no issues.
I did this for Windows 7:
Make sure there was no other (older) Git Bash appearing in Start Menu
Remove any existing pinned Git Bash from Taskbar
Launch Git Bash
Pin this launched window to Taskbar (instead of the one appearing in Start Menu)
In my case, launching git-bash.exe and pinning the result produced a shortcut to cmd.exe with no arguments, which just opened a regular command window. Creating a shortcut to git-bash.exe directly (either manually, or by pinning the existing Start Menu shortcut) caused the opened window to be separate from the pinned item.
What worked in my case (more manual):
Create a shortcut to this command: %windir%\system32\cmd.exe /c "C:\Program Files\Git\bin\bash.exe" --login
(Optional) "Change Icon...", then select the git-bash.exe location (one directory up from bash.exe), and click the icon selection area for the icon to show up and to select it.
Update the "Start in" value to %HOMEDRIVE%%HOMEPATH%
Pinning the git-bash.exe fixed the problem for me. This also fixed the problem with broken icon graphic.
NOTE! This was on Windows 7 - haven't tested on Win10!
Open Windows Explorer.
Navigate to C:\Program Files\Git.
Right click git-bash.exe, select Pin to Taskbar.
Shift-right click the newly pinned icon, select Properties.
Add to the end of the field Target: --cd-to-home
Set the value of the field Start in: %HOMEDRIVE%%HOMEPATH%
Press OK.
NOTE! This was on Windows 10
I don't know how it works but open the git-bash.exe file and pin the opened file on the taskbar
Do not pin the program which is not opened or else it wont work
None of the other solutions worked for me so here's what I did on Windows 10:
Open Windows Explorer
Navigate to C:\Program Files\Git
Right click on git-bash.exe
Right click on it and select Pin to Taskbar. This creates the first taskbar item.
Run git bash by clicking on the taskbar item. This creates the second taskbar item.
Pin the second taskbar item.
Open the properties (right click on the icon -> right click on the app name -> properties) of the second taskbar item and fix them:
Set Target to "C:\Program Files\Git\git-bash.exe" --cd-to-home
Set Start in to %HOMEDRIVE%%HOMEPATH%
Change the icon... Go to C:\Program Files\Git\ and select git-bash.exe and the icon.
Close the properties window and unpin the first taskbar item.
I have faced this problem. Here is a tried and tested solution. Very easy. Out of the 2 icons that you see, right-click on the inactive icon and do Unpin from taskbar. Then click on the active icon and do Pin to taskbar.
It's easy for Windows 10.
Open Windows Explorer
Navigate to C:\Program Files\Git
Select git bash
Select the 'Manage' option which appears under the field in purple 'Application Tools'
Select the 'Pin to Taskbar' option which shows on the far left

What is the function of the .desktop file in desktop Linux distributions?

I have the following situation: I have to modify a .desktop file that is into the package of an application of which I am working.
I have a strange problem that happens when I try to open the content of the file. If I click on it and then I try to click on "Open" it give me an error message that means in English: "LAUNCHER OF APPLICATIONS UNRELIABLE"
The only way to open the .desktop file is for me is to run the following shell command:
sudo gedit myApplication.desktop
Why is this so? Why does the error message appear when I try to open the .desktop file normally?
The content of the .desktop file is:
[Desktop Entry]
Icon=myApplication
Categories=Utility;
Type=Application
Exec=/usr/share/MyApplication/appl/launcher.sh
Name[en_US]=Connect Data Space
Name=My Application Name
Comment[en_US]=
Comment=
StartupNotify=true
Terminal=false
OnlyShowIn=GNOME;Unity;
StartupWMClass=MyApplication
Actions=CheckUpgrade
[Desktop Action CheckUpgrade]
Name=Verifica Aggiornamenti
Exec=java -jar /usr/share/MyApplication/appl/lib/shellExtBridge.jar -checkupgrade
OnlyShowIn=GNOME;Unity;
And now I have some doubts about it:
1) Icon: reading some documentation it seems to me that if I put an icon called myApplication.png inside the folder /usr/share/pixmaps of my package, it use this icon, is it right?
2) Exec: reading some documentation it seems to me that this field specifies the path to the file that is executed when my icon is clicked, is it right? But in this case what file is executed? /usr/share/MyApplication/appl/launcher.sh or /usr/share/MyApplication/appl/lib/shellExtBridge.jar -checkupgrade.
I think the first file is executed, but then what is the functionality of the file in the second Exec statement?
In general, what is the functionality of the .desktop file? It seems to me that it only adds my application icon to the Unity toolbar to start my application clicking on it. Is that right, or is there additional functionality of the .desktop file?
The .desktop file is a shortcut that points to the executable and add an icon to that particula shortcut.
have you noticed all the .desktop files in /user/share/applications It's there all the shortcuts are gathered. You may take some inspiration from there.
that depends on which icon you point the .desktop file to. (i'm not sure about this one but the icon could also be stored in /usr/share/icons)
yes it's right. The Exec field specifies which file that should be executed. It's the [desktop entry] you should look at so it's the /usr/share/MyApplication/appl/launcher.shfile that is executed
As I can see it will give your shortcut an icon, a name and it will point the shortcut to the /usr/share/MyApplication/appl/launcher.sh file. The StartupWMClass property will do so that your application dosen't actually create a new open application icon in unity instead it will light up the shortcut you already created.
check out this for more info about that.
the Category property Categories=Utility; is made so that gnome2, gnome-fallback, xfce and MATE desktop environments can place the shortcut at the correct position(because they have menus).
i can't tell what the last 4 lines in the desktop file does but i think they are executed when you run the app updater. so that your java app updates itself. Or it will create an update entry when you right click on the icon in the unity launcher so that you can update it through the small right-click menu (but i don't know)
I'm not sure about all this, so correct me if i'm wrong. But some info is better than nothing :)

Resources