Uses 911K of libraries. Click here for Pure Java version (9638L/49K).
1 | !7 |
2 | |
3 | cmodule ELESystemWindows > ELESuggester { |
4 | start { |
5 | dm_onUserUtterance(lambda1 processUtterance); |
6 | } |
7 | |
8 | void processUtterance(S s) { |
9 | print("Got input: " + s); |
10 | |
11 | if (dm_moduleIsPoppedOut()) { |
12 | if (l(suggestions) == 1) { |
13 | S id = squareBracketStuff(first(suggestions)); |
14 | if "activate" { |
15 | print("Activating window " + first(suggestions); |
16 | activateSystemWindow(wmctrl_EntryFromID(id)); |
17 | ret; |
18 | } |
19 | if "close" { |
20 | dm_confirmAction("Close window " + quote(afterSquareBracketStuff(first(suggestions))), rEnter { |
21 | dm_closeSystemWindow(wmctrl_EntryFromID(id)); |
22 | }); |
23 | ret; |
24 | } |
25 | } else if (l(suggestions) > 1) { |
26 | print("Filtering for: " + s); |
27 | LS l = containingIC(suggestions, s); |
28 | if (nempty(l)) showSuggestions(s, l); |
29 | ret; |
30 | } |
31 | } |
32 | |
33 | if "system windows" { |
34 | print("Showing suggestions and popping out"); |
35 | showSuggestions(s, map(dm_windows(), w -> |
36 | "[" + w.windowIdentity + "] " + w.windowTitle)); |
37 | dm_popOutAndActivateModule(module()); |
38 | assertEquals(dm_current_mandatory(), module()); |
39 | } |
40 | } |
41 | } |
Began life as a copy of #1026661
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1026771 |
Snippet name: | ELE: System Windows |
Eternal ID of this version: | #1026771/23 |
Text MD5: | 9b3df60e63efa59f2b52f7f284bfb345 |
Transpilation MD5: | faf782014883b1106adf6b6793163659 |
Author: | stefan |
Category: | javax / ele |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-01-22 02:08:09 |
Source code size: | 1223 bytes / 41 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 242 / 5282 |
Version history: | 22 change(s) |
Referenced in: | [show references] |