Skip to content

Commit

Permalink
feat: add inline-cpu-usage-percent script (#932)
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanluR8 authored Apr 22, 2024
1 parent ea44ba2 commit 77076af
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions commands/system/inline-cpu-usage-percent.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title CPU Usage
# @raycast.mode inline
# @raycast.packageName System
# @raycast.refreshTime 10s

# Optional parameters:
# @raycast.icon 🖥️

# Documentation:
# @raycast.description Display CPU usage percent
# @raycast.author Juan Luis Romero
# @raycast.authorURL https://github.com/JuanluR8


output=$(top -l 1 | grep "CPU usage")
cpu_usage=$(echo "$output" | awk -F " " '{print $3}' | cut -d% -f1)

echo "CPU Usage: ${cpu_usage}%"

0 comments on commit 77076af

Please sign in to comment.