Last active
July 30, 2022 12:30
-
-
Save sfmth/63ea4c25d659069ed95679aa828e9f75 to your computer and use it in GitHub Desktop.
monchange - bash script that monitors commands and notifies the user on change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# monchange - bash script that monitors commands and notifies the user on change | |
# you can also append this file to yout ~/.bashrc file | |
# usage = monchange COMMAND | |
# example = monchange lsusb | |
# example = monchange "lsblk | grep sdb" | |
# requires a configured and working "beep" command for normal users --see: https://wiki.archlinux.org/title/PC_speaker#Beep | |
# requires "watch" & "notify-send" | |
alias watchn="watch -n 0.1" | |
alias noti="beep ; notify-send -u critical -t 10 -a ALERT -i sds Alert! Change\ in\ output" | |
monchange() { | |
while :; do watchn -g $@; noti; done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment