Advertisement
Guest User

My Code

a guest
Jan 14th, 2021
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.94 KB | None | 0 0
  1. #! /usr/bin/python
  2.  
  3. import gi
  4. import subprocess
  5. gi.require_version("Gtk", "3.0")
  6. from gi.repository import Gtk, GLib
  7.  
  8.  
  9. class EntryWindow(Gtk.Window):
  10.     def __init__(self):
  11.         Gtk.Window.__init__(self, title="Notejot Input")
  12.         self.set_size_request(300, 100)
  13.         self.set_decorated(False)
  14.         self.timeout_id = None
  15.  
  16.         vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=3)
  17.         self.add(vbox)
  18.  
  19.         self.entry = Gtk.Entry()
  20.         self.entry.set_placeholder_text("Add to 'Notejot'...")
  21.         vbox.pack_start(self.entry, True, True, 0)
  22.         self.set_focus(self.entry)
  23.    
  24.  
  25. def f(text,ddd):
  26.     #return subprocess.run("~/Scripts/notejot-add.sh "+str(text),shell=True)
  27.     return subprocess.run("echo hmm",shell=True)
  28.  
  29. win = EntryWindow()
  30. x = str(win.entry.get_text())
  31. win.entry.connect('activate', f, str(win.entry.get_text()))
  32. win.connect("destroy", Gtk.main_quit)
  33. win.show_all()
  34. Gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement