salman-abedin / devour

X11 window swallower
GNU General Public License v2.0
419 stars 30 forks source link

Remove the creation of an unnecessary sub-shell to improve performance #12

Closed durcor closed 4 years ago

durcor commented 4 years ago

While using devour, I realized it was performing somewhat slower than it should, so I looked at its code and saw that it creates a sub-shell using the user's pre-defined $SHELL. Devour is not run interactively, so I do not see why xdo has to be called within its own shell, as this might cause devour to operate less efficiently than if it were to only be run within a single instance of a POSIX-compliant shell, especially if the user is using a slower shell like fish or they are using zsh or bash with a lot of plugins. Thanks for this cool utility by the way!

salman-abedin commented 4 years ago

The sub shell is serving the purpose of supporting your respective shell aliases. However, you have a point on running the xdo commands outside the interactive shell . Should have noticed it. Thanks for pointing it out. Adding you as a contributor.

durcor commented 4 years ago

Ah, I tend to use zsh's global aliases which would still work in this case, but I definitely see how the sub-shell is necessary for other shells and other types of aliases. Thanks!