diff options
author | Sebastian Sellmeier <mail@sebastian-sellmeier.de> | 2021-05-15 11:36:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-15 11:36:48 +0200 |
commit | 3be77f68548c8f92a3cc7f530f9b35a1478a0651 (patch) | |
tree | 5e14b0781c720feb168313badef1bc942191b25e /betterlockscreen | |
parent | bacc7cea5753b704a1db076d0f19c0e395fe39cd (diff) |
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 <addisonbean@gmail.com>
Diffstat (limited to 'betterlockscreen')
-rwxr-xr-x | betterlockscreen | 14 |
1 files changed, 13 insertions, 1 deletions
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 <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 |