Skip to content

Instantly share code, notes, and snippets.

@tanyuan
Created July 6, 2017 19:21
Show Gist options
  • Save tanyuan/58ff6ff16cb592ee3dc2fd9fe867fc00 to your computer and use it in GitHub Desktop.
Save tanyuan/58ff6ff16cb592ee3dc2fd9fe867fc00 to your computer and use it in GitHub Desktop.
GNOME Files (Nautilus) Python extension simple info bar example. Put in ~/.local/share/nautilus-python/extensions/
from gi.repository import Gtk, Nautilus, GObject
class LocationProviderExample(GObject.GObject, Nautilus.LocationWidgetProvider):
def __init__(self):
pass
def get_widget(self, uri, window):
vb = Gtk.VBox()
bar = Gtk.InfoBar()
vb.pack_start(bar, False, False, 0)
bar.set_message_type(Gtk.MessageType.INFO)
bar.get_content_area().pack_start(
Gtk.Label(uri),
False, False, 0)
vb.show_all()
return vb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment