Files

140 lines
4.6 KiB
Plaintext
Raw Permalink Normal View History

2017-06-29 02:50:39 +02:00
sdn
===
:compact-option:
2026-07-31 12:59:22 +02:00
'sdn' is a keyboard-driven file picker and directory navigator for your shell.
2017-06-29 02:50:39 +02:00
2026-07-31 12:59:22 +02:00
Press Alt-o at any point while composing a command to explore the filesystem
visually. When you return, 'sdn' can change the shell's working directory,
or insert one or more shell-quoted paths directly into the command line,
all without discarding what you were already typing.
2017-06-29 02:50:39 +02:00
2026-07-31 12:59:22 +02:00
The high-level goal has been to turn Midnight Commander inside out: unlike with
MC's Ctrl-o escape, it will always be obvious whether the navigator is running.
'sdn' runs on Linux, all BSD derivatives, and within MSYS2.
2017-06-29 02:50:39 +02:00
2026-07-31 15:14:53 +02:00
image::sdn.webp[align="center"]
2018-11-02 21:19:41 +01:00
2020-10-27 01:16:07 +01:00
Packages
--------
2023-07-01 21:58:29 +02:00
Regular releases are sporadic. git master should be stable enough.
You can get a package with the latest development version using Arch Linux's
https://aur.archlinux.org/packages/sdn-git[AUR],
or as a https://git.janouch.name/p/nixexprs[Nix derivation].
2020-10-27 01:16:07 +01:00
2026-01-04 14:05:39 +01:00
https://janouch.name/cd[Static Linux builds can be found here],
2026-01-03 09:31:58 +01:00
simply place the binaries somewhere in your PATH.
2017-06-29 02:50:39 +02:00
Building
--------
2026-01-04 14:05:39 +01:00
Build-only dependencies: CMake and/or make, a C++17 compiler, pkg-config +
2026-01-04 14:30:13 +01:00
Runtime dependencies: ncursesw, libacl (on Linux) +
2026-01-04 14:05:39 +01:00
Optional runtime dependencies: Midnight Commander
2017-06-29 02:50:39 +02:00
2020-08-28 18:24:06 +02:00
$ git clone https://git.janouch.name/p/sdn.git
2017-06-29 02:50:39 +02:00
$ mkdir sdn/build
$ cd sdn/build
$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug
$ make
To install the application, you can do either the usual:
# make install
Or you can try telling CMake to make a package for you. For Debian it is:
$ cpack -G DEB
# dpkg -i sdn-*.deb
There is also a Makefile you can use to quickly build a binary to be copied
into the PATH of any machine you want to have 'sdn' on.
2020-10-27 04:05:54 +01:00
Configuration
-------------
For a slightly more technical explanation please refer to manual pages.
2020-10-01 04:07:56 +02:00
Integration
2020-10-27 04:05:54 +01:00
~~~~~~~~~~~
2020-10-21 08:18:39 +02:00
The package contains an installation script called 'sdn-install' which will bind
2020-10-21 08:34:32 +02:00
'sdn' to Alt-o in your shell's initialisation file. The supported shells are:
2020-10-01 04:07:56 +02:00
2020-10-21 08:18:39 +02:00
- *zsh*: works well
- *bash*: minor issue: exiting the navigator confirms an empty prompt
- *fish*: works well
- *elvish*: version 0.14.1 and above, an unstable API is used, works well
2020-10-27 01:16:07 +01:00
+
2020-10-21 08:18:39 +02:00
elvish is absolutely perverse. And so is integrating 'sdn' into it because it
already includes a custom file manager, bound to Ctrl-N (though I find the
ranger-like interface confusing and resource-demanding).
2020-10-07 20:49:58 +02:00
Colours
2020-10-01 04:07:56 +02:00
~~~~~~~
2017-06-30 21:29:10 +02:00
Here is an example of a '~/.config/sdn/look' file; the format is similar to
that of git, only named colours aren't supported:
2020-08-28 18:33:08 +02:00
....
2017-06-30 21:29:10 +02:00
cursor 231 202
2024-12-30 19:36:51 +01:00
select 202 bold
2017-06-30 21:29:10 +02:00
bar 16 255 ul
input
2020-10-01 13:31:39 +02:00
cmdline 145
2020-08-28 18:33:08 +02:00
....
2026-07-24 10:37:49 +02:00
The left side of the status bar defaults to the current working directory.
Add a line such as the following to '~/.config/sdn/config' to show
'user@host' with a tilde-shortened path instead:
....
status '%u@%h %B%~%b'
....
Filename colours are taken from the `LS_COLORS` environment variable.
2018-11-03 17:04:50 +01:00
Run `dircolors` to get some defaults.
2017-06-30 21:29:10 +02:00
Bindings
2020-10-01 04:07:56 +02:00
~~~~~~~~
To obtain more vifm-like controls, you may write the following to your
'~/.config/sdn/bindings' file:
....
normal h parent
2024-12-30 19:36:51 +01:00
normal l enter
....
Helper programs
2020-10-01 04:07:56 +02:00
~~~~~~~~~~~~~~~
2026-08-04 04:58:21 +02:00
The F3, S-F3 (F13/F15), F4, S-F4 (F14/F16) keys are normally bound to actions
'view', 'view-raw', 'edit', and 'edit-raw', similarly to Norton Commander
and other orthodox file managers. The helper programs used here may be changed
by setting the PAGER and VISUAL (or EDITOR) environment variables.
2024-12-30 19:36:51 +01:00
2026-01-27 17:23:21 +01:00
If 'view' and 'edit' find Midnight Commander, they will make use of its
configuration to apply any matching filter, such as to produce archive listings,
2024-12-30 19:36:51 +01:00
or it will run the respective command.
While it is mostly possible to get 'mcview' working using an invocation like
`PAGER='mcview -u' sdn`, beware that this helper cannot read files from its
standard input, nor does it enable overstrike processing by default (F9, could
be hacked around in 'mc.ext' by turning on the `nroff` switch for a custom file
extension, just without actually invoking 'nroff'), and thus it can't show the
program help. 'sdn' is currently optimised for 'less' as the pager.
2026-07-31 12:59:22 +02:00
Notes
-----
I wanted to try a different, simpler approach with this project, and the end
result is very friendly to tinkering.
2017-06-29 02:50:39 +02:00
Contributing and Support
------------------------
2018-06-22 15:39:38 +02:00
Use https://git.janouch.name/p/sdn to report any bugs, request features,
or submit pull requests. `git send-email` is tolerated. If you want to discuss
the project, feel free to join me at ircs://irc.janouch.name, channel #dev.
2017-06-29 02:50:39 +02:00
2018-06-22 15:39:38 +02:00
Bitcoin donations are accepted at: 12r5uEWEgcHC46xd64tt3hHt9EUvYYDHe9
2017-06-29 02:50:39 +02:00
License
-------
2018-06-22 15:35:58 +02:00
This software is released under the terms of the 0BSD license, the text of which
is included within the package along with the list of authors.