30 lines
912 B
Python
30 lines
912 B
Python
|
#! /usr/bin/env nix-shell
|
||
|
#! nix-shell /etc/nixos/scripts/nix/python.nix -i python
|
||
|
|
||
|
import argparse
|
||
|
|
||
|
from common.common import does_desktop_entry_exist # type: ignore
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
parser = argparse.ArgumentParser(
|
||
|
prog="does-desktop-entry-exist.py",
|
||
|
description="Check if a desktop entry exists.",
|
||
|
epilog="Example usage: does-desktop-entry-exist.py org.kde.konsole",
|
||
|
)
|
||
|
parser.add_argument(
|
||
|
"desktop_entry",
|
||
|
help="The desktop entry to check for.",
|
||
|
)
|
||
|
parser.add_argument(
|
||
|
"-v",
|
||
|
"--verbose",
|
||
|
help="Prints all of the paths that will be checked by the script. Exists so NixOS users don't get their terminals flooded when running the script.",
|
||
|
action="store_true",
|
||
|
)
|
||
|
|
||
|
args = parser.parse_args()
|
||
|
|
||
|
does_desktop_entry_exist(
|
||
|
desktop_entry=args.desktop_entry, show_all_paths=args.verbose
|
||
|
)
|