generated from extratone/latte
-
Notifications
You must be signed in to change notification settings - Fork 2
/
BatLog.jelly
75 lines (71 loc) · 2.7 KB
/
BatLog.jelly
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import Shortcuts
#Color: Red, #Icon: walletPass
/*
BatLog
Copyright 2020 Lu Neder
This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or (at your option) any later version. The latest version of this license is in http://www.latex-project.org/lppl.txt and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later.
This work has the LPPL maintenance status `maintained'.
The Current Maintainer of this work is Lu Neder.
*/
var Input = ShortcutInput
text(text: "1.3") >> Versão
changeCase(text: Input) >> changeCase
var Mode = Texto Atualizado
createFolder(path: "BatLog") >> createFolder
date() >> date
text(text: "${Data}") >> Date
batteryLevel() >> batteryLevel
if(Mode == "CON") {
text(text: "${Date} - Connected to power, ${ActionOutput}% of battery") >> text
var Logline = Texto
} else {
if(Mode == "DIS") {
text(text: "${Date} - Power disconnected, ${ActionOutput}% of battery") >> text 1
var Logline = Texto
} else {
if(Mode == "PER") {
text(text: "${Date} - Battery at ${ActionOutput}%") >> text 2
var Logline = Texto
} else {
if(Mode == "LBON") {
text(text: "${Nível da Bateria} - Low power mode activated, battery at ${ActionOutput}%") >> text 3
var Logline = Texto
} else {
if(Mode == "LBOFF") {
text(text: "${Date} - Low power mode disabled, battery at ${ActionOutput}%") >> text 4
var Logline = Texto
} else {
text(text: "${Date} - Battery at ${ActionOutput}%") >> text 5
var Logline = Texto
text(text: "${Logline}") >> text 6
prependFile(path: "BatLog/BatLog.txt") >> prependFile
getFile(picker: false, path: "BatLog/BatLog.txt", error: true) >> getFile
quicklook(input: Arquivo)
output(result: "${Arquivo}") >> output
}
}
} >> IFResult
} >> IFResult 1
} >> IFResult 2
text(text: "${Logline}") >> text 7
prependFile(path: "BatLog/BatLog.txt") >> prependFile 1
// Uptater start
getIP() >> getIP
count(type: Characters, input: Endereço IP Atual) >> count
if(Contagem !=) {
downloadURL(url: "https://routinehub.co/api/v1/shortcuts/7466/versions/latest") >> downloadURL
getDictionaryFrom(input: Conteúdos do URL) >> getDictionaryFrom
keysFrom(dictionary: Dicionário) >> keysFrom
text(text: "${Valor do Dicionário}") >> text 8
if(Texto == ""${Versão}"") {
nothing()
} else {
text(text: "${Dicionário.key(id)}") >> text 9
text(text: "${Dicionário.key(Notes)}") >> text 10
sendNotification(body: "Please update from ${Texto} to ${ActionOutput}
Visit https://routinehub.co/shortcut/7466/ in order to update", title: "A new BatLog update is available", attachment: Texto) >> sendNotification
}
} else {
nothing()
} >> IFResult 3
// Updater end