From de7bcdc2b56b4c9af8434f509be252052c7d51d7 Mon Sep 17 00:00:00 2001 From: atagen Date: Thu, 26 Aug 2021 11:05:51 +1000 Subject: [PATCH] Added quiet-mode (#288) --- betterlockscreen | 16 +++++++++++++--- examples/betterlockscreenrc | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/betterlockscreen b/betterlockscreen index e385591..860a59f 100755 --- a/betterlockscreen +++ b/betterlockscreen @@ -20,6 +20,7 @@ init_config () { pixel_scale=10,1000 solid_color=333333 description="" + quiet=false i3lockcolor_bin="i3lock-color" if ! cmd_exists "$i3lockcolor_bin" && cmd_exists "i3lock"; then @@ -764,7 +765,7 @@ echof() { error) msgpfx="[\e[1;91m!\e[m]";; *) msgpfx="";; esac - echo -e "$msgpfx $message" + [ "$quiet" != true ] && echo -e "$msgpfx $message" } # help message @@ -772,6 +773,9 @@ usage() { echo echo "Usage: betterlockscreen [-u ] [-l ] [-w ]" echo + echo " -q --quiet" + echo " Do not produce any text output on locking" + echo echo " -u --update " echo " Update lock screen image" echo @@ -828,8 +832,6 @@ usage() { exit 1 } -echof header "Betterlockscreen" - init_config # show usage when no arguments passed @@ -841,6 +843,12 @@ for arg in "$@"; do [[ "${arg:0:1}" = '-' ]] || continue case "$1" in + + -q | --quiet) + quiet=true + shift + ;; + -u | --update) runupdate=true imagepaths+=("$2") @@ -959,6 +967,8 @@ for arg in "$@"; do esac done +echof header "Betterlockscreen" + # Run image generation [[ $runupdate ]] && update "${imagepaths[@]}" diff --git a/examples/betterlockscreenrc b/examples/betterlockscreenrc index e602ebc..4cdfbe8 100644 --- a/examples/betterlockscreenrc +++ b/examples/betterlockscreenrc @@ -10,6 +10,7 @@ blur_level=1 pixel_scale=10,1000 solid_color=333333 wallpaper_cmd="feh --bg-fill" +quiet=false # i3lockcolor_bin="i3lock-color" # Manually set command for i3lock-color # default theme