Liupold/pidswallow

Allow flags in any order

SeerLite opened this issue · 6 comments

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?

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).

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

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

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.

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