mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
Provide a macOS version of the sysinfo bash script
This commit is contained in:
parent
aef4b024b4
commit
9b5e05e41b
1 changed files with 26 additions and 0 deletions
26
examples/bash/sysinfo_macos.sh
Executable file
26
examples/bash/sysinfo_macos.sh
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash -e
|
||||
# LICENSE BEGIN
|
||||
# This file is part of the SixtyFPS Project -- https://sixtyfps.io
|
||||
# Copyright (c) 2021 Olivier Goffart <olivier.goffart@sixtyfps.io>
|
||||
# Copyright (c) 2021 Simon Hausmann <simon.hausmann@sixtyfps.io>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
# This file is also available under commercial licensing terms.
|
||||
# Please contact info@sixtyfps.io for more information.
|
||||
# LICENSE END
|
||||
|
||||
cpu_count=`sysctl -n hw.ncpu`
|
||||
cpu_vendor=`sysctl -n machdep.cpu.vendor`
|
||||
cpu_model=`sysctl -n machdep.cpu.brand_string`
|
||||
mem_size_kb=`sysctl -n hw.memsize`
|
||||
partitions=`df -lk | tail -n+2 | sed 's/\([^ ]*\) *\([^ ]*\) *\([^ ]*\) *\([^ ]*\) *\([^ ]*\) *\([^ ]*\) *\([^ ]*\) *\([^ ]*\) *\([^ ]*\)/{ "dev": "\1", "mnt": "\9", "total": \2, "used": \3 },/' | sed '$s/,$//'`
|
||||
|
||||
sixtyfps-viewer `dirname $0`/sysinfo.60 --load-data - <<EOT
|
||||
{
|
||||
"cpu_count": "$cpu_count",
|
||||
"cpu_vendor": "$cpu_vendor",
|
||||
"cpu_model": "$cpu_model",
|
||||
"mem_size_kb": $mem_size_kb,
|
||||
"partitions": [ $partitions ]
|
||||
}
|
||||
EOT
|
Loading…
Add table
Add a link
Reference in a new issue