Skip to content

Commit

Permalink
Format and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
AppScoreOli committed May 11, 2024
1 parent 58dd05f commit 83574ce
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
24 changes: 16 additions & 8 deletions lib/components/data/cpu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export const Widget = React.memo(() => {
const { displayIndex, settings } = useSimpleBarContext();
const { widgets, cpuWidgetOptions } = settings;
const { cpuWidget } = widgets;
const { refreshFrequency, showOnDisplay, displayAsGraph, cpuMonitorApp } = cpuWidgetOptions;
const { refreshFrequency, showOnDisplay, displayAsGraph, cpuMonitorApp } =
cpuWidgetOptions;

const visible =
Utils.isVisibleOnDisplay(displayIndex, showOnDisplay) && cpuWidget;
Expand Down Expand Up @@ -65,14 +66,21 @@ export const Widget = React.memo(() => {

const { usage } = state;

const onClick = cpuMonitorApp === "None" ? undefined : (e) => {
Utils.clickEffect(e);
openCpuUsageApp(cpuMonitorApp);
};
const onClick =
cpuMonitorApp === "None"
? undefined
: (e) => {
Utils.clickEffect(e);
openCpuUsageApp(cpuMonitorApp);
};

if (displayAsGraph) {
return (
<DataWidget.Widget classes="cpu cpu--graph" onClick={onClick} disableSlider>
<DataWidget.Widget
classes="cpu cpu--graph"
onClick={onClick}
disableSlider
>
<Graph
className="cpu__graph"
caption={{
Expand Down Expand Up @@ -104,8 +112,8 @@ function openCpuUsageApp(cpuUsageApp) {
case "Activity Monitor":
Uebersicht.run(`open -a "Activity Monitor"`);
break;
case "Top":
Utils.runInUserTerminal('top')
case "Top":
Utils.runInUserTerminal("top");
break;
}
}
2 changes: 1 addition & 1 deletion lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ export const defaultSettings = {
refreshFrequency: 2000,
showOnDisplay: "",
displayAsGraph: false,
cpuMonitorApp: "Top"
cpuMonitorApp: "Top",
},
batteryWidgetOptions: {
refreshFrequency: 10000,
Expand Down
10 changes: 5 additions & 5 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,19 +430,19 @@ export function runInUserTerminal(command) {
const settings = Settings.get();
const { terminal } = settings.global;
switch (terminal) {
case "Terminal":
case "Terminal":
Uebersicht.run(
`osascript ./simple-bar/lib/scripts/run-command-in-terminal.applescript` +
` "${command}"`
)
);
break;
case "iTerm2":
Uebersicht.run(
`osascript ./simple-bar/lib/scripts/run-command-in-iterm2.applescript` +
` "${command}"`
)
);
break;
default:
break;
}
}
}
}

0 comments on commit 83574ce

Please sign in to comment.