Cherrypicked https://github.com/aepirli/Muzei-Bash/commit/f379d2378a3d93ff7f918bf9c46756c8fd732b63