Giter Site home page Giter Site logo

jafarlihi / sysm Goto Github PK

View Code? Open in Web Editor NEW
212.0 6.0 8.0 984 KB

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

License: MIT License

Makefile 6.25% C++ 93.75%
audio linux music system-monitor system-monitoring

sysm's Introduction

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/jafarlihi/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

sysm's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sysm's Issues

ubuntu installation error

Hi,

I installed sysm in ubuntu using command "sudo apt install libsfml-dev" but unable to find the installed package and the config file.

Can you please help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.