wmutils / contrib

Useful bits and pieces
Other
93 stars 16 forks source link

groups.sh now keeps its files clean #7

Closed greduan closed 9 years ago

greduan commented 9 years ago

Spent some time refactoring the keeping track of the files and the cleanup. I've done some initial testing and it seems to work fine.

Please do some testing of your own as well. :)

Added -C option which gives the user access to the cleanup stuff. The script won't know about a WID that's no longer active until the script is run somehow, this runs the cleanup stuff so you can use it right after killing a window, for example.

The cleanup stuff when run now deletes all the WIDs that no longer exist, removes all the empty group.*, and keeps the active, inactive and all files clean of groups that don't exist.

Again, it works in initial testing but needs some extended testing to make sure. :)

greduan commented 9 years ago

Just did some more testing. It seems that sometimes it doesn't cleanup killed WIDs properly. Not sure why. I guess wattr isn't telling it that it doesn't exist anymore? Sometimes it does, sometimes it doesn't...

If a WID still exists, it means it won't be deleted from the group file. If the last WID isn't removed from a group file it won't be deleted (as it isn't empty). If the file is not removed then it won't be deleted from the active, inactive and all files.

@z3bratabs Could you check? :)