Liupold / pidswallow

A swallower script using process hierarchy.
Apache License 2.0
43 stars 0 forks source link

Allow flags in any order #26

Closed SeerLite closed 4 years ago

SeerLite commented 4 years ago

So, for example pidswallow -Vgl has the same behavior as pidswallow -lgV. This has the drawback of only allowing 1 action per invocation, but I think that's how it should work. I already have something kind of prepared for this but I'm not sure how to handle return values.

Thoughts on this?

Liupold commented 4 years ago

Here is a idea we can have to_swallow, to_vomit, to_toggle. Which will be list of WID. We can add them using flags and do the operation all at once. (Seems better to me).

Liupold commented 4 years ago

For example you can see: https://github.com/liupold/dls

SeerLite commented 4 years ago

Huh that's a really great idea! I'll see what I can do

SeerLite commented 4 years ago

How should --loop be handled, though? Shouldn't it ignore all other actions and go straight to loop mode? I can't see a scenario where I'd combine --loop with other action flags.

Liupold commented 4 years ago

Swallow what is in to_swallow toggle what is in to_toggle vomit what's in to_vomit then check if loop is passed (flag) if so run the loop.

If I run

pidswallow -t WID -v WID -s WID #this will do nothing 
pidswallow -t WID -s WID #this will vomit the window 

OR we can just use a pre action case, (similar case statement to before but just set '-V/-g' this will make more sense.

pidswallow -t WID -v WID -s WID #this will swallow
pidswallow -t WID -s WID #this will swallow 
Liupold commented 4 years ago

check this out: https://github.com/Liupold/pidswallow/tree/ordered-flag-pre-check