HarveyHunt / i3situation

A replacement for i3status written in Python 3 with support for huge customisability through plugins.
GNU General Public License v3.0
34 stars 5 forks source link

Click events not working on text and date plugins #11

Closed ViktorNova closed 9 years ago

ViktorNova commented 10 years ago

Hello! I just installed i3situation-git from AUR and have the following in my config, mostly just pasted straight from the from the readme page

[general]
interval = 1
logging_level = ERROR
log_file = ~/.config/i3situation/log.txt
colors = true

[start]
plugin = text
text=Start
button1 = menu-standalone

[my_time_plugin]
plugin = date_time
interval = 1
button1 = xterm
button2 = xterm
button3 = xterm

The bar displays just fine, but the commands are not being launched when I click the text on the text or the date/time, and nothing is being generated in the log when I click either. Did I miss something here?

HarveyHunt commented 10 years ago

I just gave this a try using the AUR package and click events were working for me.

Would you mind pasting your log file (perhaps put it on pastebin or something similar)?

ViktorNova commented 10 years ago

The log file is actually completely empty.. very odd. I am using the latest i3 from community

HarveyHunt commented 10 years ago

That is strange that the log file is empty.

Could you please delete /usr/lib/python3.x/site-packages/i3situation* and then reinstall the package from the AUR?

ViktorNova commented 10 years ago

Ok I did that, still no click events and an empty log file. I put some bogus text in the config just to generate an error and verify that the log is actually working, and it is: http://slexy.org/view/s2pg3Se9Sz

I have a top and bottom bar, and dual monitors.. will gladly run more tests if you can think of anything

HarveyHunt commented 10 years ago

I think I have solved it. If a command that is called by a button click event doesn't exist, it crashes the event handler thread and so no more click events are handled.

I will write a quick fix for this tomorrow. In the mean time, make sure that menu-standalone actually exists in /usr/bin or /bin.

If menu-standalone is a script, make sure you have the full path to it, such as /home/harvey/menu-standalone and that it is executable.

ViktorNova commented 10 years ago

Thanks for the tip - still no dice though!

To help narrow it down, I changed my config to just this:

[general]                                                                                                                        
interval = 1                                                                                                                     
logging_level = ERROR                                                                                                            
log_file = ~/.config/i3situation/log.txt                                                                                         
colors = true                                                                                                                    

[my_time_plugin]                                                                                                                 
plugin = date_time                                                                                                               
interval = 1                                                                                                                     
button1 = xterm                                                                                                                  
button2 = xterm                                                                                                                  
button3 = xterm 

then did sudo rm -rf /usr/lib/python3.4/site-packages/i3situation* again, then reinstalled from AUR

Xterm is still not launching when I click the date/time, and no log is being generated still! Weird. Could there be some library I'm missing that's maybe not listed as a dependency..or something?

Side question - does i3situation use the user's $PATH environment variable, or do you have to give an absolute path to anything not in /usr/bin or /bin?

HarveyHunt commented 10 years ago

This is very strange.

I have copied and pasted your config and it works fine for me...

What version of i3bar are you using?

Could you please set your logging level to DEBUG, try to launch a click event again and then send me the log file?

Edit: i3situation uses the $PATH variable as it relies on python's built in subprocess module.

ViktorNova commented 10 years ago

i3bar reports version 4.8 (2014-06-15, branch "4.8")

I changed the logging to DEBUG and got some more output in the log, but nothing appeared when I clicked on the bar.. =( http://slexy.org/raw/s2yPAofCxT

So weird!

ViktorNova commented 9 years ago

So I left this one alone for a month and a half, updated my whole system (including i3-git and i3situation) and now it works! I'm not sure why is wasn't working before or why the log didn't catch it, but it is now working as expected and it rocks

it's so awesome to finally have launchers on i3bar! Seriously I tried so many other ones and this is the first one I got to work. Love the simplicity of it, and the fact that it's Python =D excellent work