#directory #file-path #xdg #env-var #cli-file #location #user-data

app places-cli

A cli program to get file and directory locations from XDG

2 releases

0.1.2 Jun 21, 2024
0.1.1 Jun 21, 2024
0.1.0 Jun 21, 2024

#1111 in Command line utilities

Download history 27/week @ 2024-09-10 14/week @ 2024-09-17 17/week @ 2024-09-24 1/week @ 2024-10-01

74 downloads per month

GPL-3.0 license

29KB
263 lines

places-cli

A handy tool for your scripts to always get correct path names for known locations. Sometimes the location is changed by either ENVIRONMENT variables, or by user localization.

Quick usage

Usage: places [OPTIONS] <location> [pathel]...

Arguments:
  <location>

[possible values: home, desktop, downloads, templates, documents, pictures, videos, music, public, config, bin, cache, state, data, autostart, fonts, menus, backgrounds, icons]

  [pathel]...
          Optional list of path elements to append

Options:
  -a, --app <program>
          Optional program to get paths

See manpage for more info.

Examples

  • Get a path like: /home/alice/.config/gizmo/theme/colors.txt
places -a gizmo config theme colors.txt \
places config gizmo theme colors.txt
  • List all config files for the 'gizmo' program
lsd $(places --app=gizmo data) \
places --app=gizmo data | xargs lsd
  • Copy a config file
cp gizmo_config.toml $(places -a gizmo config)
  • Get a folder inside 'Downloads dir', even if it is localized.
places downloads Software

This returns something like /home/alice/Descargas/Software

Dependencies

~1–11MB
~76K SLoC