Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # run python3 ~/.bin/add_item_gtk3.py after exiting sxiv
- import gi
- gi.require_version('Gtk', '3.0')
- from gi.repository import GLib, Gtk
- f = open('/tmp/sxiv-marked')
- recent_mgr = Gtk.RecentManager.get_default()
- for files in f:
- line = r'file://'+str(files)
- line = ('%r' % line)[1:-3]
- recent_mgr.add_item(line)
- GLib.idle_add(Gtk.main_quit)
- Gtk.main()
- f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement