#symlink #config-file #directory #toml #command #file-format #clean

app slmap

A simple program for managing symlinks via config file

5 releases

0.2.1 Dec 24, 2023
0.2.0 Aug 29, 2023
0.1.2 Oct 29, 2022
0.1.1 Oct 29, 2022
0.1.0 Sep 9, 2022

#1099 in Parser implementations

Download history 6/week @ 2023-12-22 6/week @ 2024-02-23 2/week @ 2024-03-01 14/week @ 2024-03-08 77/week @ 2024-03-15 44/week @ 2024-03-29

135 downloads per month

GPL-3.0 license

15KB
340 lines

slmap

Simple utility to manage a list of symlinks so you can centralize your config files in a repo and symlink to them.

usage

slmap --map map.toml
commands are create, update, clean, and status
create will create all the symlinks if there are no existing conflicting files
update will update -only- symlinks to point at new target, or create new symlinks if they don't exist
status will go through the map and check the statuses of symlinks. The possible statuses are:

  • Correct
  • Incorrect
  • NotSymlink
  • Missing
  • Error
    unexpected statuses will result in no writes, and will print the statuses
    clean deletes all the symlinks in map.toml

Note: the links are relative to where the slmap command is run. Paths are interpretted with shell variables and ~

Future goals:

  • actually handling permissions
  • error handling nicely vs just panics
  • checking in a new file to the map
    • swap out the txt into the repository and update the map

file format:

[filename]  
target = 'path/to/file'  
link_name = 'path/to/file'

[directory]
target = 'config/dir'
link_name = 'test/dir'
directory = true

[zshrc]  
target = 'config/zshrc'  
link_name = 'test/.zshrc'  
  
[vimrc]  
target = 'config/vimrc'  
link_name = 'test/.vimrc'   

[motd]
target = 'config/motd'
link_name = '/etc/motd'

Dependencies

~2–12MB
~101K SLoC