Skip to content

dotMavriQ/lyncs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Lyncs v3.2.0

      `\.      ,/'
      |\\____//|
      )/_ `' _\(
     ,'/-`__'-\`\
     /. (_><_) ,\
     ` )/`--'\(`'  lyncs
       `      '

Lyncs (Lua + Syncs) is a terminal interface for moving music from a Linux system to a Snowsky Echo Mini DAP. It handles FAT32 filename constraints, shows what's missing, and copies files with progress feedback.

What it does

Scans your music directory, detects connected SD cards, and displays a side-by-side comparison. You can transfer individual artists or everything at once. Filenames are automatically made FAT32-compliant.

Requirements

  • Lua 5.1 or newer
  • LuaFileSystem (lfs) - install with luarocks install luafilesystem
  • Standard Linux tools: find, rsync, lsblk, stty, xdg-user-dir

Install

# Get the script
git clone https://github.com/dotmavriq/lyncs.git
cd lyncs

# Make it executable
chmod +x src/lyncs.lua

# Run it
./src/lyncs.lua

For system-wide access:

sudo cp src/lyncs.lua /usr/local/bin/lyncs

First run

The script asks for your music directory. Default is ~/Music or your XDG music folder. This path saves to ~/.config/lyncs/source_path.

Interface

Two-column display:

  • Left: Artists on your computer with album counts and sizes
  • Right: Same artists on the SD card (shows [OK] or MISSING)

Controls

  • / or k/j - Move selection
  • T - Transfer selected artist
  • F - Sync all artists
  • W - Wipe SD card (requires DELETE then WIPE ALL confirmation)
  • P - Manually set SD card path
  • R - Rescan both sides
  • C - Reset config and exit
  • Q - Quit

How it works

SD card detection

Checks:

  1. /proc/mounts for mounted media
  2. /run/media/$USER/ and /media/$USER/
  3. lsblk output for connected FAT32 volumes

File scanning

Finds MP3, FLAC, WAV files in your music directory. Groups by artist, counts albums, shows total size.

FAT32 sanitization

Replaces illegal characters with underscores:

  • <>:"\|?*_

Example: Band: Name? becomes Band_ Name_

Transfer process

  1. Creates helper bash script in /tmp/
  2. Runs script with source and target paths
  3. Shows spinner and percentage during copy
  4. Updates SD card file list when done

Configuration

Stores one line in ~/.config/lyncs/source_path - your music directory path.

To change it: delete the file and restart.

Troubleshooting

No SD card detected

  • Card not mounted? Check lsblk
  • Use P to set path manually
  • Might need sudo for some mount points

Transfer fails

  • Check /tmp/lyncs_rsync_status.log
  • Ensure enough space on SD card
  • FAT32 has 4GB file size limit

Files missing after transfer

  • FAT32 doesn't allow certain characters
  • Check sanitized names in the log
  • Original files remain untouched on your computer

Script errors

  • Need LuaFileSystem: luarocks install luafilesystem
  • Or install system package: lua-filesystem (Debian/Ubuntu)

Development

One Lua file, 698 lines. Functions are in the lyncs table.

Structure

  • init() - Main loop, handles input
  • draw_ui() - Terminal display
  • scan_dir() - File discovery
  • transfer_with_sanitize() - Copy with FAT32 fixes
  • detect_sd() - Find removable storage

Dependencies

  • lfs for directory scanning (falls back to find command)
  • Standard shell utilities

License

MIT. Do what you want with it.

Notes

Built because the Snowsky Echo Mini sorts by "Added Date" on FAT32, and manual copying is tedious. This does the job.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors