An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

…/P/A/T/H/shortener


File system's path shortener


License: GPL-3.0 Development completed

## 💡 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


>
>

Buy Me a Coffee