Lognote - Setting up a shortcut to re-run from the running icon in Ubuntu

 Create an executable icon desktop file.
Path: ~/.local/share/applications/Lognote.desktop
Set the Exec and Icon items according to the installed location.

[Desktop Entry]
Name=Lognote
Comment=Lognote
Exec=/home/USER/lognote/lognote.sh %U
Icon=/home/USER/lognote/lognote.png
Terminal=false
Type=Application
StartupNotify=true
MimeType=text/plain;
Categories=TextEditor;
Keywords=Text;Plaintext;
X-Ubuntu-Gettext-Domain=lognote

If you search for lognote in the Applications menu, you can see that an icon has been created.











If you add it to favorites and run it, the running icon and favorites are separated, and if you ctrl-click the icon after running, there is no response.
If other programs,  new window is created when you ctrl-click it. 

The reason is that "StartupWMClass" is not set.

If you type the "xprop WM_CLASS" command in terminal while the program you need to check is running, the cursor will change.
If you click the the program, WM_CLASS information will be output.

$ xprop WM_CLASS
WM_CLASS(STRING) = "com-blogspot-cdcsutils-lognote-Main", "com-blogspot-cdcsutils-lognote-Main"

Add "StartupWMClass=..." to the desktop file.


[Desktop Entry]
Name=Lognote
Comment=Lognote
Exec=/home/USER/lognote/lognote.sh %U
Icon=/home/USER/lognote/lognote.png
Terminal=false
Type=Application
StartupNotify=true
MimeType=text/plain;
Categories=TextEditor;
Keywords=Text;Plaintext;
X-Ubuntu-Gettext-Domain=lognote
StartupWMClass=com-blogspot-cdcsutils-lognote-Main
You can see that when you ctrl-click, a new window opens without separating it from your favorites.


No comments:

Lognote - Log viewer, Android logcat viewer for Windows, Linux, Mac

android logcat viewer for Windows, Linux, Mac   https://github.com/cdcsgit/lognote Filtered log viewer Android logcat viewer, kotlin ...