2024-06-23

rate

sort files into numbered directories

dependencies

setup

  • download sph-rate from releases or clone from git://git.sph.mn/sph-rate
  • extract the downloaded archive
  • link or copy the files exe/rate and exe/rate-modify into a directory which is in the environment variable $PATH
  • link or copy the files modules/* into a directory which is in the environment variable $GUILE_LOAD_PATH or any other guile load path
  • adjust file system permissions if necessary

command-line programs

all programs take care to not overwrite files

rate

parameters
  options ... number path ...
description
  this program "rates" files by moving them into a numerically named directory.
  first it searches upwards to see if a numeric directory name exists in path, if yes, the
  relative directory structure of the given path is moved on that level into a directory named like the given number.
  if no numeric directory exists in path, and the current working directory is in path, a directory named like the given number is created
  in the current working directory and the given path is moved there. otherwise nothing happens.
  examples:
    rate 2 /a/0/b/c -> /a/2/b/c
    cwd: /a/b
    rate 2 /a/b/c -> /a/b/2/c
    cwd: /
    rate 2 /a/b/c -> /2/a/b/c
options
  --help | -h
  --interface

given a path the program searches upwards until it finds a directory with a numerical name, then it inserts all files given as arguments at that level with a relative path into a directory with the given rating-name. the directory does not need to previously exist. the directory structure below the rating directory is preserved

example

  • file: 0/test/a
  • command: rate 2 a
  • the file is moved to 2/test/a

rate-modify

parameters
  options ... direction difference path ...
description
  this program changes the rating of files relative to their current one.
  direction can be "up" or "down".
  a rating is designated by a numeric directory in the path unequal to the current path.
  see the "rate" program for more information
options
  --help | -h
  --interface

like "rate" but subtracts from or adds to the current rating to move the file

example

rate-modify down 1 afile

thunar example

example of rate as a file context menu command in thunar thunar example

rating strategies

triangular series

  • 1, 10%, the best of the best and most important
  • 2, 30%, frequently appreciated
  • 3, 60%, pool of entries with a probability of becoming 2
  • 4, more, larger pool of entries that did not make the selection yet
  • 0, unrated

nested ratings

a multi-level rating system with nested secondary ratings is possible, for example 2/1/. with four primary ratings and two secondary ratings, for example, the granularity would increase to 4 * 2 = 8. however, the added directory depth can be confusing and more tedious to browse. the finer granularity may also make secondary ratings less meaningful.

secondary ratings seem particularly useful when dealing with an unrated directory 0 containing numerous low-relevance files awaiting review. to prioritize new more relevant files, the low-relevance files can be moved into a 0/0 directory.