Skip to content

Instantly share code, notes, and snippets.

@sfmth
Last active July 30, 2022 12:30
Show Gist options
  • Save sfmth/63ea4c25d659069ed95679aa828e9f75 to your computer and use it in GitHub Desktop.
Save sfmth/63ea4c25d659069ed95679aa828e9f75 to your computer and use it in GitHub Desktop.
monchange - bash script that monitors commands and notifies the user on change
#!/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