From f7b0ea1c185e5ca9a237f43103a29c1fc50c604d Mon Sep 17 00:00:00 2001 From: Chris Down Date: Wed, 11 Jan 2017 11:35:09 +0000 Subject: [PATCH] Add version to $cache_dir --- clipmenud | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/clipmenud b/clipmenud index fc593a8..a978a3d 100755 --- a/clipmenud +++ b/clipmenud @@ -2,6 +2,8 @@ cache_dir=/tmp/clipmenu.$USER/ cache_file=$cache_dir/line_cache +version=2.0.0 +version_file=$cache_dir/version get_first_line() { # Args: @@ -44,11 +46,14 @@ debug() { # shellcheck disable=SC2174 mkdir -p -m0700 "$cache_dir" +# We currently don't do anything with this, but in future we can use this +# version for the fabled clipmenu-fsck, or other migration logic. +printf '%s\n' "$version" > "$version_file" + declare -A last_data declare -A last_filename while sleep "${CLIPMENUD_SLEEP:-0.5}"; do - for selection in clipboard primary; do if type -p xsel >/dev/null 2>&1; then debug 'Using xsel'