diff options
| author | kkard2 <[email protected]> | 2023-07-10 19:16:04 +0200 |
|---|---|---|
| committer | kkard2 <[email protected]> | 2023-07-10 19:16:04 +0200 |
| commit | 371cac99ca01b74cfe7b164c6d39c7ab626a1e48 (patch) | |
| tree | 6f2eb33a298ecd16fdf7da4431393eff01987320 | |
| parent | 94ca8ceedef0e27f7b9314d2aa042c6d7df8f753 (diff) | |
update_from_assets.py
| -rw-r--r-- | espanso/match/img.yml | 30 | ||||
| -rw-r--r-- | espanso/update_from_assets.py | 20 |
2 files changed, 35 insertions, 15 deletions
diff --git a/espanso/match/img.yml b/espanso/match/img.yml index 47da2a8..45ffcdf 100644 --- a/espanso/match/img.yml +++ b/espanso/match/img.yml @@ -1,19 +1,19 @@ matches: - - trigger: ;;ipipe - image_path: "$CONFIG\\assets\\pipe.png" - - trigger: ;;ialert - image_path: "$CONFIG\\assets\\alert.png" - - trigger: ;;imiska - image_path: "$CONFIG\\assets\\kot_w_misce.png" - - trigger: ;;ikot - image_path: "$CONFIG\\assets\\kot.png" - - trigger: ;;iwifereaction - image_path: "$CONFIG\\assets\\my_wife_reaction_to_that_information.png" - trigger: ;;iahh - image_path: "$CONFIG\\assets\\ahh.png" + image_path: $CONFIG/assets/img/ahh.png + - trigger: ;;ialert + image_path: $CONFIG/assets/img/alert.png + - trigger: ;;iangry + image_path: $CONFIG/assets/img/angry.png - trigger: ;;ihuh - image_path: "$CONFIG\\assets\\huh.png" + image_path: $CONFIG/assets/img/huh.png + - trigger: ;;ikot + image_path: $CONFIG/assets/img/kot.png + - trigger: ;;ikot_w_misce + image_path: $CONFIG/assets/img/kot_w_misce.png + - trigger: ;;imy_wife_reaction_to_that_information + image_path: $CONFIG/assets/img/my_wife_reaction_to_that_information.png + - trigger: ;;ipipe + image_path: $CONFIG/assets/img/pipe.png - trigger: ;;irozpacz - image_path: "$CONFIG\\assets\\rozpacz.png" - - trigger: ;;iangry - image_path: "$CONFIG\\assets\\angry.png" + image_path: $CONFIG/assets/img/rozpacz.png diff --git a/espanso/update_from_assets.py b/espanso/update_from_assets.py new file mode 100644 index 0000000..e2b76d5 --- /dev/null +++ b/espanso/update_from_assets.py @@ -0,0 +1,20 @@ +import os + + +def generate(path, output_file, prefix): + files = [ + f for f in os.listdir(path) if os.path.isfile(os.path.join(path, f)) + ] + + with open(output_file, 'w') as f: + f.write('matches:\n') + + for file in files: + path_wo_ext = os.path.splitext(file)[0] + f.write(' - trigger: ;;' + prefix + path_wo_ext + '\n') + f.write( + ' image_path: $CONFIG/' + path + '/' + file + '\n') + + +if __name__ == '__main__': + generate('assets/img', 'match/img.yml', 'i') |
