Skip to content

Commit

Permalink
getcutout add an argument for outputting
Browse files Browse the repository at this point in the history
  • Loading branch information
FakeShell committed Jul 14, 2023
1 parent 696d03a commit e1b8b6b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions getcutout/50-notch.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Service]
Environment=G_RESOURCE_OVERLAYS=/org/gnome/gmobile/devices/display-panels=/var/lib/droidian/phosh-notch
7 changes: 6 additions & 1 deletion getcutout/getcutout.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@
import json
import fnmatch
import subprocess
import argparse
from svg.path import Path, Line, Arc, CubicBezier, QuadraticBezier, parse_path

parser = argparse.ArgumentParser(description="Create JSON representation of device cutouts and border radius.")
parser.add_argument("-o", "--output", required=True, help="Path to the output JSON file")
args = parser.parse_args()

if os.getuid() != 0:
print("must run as root, exiting")
sys.exit(1)
Expand Down Expand Up @@ -169,7 +174,7 @@ def find_apk_with_properties(root_dir):
if cutout is not None:
json_obj["cutouts"] = [{"name": "notch", "path": cutout}]

with open('output.json', 'w') as json_file:
with open(args.output, 'w') as json_file:
json.dump(json_obj, json_file, indent=4)

else:
Expand Down
2 changes: 1 addition & 1 deletion getcutout/minui-getres.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
//Copyright (C) 2023 Bardia Moshiri <[email protected]>
// Copyright (C) 2023 Bardia Moshiri <[email protected]>

#include <stdio.h>
#include <minui/minui.h>
Expand Down

0 comments on commit e1b8b6b

Please sign in to comment.