From Marc Jauvin, 1 Year ago, written in Plain Text.
Embed
  1. #!/usr/bin/env python3
  2.  
  3. import os, sys
  4.  
  5. if __name__ == '__main__':
  6.     if 'QUTE_FIFO' in os.environ:
  7.         fifo = open(os.environ.get('QUTE_FIFO'), 'w')
  8.         for k,v in os.environ.items():
  9.             if k.startswith('QUTE_'):
  10.                 fifo.write("""message-info '{} = [{}]'\n""".format(k,v))
  11.                 sys.stdout.write('\n{} = [{}]'.format(k,v))
  12.     sys.exit(0)
  13.  
  14. ---------------
  15.  
  16. It's called by the mapping: bind <key> spawn --userscript --output myscript.py