-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfocus.jsx
43 lines (39 loc) · 846 Bytes
/
focus.jsx
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
import { config } from "./config.jsx";
export const command =
"~/Software/bar/scripts/get_process.sh /opt/homebrew/bin/yabai";
export const refreshFrequency = false;
export const style = {
...config,
paddingRight: "20px",
paddingLeft: "20px",
cursor: "default",
position: "fixed",
left: "50%",
transform: "translate(-50%)",
userSelect: "none",
overflow: "visible",
};
export const render = (output) => {
let windows, res;
try {
windows = JSON.parse(output.output).process;
res = `${windows[0].app} / ${windows[0].title}`;
} catch (e) {
console.log(e);
res = "";
}
if (res.length > 30) {
res = res.slice(0, 47) + "...";
}
return (
<div style={style}>
<span
style={{
color: "rgb(205, 205, 205)",
}}
>
{res}
</span>
</div>
);
};