wmutils / core

Set of window manipulation tools
Other
714 stars 33 forks source link

Wattr now print the override and map results #16

Closed wbrbr closed 9 years ago

wbrbr commented 9 years ago

The o and m options weren't printing anything so I changed the code, and now it works (on my computer at least). Why were you using a goto end with the o and m options and not the others ?

ndem0 commented 9 years ago

I think "mapped" and "ignored" option was working, but they don't produce any output. It is userful use that option like this "wattr o $(pfw) && echo 'ignored' " or similar. Anyway, yeah, i don't like so much this implementation.

wbrbr commented 9 years ago

I think "mapped" and "ignored" option was working

I think you're right, but I don't understand why this would be better than simply output the result.

z3bra commented 9 years ago

The o and m switches are meant to return wether a window is ignored or not, and mapped or not. These are binary answers, and thus we chose to use the return code instead of simy printing 1 or 0 (or should it print yes/no, ignored/not ignored, true/false, ..?)

It is simpler to do

wattr -o $wid && killw $wid

rather than

if "$(wattr -o $wid)" = "1"
then
    killw $wid
fi

I don't close the pull request yet. But rigth now, I'm not favorable to it. I just let this thread open for discussion.

wbrbr commented 9 years ago

All the others wattr commands print something, so as it didn't print anything I thought it wasn't working. You should write something in the README to explain why it doesn't print anything, that will make things clearer :)

dcat commented 9 years ago

the use-case for this is described as the first entry of the examples section of the man-page.

it has nothing to do in the README.

Vibex commented 9 years ago

Yeah it's on the man page. I was confused at first to, but RTFM. ;)

wbrbr commented 9 years ago

My mistake, I didn't see it was in the man. Well, even if I prefer the if... then... fi pattern I think it may not be a good idea to change wattr behaviour because it would break all the scripts already written. So I think I'll close this request unless someone has an objection. Sorry for not having RTFM enough :-1:

dcat commented 9 years ago

that's okay, but next time remember to read the man page first.