2023-03-06

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 eventually

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