如何知道AppIndicator提供了哪些图标?
How to know which icons are provided by AppIndicator?
我正在使用 AppIndicator
和 AppIndicator3
(来自 gi.repository
)中的一些图标,例如 gsm-3g-full 和 gsm-3g-none.
如何知道还有哪些其他图标可用?似乎没有太多关于它的文档。 This tutorial 根本没有提到 AppIndicator。
编辑:我正在寻找图标的图片,但如果这不可能,即使知道图标的名称也会非常有用。
来自 this question on AU 的已接受答案:
import gtk
icon_theme = gtk.icon_theme_get_default()
print icon_theme.list_icons()
这会生成所有图标名称的元组:('input-gaming', 'gnome-aorta', 'stock_bottom', 'config-language', ...)
要可视化图标,我们可以使用命令 gtk3-icon-browser
,它由 Ubuntu 上的包 libgtk-3-dev
和 Fedora 上的 gtk3-devel
提供。
Ubuntu 20.04 更新
套餐更改为:gtk-3-examples
如果使用 gi
中推荐的现代绑定而不是弃用的 gtk
,则语法略有不同::
from gi.repository import Gtk
theme = Gtk.IconTheme.get_default()
for icon in theme.list_icons(None): # None as context lists all icons
print(icon)
我正在使用 AppIndicator
和 AppIndicator3
(来自 gi.repository
)中的一些图标,例如 gsm-3g-full 和 gsm-3g-none.
如何知道还有哪些其他图标可用?似乎没有太多关于它的文档。 This tutorial 根本没有提到 AppIndicator。
编辑:我正在寻找图标的图片,但如果这不可能,即使知道图标的名称也会非常有用。
来自 this question on AU 的已接受答案:
import gtk
icon_theme = gtk.icon_theme_get_default()
print icon_theme.list_icons()
这会生成所有图标名称的元组:('input-gaming', 'gnome-aorta', 'stock_bottom', 'config-language', ...)
要可视化图标,我们可以使用命令 gtk3-icon-browser
,它由 Ubuntu 上的包 libgtk-3-dev
和 Fedora 上的 gtk3-devel
提供。
Ubuntu 20.04 更新
套餐更改为:gtk-3-examples
如果使用 gi
中推荐的现代绑定而不是弃用的 gtk
,则语法略有不同::
from gi.repository import Gtk
theme = Gtk.IconTheme.get_default()
for icon in theme.list_icons(None): # None as context lists all icons
print(icon)