Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tuneit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
tuneit
Commits
c88b202e
Commit
c88b202e
authored
Jan 28, 2026
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modules: add system_monitor module
parent
ae16a549
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
107 additions
and
1 deletion
+107
-1
meson.build
modules/meson.build
+4
-1
stats.sh
modules/system_monitor/bin/stats.sh
+38
-0
system_monitor.yml
modules/system_monitor/system_monitor.yml
+65
-0
No files found.
modules/meson.build
View file @
c88b202e
...
@@ -2,6 +2,9 @@ modules_dir = pkgdatadir / 'modules'
...
@@ -2,6 +2,9 @@ modules_dir = pkgdatadir / 'modules'
plugins = [
plugins = [
'example_module',
'example_module',
'system_monitor',
]
]
install_subdir(plugins, install_dir: modules_dir)
foreach plugin : plugins
install_subdir(plugin, install_dir: modules_dir)
endforeach
modules/system_monitor/bin/stats.sh
0 → 100755
View file @
c88b202e
#!/bin/bash
get_cpu_usage
()
{
local
cpu_line
=
"
$1
"
local
stat1
=
$(
grep
"^
${
cpu_line
}
"
/proc/stat
)
sleep
0.1
local
stat2
=
$(
grep
"^
${
cpu_line
}
"
/proc/stat
)
local
idle1
=
$(
echo
"
$stat1
"
|
awk
'{print $5}'
)
local
idle2
=
$(
echo
"
$stat2
"
|
awk
'{print $5}'
)
local
total1
=
$(
echo
"
$stat1
"
|
awk
'{sum=0; for(i=2;i<=NF;i++) sum+=$i; print sum}'
)
local
total2
=
$(
echo
"
$stat2
"
|
awk
'{sum=0; for(i=2;i<=NF;i++) sum+=$i; print sum}'
)
local
idle_diff
=
$((
idle2
-
idle1
))
local
total_diff
=
$((
total2
-
total1
))
if
[
"
$total_diff
"
-gt
0
]
;
then
awk
"BEGIN {printf
\"
%.1f
\"
, 100 * (1 -
$idle_diff
/
$total_diff
)}"
else
echo
"0.0"
fi
}
case
"
$1
"
in
cpu
)
get_cpu_usage
"cpu"
;;
cpu[0-9]
*
)
get_cpu_usage
"
$1
"
;;
ram
)
free |
awk
'/Mem:/ {printf "%.1f", $3/$2*100}'
;;
swap
)
free |
awk
'/Swap:/ {if($2>0) printf "%.1f", $3/$2*100; else print "0"}'
;;
esac
modules/system_monitor/system_monitor.yml
0 → 100644
View file @
c88b202e
-
name
:
"
System
Monitor"
weight
:
50
pages
:
-
name
:
"
Monitor"
icon
:
utilities-system-monitor-symbolic
sections
:
-
name
:
"
CPU"
weight
:
0
page
:
"
Monitor"
type
:
custom
settings
:
-
name
:
CPU Total
type
:
info_graph
update_interval
:
1
get_command
:
"
{module_path}/bin/stats.sh
cpu"
map
:
min
:
0
max
:
100
points
:
60
color
:
"
#e5a50a"
suffix
:
"
%"
-
name
:
"
CPU
Cores"
weight
:
5
page
:
"
Monitor"
type
:
dynamic
generator_command
:
"
seq
0
$(($(nproc)-1))"
setting_template
:
name
:
"
Core
{_item}"
type
:
info_graph
update_interval
:
1
get_command
:
"
{module_path}/bin/stats.sh
cpu{_item}"
map
:
min
:
0
max
:
100
points
:
60
color
:
"
#ff7800"
suffix
:
"
%"
-
name
:
"
Memory"
weight
:
10
page
:
"
Monitor"
type
:
custom
settings
:
-
name
:
RAM Usage
type
:
info_graph
update_interval
:
1
get_command
:
"
{module_path}/bin/stats.sh
ram"
map
:
min
:
0
max
:
100
points
:
60
color
:
"
#3584e4"
suffix
:
"
%"
-
name
:
Swap Usage
type
:
info_graph
update_interval
:
2
get_command
:
"
{module_path}/bin/stats.sh
swap"
map
:
min
:
0
max
:
100
points
:
30
color
:
"
#c061cb"
suffix
:
"
%"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment