From 8e1f9528ab48380942d3e4f0942326e084657d7a Mon Sep 17 00:00:00 2001 From: Manuel Palenzuela Date: Fri, 5 Jul 2019 00:21:40 +0200 Subject: Added timer command line option --- README.md | 1 + smart-wallpaper | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b8c0995..8c7adb7 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Usage: smart-wallpaper [FLAG]
[-d]: NEEDED : daytime wallpaper file/folder
[-n]: NEEDED : nighttime wallpaper file/folder
[-l]: OPTIONAL : manual location (lat:long), if not added geoclue gets the location (requires internet)
+ [-t]: OPTIONAL : set the time period for the script to check if it is day or night
[-h]: OPTIONAL : print help message Example: diff --git a/smart-wallpaper b/smart-wallpaper index e9a0fe5..0200545 100755 --- a/smart-wallpaper +++ b/smart-wallpaper @@ -26,6 +26,7 @@ print_usage() { echo " [-d]: NEEDED : daytime wallpaper file/folder" echo " [-n]: NEEDED : nighttime wallpaper file/folder" echo " [-l]: OPTIONAL : manual location (lat:long), if not added geoclue gets the location (requires internet)" + echo " [-t]: OPTIONAL : set the time period for the script to check if it is day or night " echo " [-h]: OPTIONAL : print help message" } @@ -66,10 +67,11 @@ if (( $# == 0 )); then exit 1 fi -while getopts 'd:n:l:h' flag; do +while getopts 'd:n:l:t:h' flag; do case "${flag}" in d) input_daytimewallpaper="${OPTARG}" ;; n) input_nighttimewallpaper="${OPTARG}" ;; + t) period="${OPTARG}" ;; l) location="${OPTARG}" ;; h) print_usage exit 0 ;; -- cgit 1.4.1