Stack Exchange Network
Stack Exchange network consists of 183 Q&A communities including
Stack Overflow
, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this community
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Previously, my laptop used Ubuntu 14.04 without trouble, but after passing to Ubuntu 16.04 (not upgrading, but formatting), I've some rendering problems. Since I cannot put here specific details because I don't know what is exactly happening, I'm searcher for the error yet.
My current assumption is that, the rendering issues are only affecting gtk applications (for example, some PDF images are being rendering poorly in
evince
, but not in
Okular
).
What I want to know if there's a way to know, in the easiest way as possible, if an application is a gtk or Qt one, to open different applications, see which shows bad rendering, and which library has been use to build that software.
–
–
–
An application can use Qt and Tk and Gtk (despite this is generally -
but not always
- a very bad practice).
So the only way is to start the app and examine
pmap
output using app's pid, as Lekensteyn proposed in the comment.
As pointed out in the comments, you
could
use
ldd
to list the libraries used by a binary program. Here, we also filter the list for toolkits
gtk
,
qt
, and
tk
including their version numbers:
ldd "$(readlink -f "$(type -p INSERT-APP-NAME-HERE)")" |
grep -Poi '\b(lib)?\K(gtk|qt|tk)([^a-z/]*\d)*(?=[^/]*\.so\b)' | sort -u
However, this will not work if the program is a script file (for instance a python or perl program) or uses a script/program to start the actual binary. The latter is pretty common, for instance firefox
and libreoffice
use a starter script. In that case, you can inspect the starter manually to find out the path of the actual program. But even then, the output of ldd
may not be complete. At least for Firefox 90, the list printed by ldd
is missing nearly all of Firefox' dependencies.
Therefore, it may be easier and safer to start the program, run the following script, and then click on the window for which you want to know the toolkit:
grep -Poi '\b(lib)?\K(gtk|qt|tk)([^a-z/]*\d)*(?=[^/]*\.so\b)' \
/proc/"$(xprop _NET_WM_PID | cut -d' ' -f3)"/maps | sort -u
Although this might fail if xprop
cannot find the PID of the clicked window. In that case, you can replace $(xprop ...)
by something like $(pgrep -o INSERT-APP-NAME-HERE)
.
–