This repository has been archived on 2019-02-28. You can view files and clone it, but cannot push or open issues or pull requests.
2018-05-21 15:31:52 +02:00

19 lines
482 B
Bash
Executable File

#!/bin/bash
toggle_long_instance () { [[ "$LONG" == "true" ]] && LONG=false || LONG=true; }
if [[ "$BLOCK_INSTANCE" =~ "pm" ]]; then
FULL=$(date '+%A %-d.%-m.%Y W%V, %-I:%M:%S%p')
SHORT=$(date '+%-I:%M%p')
else
FULL=$(date '+%A %-d.%-m.%Y W%V, %-H:%M:%S')
SHORT=$(date '+%-H:%M')
fi
[[ "$BLOCK_INSTANCE" =~ "long" ]] && toggle_long_instance
[[ "$BLOCK_BUTTON" == "1" ]] && toggle_long_instance
[[ "$LONG" == "true" ]] && echo $FULL || echo $SHORT
echo $SHORT