sysm

aidlxMIT更新放缓

在 Linux 上监听系统或外部事件,触发时播放自定义音效,比如编译完成、服务挂掉或脚本跑完都能有声音提醒。

sysm makes your system play custom sounds when any configured system or external event happens

暂无版本215star7fork同步于 2026-11-07 07:33 UTC

怎么上手

由 README 提炼,执行前请确认
sudo apt install libsfml-dev
git clone https://github.com/aidlx/sysm --depth=1 && cd sysm && make install
./sysm.elf &
硬件要求按 README 说明

README 未说明具体硬件要求,仅要求安装 SFML 依赖;示例配置读取 /proc/stat、/sys/block/sda/stat 等 Linux 系统文件,实际面向 Linux 环境。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

把系统或外部事件映射成自定义音效,让你不用盯屏幕也能感知 CPU、磁盘、网络等变化

在 Linux 上监听系统或外部事件,触发时播放自定义音效,比如编译完成、服务挂掉或脚本跑完都能有声音提醒。

核心能力

  • 用 source 与 type 组合定义规则,按事件触发播放音效
  • 内置 shell、file_column 等数据源,可读取命令输出或文件列
  • 支持阈值穿越、正则首次匹配、增量超阈值等多种触发类型
  • 可为开始、持续、结束三个阶段分别配置音效与音量
  • 可通过继承 Source 和 Type 扩展新的数据源与触发类型

容易踩的坑

需先安装 SFML 开发库(Arch 用 pacman、Ubuntu 用 apt),否则无法编译;音效文件需自行准备并放到配置中指定的路径,README 未提供音频资源;示例配置依赖 Linux 的 /proc、/sys 和 ss 命令,非 Linux 环境无法直接套用。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    sysm

    sysm (system music) lets you configure specific sounds to be played on any arbitrary internal system event or an external event. This can give you visibility into your system while you are working (such as CPU/RAM/disk/network usage, audit events, etc.) without taking up space in your screen or notifications about external events such as something changing in some arbitrary website.

    Concepts

    Rules require you to specify one "source" and one "type".

    "source" is basically the information source, where the data will be fetched from, such as "shell_source" (runs an arbitrary shell command and returns the output), "file_column" (fetches specified column from a file), etc.

    "type" controls how and when the audio will be played, for example "on_threshold_cross" (when value crosses given threshold), "on_match_when_past_no_match" (when value matches given regex pattern when it didn't match it last tick), "while_delta_above_threshold" (while delta between last tick's value and current value is above given threshold), etc.

    New types and sources can be added by subclassing Source and Type. Contributions are welcome!

    Installation

    Install the SFML dependency:

    • Arch Linux:
    sudo pacman -S sfml
    
    • Ubuntu:
    sudo apt install libsfml-dev
    

    Clone, build & install:

    git clone https://github.com/aidlx/sysm --depth=1 && cd sysm && make install
    

    Run:

    ./sysm.elf &
    

    Configuration

    Sample config:

    [high_disk_write_speed]
    enabled = true
    description = "While current disk write speed is above threshold"
    sleep = 1000
    start_music = "~/.config/sysm/audio/processing_1_start.wav"
    content_music = "~/.config/sysm/audio/processing_1.wav"
    end_music = "~/.config/sysm/audio/processing_1_end.wav"
    content_music_volume = 75
    source = file_column
    file = "/sys/block/sda/stat"
    column = 6
    type = while_delta_above_threshold
    threshold = 5000
    
    [high_cpu_usage]
    enabled = true
    description = "When current CPU usage crosses above threshold"
    sleep = 3000
    content_music = "~/.config/sysm/audio/beeps_1.wav"
    source = shell
    command = "awk '{u=$2+$4; t=$2+$4+$5; if (NR==1){u1=u; t1=t;} else print int(($2+$4-u1) * 100 / (t-t1)); }' <(grep 'cpu ' /proc/stat) <(sleep 1;grep 'cpu ' /proc/stat)"
    type = on_threshold_cross
    threshold = 90
    
    [any_conn_estab_for_first_time]
    enabled = true
    description = "When any network connection establishes when no network connection exists"
    sleep = 1000
    content_music = "~/.config/sysm/audio/connection_established_1.wav"
    content_music_volume = 25
    source = shell
    command = "ss -atun4 | grep ESTAB"
    type = on_match_when_past_not_match
    match = ".*\S.*"
    
    [specific_ip_conn_estab_for_first_time]
    enabled = true
    description = "When specified IP network connection establishes when it didn't exist before"
    sleep = 1000
    content_music = "~/.config/sysm/audio/connection_established_1.wav"
    content_music_volume = 25
    source = shell
    command = "ss -atun4 | grep ESTAB | grep 192.168.23.2"
    type = on_match_when_past_not_match
    match = ".*\S.*"
    
    [github_star_received]
    enabled = false
    description = "When someone stars one of your repositories"
    sleep = 10000
    content_music = "~/.config/sysm/audio/beeps_2.wav"
    source = shell
    command = "TODO"
    type = on_value_change