diff --git a/README.md b/README.md index d881ff1..d84a0e5 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ requests. - [Uninstall](#uninstall) - [Fonts](#fonts) - [Colors](#colors) + - [Images](#images) - [Testing Without Rebooting](#testing-without-rebooting) - [What does Matter do to my system files?](#what-does-matter-do-to-my-system-files) @@ -154,6 +155,19 @@ the syntax: ./matter.py -hl FFC107 -fg white -bg 2196f3 -ic pink ``` +## Images (unfinished) + +You can specify a background image with `--image/-im`, the supported image +formats/extensions are PNG, JPG, JPEG, and TGA. This feature is considered +*unfinished* because it does not yet work as well as it could *(see +[#57](https://github.com/mateosss/matter/pull/57))* + +Here is an example of the syntax: + +```sh +./matter.py -im ~/Pictures/some-cool-image-that-has-good-contrast-with-my-text-color.png +``` + ## Testing Without Rebooting If you install the `pip` package diff --git a/matter.py b/matter.py index c9d0de6..e08c1ee 100755 --- a/matter.py +++ b/matter.py @@ -23,6 +23,7 @@ # Logging utils + def color_string(string, fg=None): COLORS = { # List some colors that may be needed "red": "\033[31m", @@ -323,11 +324,9 @@ def prepare_source_dir(): # Image checks if image: if not exists(image): - error( - f"{image} does not exist!") - if os.path.splitext(image)[1] not in ('.png', '.tga', '.jpg', '.jpeg'): - error( - f"Background image must be one of .png, .tga, .jpg or .jpeg formats.") + error(f"{image} does not exist") + if os.path.splitext(image)[1] not in (".png", ".tga", ".jpg", ".jpeg"): + error(f"Background image must be one of .png, .tga, .jpg or .jpeg formats.") image_name = basename(image) copyfile(image, f"{INSTALLATION_SOURCE_DIR}/{image_name}") if background: @@ -632,6 +631,7 @@ def do_set_icons(): f"{GRUB_MKCONFIG_PATH} succesfully patched, icons will now persist between grub updates." ) + def install_hookcheck(): info(f"Create hook check script") with open(HOOKCHECK_TEMPLATE_PATH, "r", newline="") as f: @@ -737,7 +737,7 @@ def parse_args(): "--image", "-im", type=str, - help=f"image file to use as background", + help=f"image file to use as background, supported extensions: PNG, JPG, JPEG, TGA", ) parser.add_argument( "--iconcolor",