From 3be77f68548c8f92a3cc7f530f9b35a1478a0651 Mon Sep 17 00:00:00 2001 From: Sebastian Sellmeier Date: Sat, 15 May 2021 11:36:48 +0200 Subject: Add option for time-format (with default-config) from #185 (#205) * Add an option to change the time format * Add option to example-config Co-authored-by: Addison Bean --- betterlockscreen | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'betterlockscreen') diff --git a/betterlockscreen b/betterlockscreen index 5d51af5..76ffcb2 100755 --- a/betterlockscreen +++ b/betterlockscreen @@ -29,6 +29,7 @@ init_filenames() { font="sans-serif" locktext='Type password to unlock...' wallpaper_cmd='feh --bg-fill --no-fehbg' + time_format='%H:%M:%S' # override defaults with config theme_rc="$HOME/.config/betterlockscreenrc" @@ -90,7 +91,7 @@ lock() { -t -i "$1" \ --timepos='x+110:h-70' \ --datepos='x+43:h-45' \ - --clock --date-align 1 --datestr "$locktext" \ + --clock --date-align 1 --datestr "$locktext" --timestr "$time_format" \ --insidecolor=$insidecolor --ringcolor=$ringcolor --line-uses-inside \ --keyhlcolor=$keyhlcolor --bshlcolor=$bshlcolor --separatorcolor=$separatorcolor \ --insidevercolor=$insidevercolor --insidewrongcolor=$insidewrongcolor \ @@ -408,6 +409,12 @@ usage() { echo ' to set your custom wallpaper setter' echo ' the default is "feh --bg-fill --no-fehbg"' echo ' E.g: betterlockscreen -wc "xwallpaper --zoom" -w' + echo + echo + echo ' -tf --time_format ' + echo ' to set the time format used by i3lock-color' + echo ' see the i3lock or strftime man pages for more details.' + echo ' E.g: betterlockscreen -l dim -tf "%I:%M %p"' } @@ -474,6 +481,11 @@ for arg in "$@"; do shift 2 ;; + -tf | --time_format) + time_format="$2" + shift 2 + ;; + --) lockargs="$lockargs ${*:2}" break -- cgit v1.2.3