Update dunstrc and watch.sh
Signed-off-by: Severin Kaderli <severin.kaderli@gmail.com>
This commit is contained in:
parent
5c893b60aa
commit
a02e32523d
3 changed files with 8 additions and 5 deletions
|
@ -75,7 +75,7 @@ ignore_newline = no
|
||||||
# the top and down respectevly.
|
# the top and down respectevly.
|
||||||
# The width can be negative. In this case the actual width is the
|
# The width can be negative. In this case the actual width is the
|
||||||
# screen width minus the width defined in within the geometry option.
|
# 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
|
# Shrink window if it's smaller than the width. Will be ignored if
|
||||||
# width is 0.
|
# width is 0.
|
||||||
|
|
|
@ -41,10 +41,12 @@ function print_header() {
|
||||||
echo -e "########################################${RESET}"
|
echo -e "########################################${RESET}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to print a info message with the current time
|
# Function to print a info message with the current time and to send
|
||||||
# USAGE: print_info MESSAGE
|
# a notification using notify-send.
|
||||||
|
# USAGE: print_info TITLE MESSAGE
|
||||||
function print_log() {
|
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
|
# Creates the given directory in the home directory
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
# The file to watch
|
# The file to watch
|
||||||
FILE="${1}"
|
FILE="${1}"
|
||||||
|
FILENAME=$(basename "${FILE}")
|
||||||
|
|
||||||
# The rest of the arguments is the command
|
# The rest of the arguments is the command
|
||||||
shift
|
shift
|
||||||
|
@ -24,6 +25,6 @@ COMMAND="${@}"
|
||||||
print_header "Watching ${FILE}"
|
print_header "Watching ${FILE}"
|
||||||
while inotifywait -qq -e close_write "${FILE}";
|
while inotifywait -qq -e close_write "${FILE}";
|
||||||
do
|
do
|
||||||
print_log "File has changed, executing command"
|
print_log "${FILENAME} has changed" "Executing command"
|
||||||
$($COMMAND)
|
$($COMMAND)
|
||||||
done
|
done
|
Loading…
Add table
Add a link
Reference in a new issue