Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
40e5d2815c |
@@ -0,0 +1,2 @@
|
||||
CLAUDE.md
|
||||
sfm
|
||||
@@ -5,33 +5,42 @@ BINDIR ?= $(PREFIX)/bin
|
||||
MANDIR ?= $(PREFIX)/share/man/man1
|
||||
DOCDIR ?= $(PREFIX)/share/doc/sfm
|
||||
|
||||
CXX ?= g++
|
||||
CXXFLAGS ?= -std=c++17 -O2 -Wall -Wextra
|
||||
LDFLAGS ?= -lncursesw
|
||||
|
||||
INSTALL ?= install
|
||||
RM ?= rm -f
|
||||
|
||||
.PHONY: all install uninstall clean
|
||||
|
||||
all:
|
||||
@echo "sfm is a shell script — nothing to build."
|
||||
@echo "Run 'make install' to install."
|
||||
all: sfm
|
||||
|
||||
install:
|
||||
sfm: sfm.cpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ $< $(LDFLAGS)
|
||||
|
||||
install: all
|
||||
@echo "Installing sfm to $(DESTDIR)$(BINDIR)/sfm ..."
|
||||
$(INSTALL) -d $(DESTDIR)$(BINDIR)
|
||||
$(INSTALL) -m 755 sfm $(DESTDIR)$(BINDIR)/sfm
|
||||
@echo "Installing sfm.sh to $(DESTDIR)$(BINDIR)/sfm.sh ..."
|
||||
$(INSTALL) -m 755 sfm.sh $(DESTDIR)$(BINDIR)/sfm.sh
|
||||
@echo "Installing man page to $(DESTDIR)$(MANDIR)/sfm.1 ..."
|
||||
$(INSTALL) -d $(DESTDIR)$(MANDIR)
|
||||
$(INSTALL) -m 644 sfm.1 $(DESTDIR)$(MANDIR)/sfm.1
|
||||
@echo "Installing README to $(DESTDIR)$(DOCDIR)/README ..."
|
||||
$(INSTALL) -d $(DESTDIR)$(DOCDIR)
|
||||
$(INSTALL) -m 644 README $(DESTDIR)$(DOCDIR)/README
|
||||
@echo "Done. Run 'sfm' to start, or 'man sfm' for help."
|
||||
@echo "Done."
|
||||
|
||||
uninstall:
|
||||
@echo "Removing sfm ..."
|
||||
$(RM) $(DESTDIR)$(BINDIR)/sfm
|
||||
$(RM) $(DESTDIR)$(BINDIR)/sfm.sh
|
||||
$(RM) $(DESTDIR)$(MANDIR)/sfm.1
|
||||
$(RM) -r $(DESTDIR)$(DOCDIR)
|
||||
@echo "Done."
|
||||
|
||||
clean:
|
||||
@echo "Nothing to clean."
|
||||
$(RM) sfm
|
||||
@echo "Cleaned."
|
||||
|
||||
@@ -4,16 +4,23 @@ sfm - Simple File Manager
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
sfm is a lightweight, terminal-based file manager written entirely in
|
||||
POSIX sh. It runs in your terminal with no external dependencies beyond
|
||||
standard Unix tools (ls, awk, tput, stty, mv, cp, rm). Designed to be
|
||||
fast, flicker-free, and keyboard-driven with a vim-inspired key layout.
|
||||
sfm is a lightweight, terminal-based file manager with a vim-inspired
|
||||
key layout. The primary version is a fast C++/ncurses binary. A portable
|
||||
POSIX sh version (sfm.sh) is also included, requiring only standard Unix
|
||||
tools (ls, awk, tput, stty, mv, cp, rm).
|
||||
|
||||
|
||||
REQUIREMENTS
|
||||
------------
|
||||
C++ version (sfm):
|
||||
- ncursesw (libncursesw)
|
||||
- A C++17 compiler (g++ or compatible)
|
||||
|
||||
Shell version (sfm.sh):
|
||||
- A POSIX-compatible shell (sh, dash, bash, etc.)
|
||||
- Standard Unix tools: ls, awk, tput, stty, cp, mv, rm, mkdir, touch
|
||||
|
||||
Both versions:
|
||||
- Optional: wl-copy / xclip / xsel / pbcopy (for clipboard support)
|
||||
- Optional: mpv, vlc, feh, zathura, etc. (for smart file opening)
|
||||
- Optional: readlink (for symlink display)
|
||||
@@ -23,21 +30,23 @@ REQUIREMENTS
|
||||
INSTALLATION
|
||||
------------
|
||||
Using make (recommended):
|
||||
|
||||
|
||||
make install
|
||||
|
||||
This installs sfm to /usr/local/bin by default. To change the prefix:
|
||||
|
||||
|
||||
This builds the C++ binary and installs both sfm (C++ binary)
|
||||
and sfm.sh (shell script) to /usr/local/bin by default.
|
||||
To change the prefix:
|
||||
|
||||
make install PREFIX=/usr
|
||||
|
||||
|
||||
To uninstall:
|
||||
|
||||
|
||||
make uninstall
|
||||
|
||||
Manual installation:
|
||||
|
||||
cp sfm /usr/local/bin/sfm
|
||||
chmod +x /usr/local/bin/sfm
|
||||
|
||||
Manual installation (shell version only):
|
||||
|
||||
cp sfm.sh /usr/local/bin/sfm.sh
|
||||
chmod +x /usr/local/bin/sfm.sh
|
||||
|
||||
|
||||
USAGE
|
||||
|
||||
Reference in New Issue
Block a user