ziberna / i3-py Goto Github PK
View Code? Open in Web Editor NEWPython based tools for i3 users and developers
Python based tools for i3 users and developers
I'd like to listen to window events
i3.subscribe('window', 'new', lambda: print('new window'))
but I get
i3.EventTypeError: Event type 'window' isn't available
Please add support for window events.
i3.exec(...) is taken as an error by python interpreter
>>> import i3
>>> i3.filter(focused=True)
[]
>>>
i3-py version: 0.6.4
Hi, I suggest splitting the repo into two, i3-py, which has the library code in it, and i3-py-examples for the examples. Pip only installes the library, which is fine. Most people will want their custom scripts using it in something like ~/.config/i3/contrib or so, so it would be great if they could just clone the example repo into that folder.
When running a simple python3 test, using:
def my_function(event, data, subscription):
...
subscription = i3.Subscription(my_function, 'workspace')
Then the event thread crashes when visiting (mod-<1..0>) certain invisible workspaces. Not all invisible workspaces cause a crash:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.3/threading.py", line 637, in _bootstrap_inner
self.run()
File "/usr/lib/python3.3/site-packages/i3.py", line 324, in run
self.listen()
File "/usr/lib/python3.3/site-packages/i3.py", line 338, in listen
event = self.event_socket.receive()
File "/usr/lib/python3.3/site-packages/i3.py", line 218, in receive
return self.unpack(data)
File "/usr/lib/python3.3/site-packages/i3.py", line 248, in unpack
payload = data[self.struct_header_size:msg_size].decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 992: invalid start byte
If you stumbled upon this repo like I did, the i3 website claims this project is no longer maintained. Besides the last commit was 6 years ago.
i3ipc is maintained and current: https://github.com/acrisci/i3ipc-python
i3 itself uses the BSD 3-clause license.
You should also consider Unlicense.
The latest version of i3-py in PyPi is 0.6.4, while the 0.6.5 version seems to have been already released but still missing there: https://pypi.python.org/pypi/i3-py/
Thanks!
i3
module is not able to support traditional ways of accessing documentation and exploring the module.
For example, pydoc i3
gives this traceback:
Traceback (most recent call last):
File "/usr/bin/pydoc", line 5, in <module>
pydoc.cli()
File "/usr/lib64/python2.7/pydoc.py", line 2361, in cli
help.help(arg)
File "/usr/lib64/python2.7/pydoc.py", line 1829, in help
elif request: doc(request, 'Help on %s:')
File "/usr/lib64/python2.7/pydoc.py", line 1568, in doc
pager(render_doc(thing, title, forceload))
File "/usr/lib64/python2.7/pydoc.py", line 1563, in render_doc
return title % desc + '\n\n' + text.document(object, name)
File "/usr/lib64/python2.7/pydoc.py", line 357, in document
if inspect.ismodule(object): return self.docmodule(*args)
File "/usr/lib64/python2.7/pydoc.py", line 1111, in docmodule
for importer, modname, ispkg in pkgutil.iter_modules(object.__path__):
File "/usr/lib64/python2.7/pkgutil.py", line 143, in iter_modules
importers = map(get_importer, path)
TypeError: argument 2 to map() must support iteration
Also, the module object cannot iterate its members:
$ python
Python 2.7.8 (default, Nov 10 2014, 08:19:18)
[GCC 4.9.2 20141101 (Red Hat 4.9.2-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import i3
>>> dir(i3)
['__module__', '__name__']
>>>
which has also the effect that tab completion does not work in smart python shells like IPython.
I think this is caused by the fact that the module object is somehow assembled on the fly but does not support all necessary methods.
(I may be looking into this and come up with more specifics or even a PR ... if I have time, which I can't promise now :/)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.