Skip to content

Commit 77076af

Browse files
authored
feat: add inline-cpu-usage-percent script (raycast#932)
1 parent ea44ba2 commit 77076af

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# Required parameters:
4+
# @raycast.schemaVersion 1
5+
# @raycast.title CPU Usage
6+
# @raycast.mode inline
7+
# @raycast.packageName System
8+
# @raycast.refreshTime 10s
9+
10+
# Optional parameters:
11+
# @raycast.icon 🖥️
12+
13+
# Documentation:
14+
# @raycast.description Display CPU usage percent
15+
# @raycast.author Juan Luis Romero
16+
# @raycast.authorURL https://github.com/JuanluR8
17+
18+
19+
output=$(top -l 1 | grep "CPU usage")
20+
cpu_usage=$(echo "$output" | awk -F " " '{print $3}' | cut -d% -f1)
21+
22+
echo "CPU Usage: ${cpu_usage}%"

0 commit comments

Comments
 (0)