Same executable with different icons - gnome

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.

Related

how to launch evince at 100% zoom, or other pdf-viewing solution

I'm going through a bunch of PDFs viewing and then renaming.
I want to open each PDF at 100% zoom when I double-click it from nautilus. Currently it opens at 59%. I have to resize the window every time.
The application seems to call itself "Document Viewer". As far as I can tell, this is an unhelpful indirect name for evince. But I am not sure, because GNOME as a whole is trying to be "clever" about everything.
I've tried "Save Current Settings as Default", but that doesn't have the desired effect.
I've also tried gsettings set org.gnome.Evince.Default zoom 1.0 based on eg https://askubuntu.com/questions/606838/configure-evince-to-open-maximized-with-100-zoom-level . The gesttings command did not produce an error. But nor did it change evince's behaviour.
I'm open to a generic X11 solution, and reserving an area of the screen for this. I'm also open to a solution involving evince, or how nautilus launches it, or a different graphical shell or PDF viewer. Preferably applications available with debian 10.
Ideally I'd like a graphical shell which can give 100% previews and inline renames with F2. This would give a quick workflow for view-renaming whole folders of scanned papers one after the other.
I'd also be interested in socio-cultural explanations of the confluence of factors that resulted in such a severe and basic failure: opening a PDF from the graphical file browser does not result in a readable rendering, and requires the user to resize the window.
Screen is 3840x2160.
"Save Current Settings as Default" works for me on F33. I didn't change any of the other Gnome settings. I use a couple of different monitors with different resolutions and it doesn't give me any issues. I don't know if Debian handles Evince differently; I haven't used Debian for ages. Not a lot of help, sorry.

How to set icon(or .ico file) on executable file in linux system?

I've been trying to set icon on executable file(.exe) in linux and macOS.
what I learn is there are 3 places icon sets: on taskbar, window bar, and executable file thumbnail.
I have set on taskbar and window bar, but not on exe file.
(By the way, I've already done on 3 of them in windows using visual studio.)
and I might not know exact term of it, so I will show the example below:
enter image description here
I guess .rc file should be in makefile.
If so, I could solve it also in macOS.
If not, I want to know how to set in linux and macOS too.
Please let me know how to use it and set it. Thanks in advance.
p.s. I set icons on window bar and taskbar using GLFWimage and working on openGL3 & c++.
glfwSetWindowIcon(window, 1, &icon);
I guess .rc file should be in makefile.
While there is a "standardized" way for storing icons in Windows .exe files, there is no such method for "ELF" files (the most common executable file format under Linux).
on taskbar and window bar
The icon used by the window manager (e.g. for the task bar) is typically stored as "X11 window property". A "X11 window property" is some data assigned to a window by a program.
The program must provide the icon image as array and call the function XChangeProperty() (this is what the function glfwSetWindowIcon() indirectly does).
It is not necessary that the icon is stored in a special way (comparable to the .rc file in Windows); the program can simply store the icon in some const array or even calculate the icon image data before calling XChangeProperty().
... but not on exe file.
As I already have written, there is no "standardized" way to store icons in executable files for Linux.
Some file managers "know" certain programs and display the corresponding icons: They know that "xterm" is a terminal program, so they display the terminal icon. However, this icon is not stored inside the executable file but in the file manager: If you rename any executable file to "xterm", the terminal icon will be displayed.
There is an extension named "elfres" (it was named "elficon" some years ago) that allows adding icons to ELF executable files. The web site of that extension is found here. On the linked web site you also find a screen shot with an example - so you can check if I understood you correctly and this is what you are talking about.
Unfortunately, this is a non-standard extension. For this reason a "standard" Linux installation will not check if an executable file contains an icon and therefore not show the icon.
If you use the "elfres" method, you must install a special plug-in; otherwise the icons of executable files are not shown.

macOS Sublime Text 3: How do I disable one window / tabbed windows?

Not to long ago (well, maybe months and months), Sublime 3 has started launching as a singular window with tabbed windows that have their own tabs. I despise this approach. See screen shot:
How do I disable this behavior?
Version 3.1.1 build 3176
The only Packages I have installed are:
A File Icon
Groovy Snippets
Material Theme
Package Control
Pretty JSON
This particular feature is something that's happening as a result of your using MacOS (i.e. it's not something that Sublime does natively; the OS is doing it on your behalf).
In the general case most MacOS applications should have native menu items to combine windows together like this at the user's request in combination with the Prefer tabs when opening documents setting in the Dock area of the system preferences.
Sublime doesn't support the native menu items for this (yet), so it relies solely on the setting; having it set to Always (and also In Full Screen Only, but this tends to cause problems with Sublime) makes MacOS automatically "tab" new windows. Setting that setting to Manually stops this from happening.
This is also somewhat controlled by the Theme that you're using in Sublime. For MacOS, a Sublime theme can theme the menu bar of the window to match the overall application theme. Behind the scenes, this makes Sublime declare to MacOS that it wants to be in charge of displaying it's own window, which stops the system from automatically combining windows together.
An example of a theme that does this is the Adaptive theme that ships with Sublime.

