jersou / mouse-actions

mouse-actions execute some command from mouse events such as clicks/wheel on the side/corners of the screen, or drawing shapes. It's a mix between Easystroke and Compiz edge commands.
MIT License
173 stars 7 forks source link

Command text entry is disabled #7

Closed izlence closed 1 year ago

izlence commented 1 year ago

I am a big fan of easystroke on Linux (Ubuntu). But unfortunately it's not updated. From time to time I encounter some issues with easystroke. For that reason I kept looking for alternatives. But found nothing satisfy me.

When I noticed mouse-actions developer is also easystroke user, I felt excited and wanted to try it.

The GUI starts normally but, I couldn't manage to enter "Command" in the text box. It looks like read-only. I can enter comment but not the command.

I tried it on Ubuntu 20.04 and also on Arch Linux. Both have the same problem.

What should I do?

image

pallaswept commented 1 year ago

The trick here is to edit the text inbetween the quotes and brackets. This field is exposing the raw content of the JSON configuration, so it forces you to maintain valid JSON formatting, meaning that the brackets and quotes are necessary. Also, if you want to run a command with multiple arguments, they need to be in separate values of the JSON array, so for example, a single command could be run by simply having ["mycommand"] in the Command box, but if you need multiple arguments, they should be separate array elements, so the formatting looks like ["mycommand","argument1","arg2"] Here's an example from my own config (which runs bash, with the -c argument to launch a new command, and the next argument is launching ydotool in a separate process to mouse-actions, to type 'Ctrl+C') - it's for copying stuff ["bash","-c","ydotool key 29:1 46:1 46:0 29:0"]

izlence commented 1 year ago

It works. Thank you. It would be nice if a hint appears when hovering the text box, though.

pallaswept commented 1 year ago

As you can see from my mention above, you're not the only one having trouble with this. It caught me and that guy and you and I imagine it catches just about everyone.

I think perhaps more than just a tooltip is in order, I think it needs a way to enter a command in an intuitive fashion - in other words, exactly like you'd type it into a shell and hit enter to make it happen - and then if the app needs it stored in some kind of format it should be translating it accordingly.

Probably not a super-high-priority kind of thing at this early alpha stage of this app, especially as it does 'work', the way it is right now, but I do think it would be a good goal to make it be intuitive and 'easy-mode' eventually.

jersou commented 1 year ago

ok, I comment the #5 before reading the current, my comment on the #5 :

I understand why this happens: currently, this field must always be a valid json, which is why it prevents intermediate entries. it's obviously not a good idea, and I need to change this behavior.

In the TODO section of the README, there is use https://crates.io/crates/deno_task_shell to execute commands ?, I'll see if it's not the right time to do it... With this library, we would no longer need to write an array of strings, just a single string.

I'll try to implement this quickly, it seems easier to fix than the higher priority bug (app crash on device) and this GUI bug is quite important too.

jersou commented 1 year ago

The v0.4.3 has just been released and fixes this bug : the input in the GUI edit a command line as string and no longer in JSON format.

pallaswept commented 1 year ago

Nice!!