From a02e32523ddf101290f19872f8b183a9dfb25ecf Mon Sep 17 00:00:00 2001 From: Severin Kaderli Date: Wed, 19 Dec 2018 23:06:04 +0100 Subject: [PATCH] Update dunstrc and watch.sh Signed-off-by: Severin Kaderli --- system/.config/dunst/dunstrc | 2 +- system/bin/utils.sh | 8 +++++--- system/bin/watch.sh | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/system/.config/dunst/dunstrc b/system/.config/dunst/dunstrc index c96e006..232f89d 100644 --- a/system/.config/dunst/dunstrc +++ b/system/.config/dunst/dunstrc @@ -75,7 +75,7 @@ ignore_newline = no # the top and down respectevly. # The width can be negative. In this case the actual width is the # screen width minus the width defined in within the geometry option. -geometry = "300x25-10+45" +geometry = "500x25-10+45" # Shrink window if it's smaller than the width. Will be ignored if # width is 0. diff --git a/system/bin/utils.sh b/system/bin/utils.sh index 6fddb8a..85ad900 100755 --- a/system/bin/utils.sh +++ b/system/bin/utils.sh @@ -41,10 +41,12 @@ function print_header() { echo -e "########################################${RESET}" } -# Function to print a info message with the current time -# USAGE: print_info MESSAGE +# Function to print a info message with the current time and to send +# a notification using notify-send. +# USAGE: print_info TITLE MESSAGE function print_log() { - echo -e "${YELLOW}[$(date "+%H:%M:%S")] ${1}${RESET}" + notify-send "${1}" "${2}" + echo -e "${YELLOW}[$(date "+%H:%M:%S")] ${1} ${2}${RESET}" } # Creates the given directory in the home directory diff --git a/system/bin/watch.sh b/system/bin/watch.sh index 4bac65d..c3404ea 100755 --- a/system/bin/watch.sh +++ b/system/bin/watch.sh @@ -16,6 +16,7 @@ # The file to watch FILE="${1}" +FILENAME=$(basename "${FILE}") # The rest of the arguments is the command shift @@ -24,6 +25,6 @@ COMMAND="${@}" print_header "Watching ${FILE}" while inotifywait -qq -e close_write "${FILE}"; do - print_log "File has changed, executing command" + print_log "${FILENAME} has changed" "Executing command" $($COMMAND) done \ No newline at end of file