How to get the location of the component of a window in Linux?

In Linux, one can use xwininfo to get the location of a window. Is that possible to get the location of it's component, e.g. the content area of a browser, the button of a window? -children option of xwininfo can only get the location of children windows, not components.
My understanding is that modern toolkits (like GTK+, Qt) do not necessarily back every component with an X11 window, but I find it hard to find a definite source for this claim. If the components, or widgets, are not backed by X11 windows, xwininfo will not be able to determine their location.
For example, GTK+ used to interpret the environment variable GDK_NATIVE_WINDOWS to mean that every GdkWindow (corresponding to every widget) should have a native window, but this was only for compatability with some applications that would not work otherwise. This feature has since been removed (https://mail.gnome.org/archives/commits-list/2011-March/msg03590.html). Gtk+/Gdk now has gtk_ensure_native_window(), but if not enabled explicitly by the programmer, it seems that Gdk will not back the widgets by X11 windows and therefore xwininfo will not be able to pick up the location of these.
It seems that there may be alternatives for specific toolkits though. For example, GTK+ has gtkparasite which might be able to give you the information on specific components, but this will only work for GTK+ applications.

Windows 8.1 - Possible to change tile colour?

Since upgrading to Windows 8.1 from Windows 8 I've noticed the colour of the tiles looks awful, is there a way to change these that is...
Free
Doesn't involve hacking around with registry/XML files
As you can see below my GIT icons are barely visible :(
I don't have a non XML Solution, but the XML solution is quite easy to follow and could easily be converted into a tool.
For example to change the background of the GIT Bash tile:
the shorcut of the tile links to something like: "C:\Program Files (x86)\Git\bin\sh.exe" --login -i (to find the shortcut: right click -> goto location)
Go to the folder of the executable (here C:\Program Files (x86)\Git\bin)
Create a sh.visualelementsmanifest.xml with the content:
<Application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<VisualElements
BackgroundColor="maroon"
ShowNameOnSquare150x150Logo="on"
ForegroundText="light"/>
</Application>
(full spec at http://msdn.microsoft.com/en-us/library/windows/apps/dn393983.aspx)
Update the shorcut file time stamp (e.g. copy file, delete old file)
Enjoy new tile. For example:
In reference to Xyroid's answer which has - so far - received no points, maybe this is because the link has changed / gone.
OblyTile, for those who want a GUI to manage Tile design, works perfectly on my Windows 8.1
The link to this is:
http://forum.xda-developers.com/showthread.php?t=1899865
In particular, the developer has provided much improved icons for some internal windows apps (e.g. Control Panel) where the standard tile doesn't really match the design of the other Modern App tiles.
(I would have just added a comment, but I still need more reputation)!
According to Desktop App Tiles on the Start Screen, the background color of desktop app's Start menu tile is derived from the user's chosen background color, so try changing Start menu's background color.
Also checkout
How to customize tiles (change/bigger icon, change color) for desktop applications in the Start Screen?
How to Create Custom Windows 8 Tile Icons for Any Desktop Program

Resources