https://github.com/info-mono/pathshortener
✂️ File system's path shortener
https://github.com/info-mono/pathshortener
basher bpkg cli info-mono path path-shortener posix shortener terminal
Last synced: 4 months ago
JSON representation
✂️ File system's path shortener
- Host: GitHub
- URL: https://github.com/info-mono/pathshortener
- Owner: info-mono
- License: gpl-3.0
- Created: 2021-05-08T14:52:26.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-08T09:05:46.000Z (almost 4 years ago)
- Last Synced: 2025-02-24T05:28:27.946Z (8 months ago)
- Topics: basher, bpkg, cli, info-mono, path, path-shortener, posix, shortener, terminal
- Language: Shell
- Homepage:
- Size: 34.2 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
…/P/A/T/H/shortener
File system's path shortener
## 💡 About
`pathshortener` is a file system's path shortener written in [`portable sh`](https://github.com/dylanaraps/pure-sh-bible) inspired by [Fish's `prompt_pwd` command](https://fishshell.com/docs/current/cmds/prompt_pwd.html) and [Starship's Directory module](https://starship.rs/config/#directory).## 🚀 Setup
### 🧾 Dependencies
- [Unix commands](https://en.wikipedia.org/wiki/List_of_Unix_commands) to process### 📥 Installation
#### 🔧 Manually
Option 1: using `curl`
```sh
curl https://raw.githubusercontent.com/info-mono/pathshortener/main/bin/pathshortener > ~/.local/bin/pathshortener
chmod +x ~/.local/bin/pathshortener
```Option 2: using `git`
```sh
git clone https://github.com/info-mono/pathshortener.git ~/.local/share/pathshortener
ln -s ~/.local/share/pathshortener/bin/pathshortener ~/.local/bin/pathshortener
```#### 📦 Package manager
For [Bpkg](https://github.com/bpkg/bpkg) user:
```sh
bpkg install info-mono/pathshortener
```For [Basher](https://github.com/basherpm/basher) user:
```sh
basher install info-mono/pathshortener
```> *If you can and want to port Pathshortener to other package managers, feel free to do so.*
## ⌨️ Usage
Run 'pathshortener' in the terminal:
```sh
pathshortener PATHS
```## ⚙️ Configuration
Pathshortener is configured through environment variables: `export PATHSHORTENER_=""`
|Value |Valid |Default|Description |
|---------------------------------|-----------|-------|------------------------------------------------------------------------------------------------------|
|`PATHSHORTENER_TRUNCATION_LENGTH`|``|`3` |The number of parent folders that the current directory should be truncated to (set to `0` to disable)|
|`PATHSHORTENER_SHORT_LENGTH` |``|`0` |The number of characters to display in truncated paths |
|`PATHSHORTENER_TRUNCATION_SYMBOL`|`` |`…/` |The symbol to prefix to truncated paths |
|`PATHSHORTENER_HOME_SYMBOL` |`` |`~` |The symbol indicating home directory |## 💌 Credits
Special thanks to:
- [**Fish**](https://fishshell.com/docs/current/cmds/fish_status_to_signal.html) by [it's contributors](https://github.com/fish-shell/fish-shell/graphs/contributors)
- [**Starship**](https://starship.rs) by [it's contributors](https://github.com/starship/starship/graphs/contributors)
---
>
Made with ❤️ by
@info-mono
>
>