Created
August 25, 2019 16:51
-
-
Save ssokolow/5b59998d2245325758ac9bbf462605c2 to your computer and use it in GitHub Desktop.
Helper script to override Firefox's attempt to open .cbz files as Zip files, regardless of OS file associations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# NOTE: Despite this script using KDE commands like ark and kdialog, Firefox | |
# doesn't obey KDE's file associations, so you'll need to use a non-KDE | |
# file manager like PCManFM to edit the file associations. | |
open_zip() { | |
exec ark "$@" | |
} | |
offer_comix() { | |
if kdialog --yesno 'File appears to be a Comic Book Archive\nOpen in Comix instead?'; then | |
exec comix "$@" | |
else | |
open_zip "$@" | |
fi | |
} | |
case "$1" in | |
(*.[cC][bB][zZ]) offer_comix "$@";; | |
*) open_zip "$@";; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment