• Stars
    star
    214
  • Rank 184,678 (Top 4 %)
  • Language
    C++
  • License
    MIT License
  • Created almost 2 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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

More Repositories

1

serpentine

C++/Win32/Boost Windows RAT (Remote Administration Tool) with a multiplatform Java/Spring RESTful C2 server and Go, C++/Qt5 frontends
C++
446
star
2

rconn

rconn is a multiplatform program for creating generic reverse connections. Lets you consume services that are behind firewall or NAT without opening ports or port-forwarding.
Go
320
star
3

connmap

connmap is an X11 desktop widget that shows location of your current network peers on a world map
C
311
star
4

rssnix

Unix-style filesystem-based RSS/Atom/JSON Feed fetcher/reader
Go
171
star
5

modreveal

Utility to find hidden Linux kernel modules
C
144
star
6

clex

clex is a simple lexer generator
C
93
star
7

cppq

Simple, reliable & efficient distributed task queue for C++17
C++
93
star
8

revp

Reverse HTTP proxy that works on Linux, Windows, and macOS. Made with C++ and Boost.
C++
85
star
9

cparse

cparse is an LR(1) and LALR(1) parser generator
C
50
star
10

core86

[WIP] 8086 IBM PC emulator
Rust
25
star
11

eemit

Tiny event emitter library for Java
Java
23
star
12

symposium

Modern discussion forums software. Made with Go, React, and PostgreSQL.
JavaScript
22
star
13

c-skeleton

Boilerplate for basic C projects
C++
17
star
14

ccompile

[WIP] C compiler
C
5
star
15

cppdataloader

cppdataloader is a batching and caching library for C++17
C++
5
star
16

cpreprocess

[WIP] C preprocessor
C
4
star
17

uefi

[WIP] UEFI bootloader
Shell
4
star
18

8086emulate

[WIP] 8086 emulator
C
4
star
19

repotrack

Tracks comments on GitHub issues and PRs assigned to you
Python
3
star
20

dotfiles-old

Personal system configuration files, scripts, etc.
Shell
3
star
21

hnreader

HackerNews reader app for Wear OS
Kotlin
2
star
22

file-hosting

2
star
23

forumd

[WIP] Modern discussion forums software
TypeScript
2
star
24

mepsitahl

[WIP] x86_64 OS
C
2
star
25

geolocation-service

Go
1
star
26

addressbook

Go
1
star
27

8086assemble

[WIP] 8086 assembler
C
1
star
28

x86nix

[WIP] x86 OS
C
1
star
29

archive

Archived projects
C++
1
star