Transpiled version (11018L) is out of date.
1 | !7 |
2 | |
3 | cm CropAndJPEGify > DynPrintLogAndEnabled { |
4 | transient FileWatchService watchService; |
5 | transient ReliableSingleThread_Multi<File> rst = dm_rstMulti(me(), lambda1 processFile); |
6 | switchable int width = 1280; // width of right monitor in fact |
7 | switchable bool left; |
8 | |
9 | start { |
10 | ownResource(watchService = new FileWatchService); |
11 | File dir = desktopDir(); |
12 | |
13 | watchService.addListener(dir, f -> rst.add(f), |
14 | jdk_watchService_allEventKinds()); |
15 | |
16 | print("Watching " + dir); |
17 | } |
18 | |
19 | void processFile(File f) { |
20 | if (!enabled) ret; |
21 | if (!fileExtensionIs(f, ".png")) ret; |
22 | if (contains(fileName(f), "uncropped") |
23 | || fileExists(appendToBaseFileName(f, ".uncropped"))) |
24 | ret; |
25 | sleepSeconds(1); // allow file to settle |
26 | if (!fileExists(f)) ret; |
27 | if (left) |
28 | cropToLeftScreenInPlace(f, screenWidth(0)); |
29 | else |
30 | cropToRightScreenInPlace(f, width); |
31 | jpegify(f); |
32 | } |
33 | } |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033110 |
Snippet name: | Crop & JPEGify new screenshots [probably works for Stefan only] |
Eternal ID of this version: | #1033110/10 |
Text MD5: | f5a4dc0ae153e8b362e67ef6af572174 |
Author: | stefan |
Category: | javax / stefan's os |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-31 02:40:35 |
Source code size: | 924 bytes / 33 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 182 / 723 |
Version history: | 9 change(s) |
Referenced in: | [show references] |