添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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.

Rather than assuming that it's a gtk/qt problem, why don't you tell us more about your specific problem. Edit your question to include some screenshots. Cheers, Al heynnema Oct 22, 2016 at 0:15 You might make use of ldd to see which dynamic libraries the binary links: for example ldd $(which evince) | grep 'gtk\|qt' steeldriver Oct 22, 2016 at 0:36 Actually, Qt applications have uppercase letters so you would grep for 'gtk\|Qt' . Since libraries can be load at runtime, it might be more reliable to just start the program and inspect paths to the mapped files using pmap -p $pid | grep 'gtk|Qt' Lekensteyn Oct 22, 2016 at 9:51

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).

with variable: INSERT_APP_NAME_HERE="gnome-disks"; ldd "$(readlink -f "$(type -p $INSERT_APP_NAME_HERE)")" | grep -Poi '\b(lib)?\K(gtk|qt|tk)([^a-z/]*\d)*(?=[^/]*\.so\b)' | sort -u ..the xprop window clicker is pretty cool. – alchemy Sep 16, 2022 at 3:24