Giter VIP home page Giter VIP logo

terminal-explorer's Introduction

๐Ÿ“ข Check out the alternative flexible approach!

Terminal Explorer

Bring file manager's copy/paste to the CLI

License: GPL-3.0 Development completed

๐Ÿ’ก About

Terminal explorer is a files manager tool written in portable sh that mimics the way GUI's file manager do copy/cut/paste.

โœจ Features

  • Minimum: with exactly 269 lines of sh and minimum dependencies.
  • Register: you can operate in any specific register.
  • Smart cut: after cutting the file to a new path, the file's new path will be automatically copied for future operation.
  • Customizable: you can change the commands to set/get the clipboard, commands to copy/cut files, see more here.

๐Ÿš€ Setup

๐Ÿงพ Dependencies

๐Ÿ“ฅ Installation

๐Ÿ”ง Manually

Option 1: using curl

curl https://raw.githubusercontent.com/NNBnh/terminal-explorer/main/bin/te > ~/.local/bin/te
chmod +x ~/.local/bin/te

Option 2: using git

git clone https://github.com/NNBnh/terminal-explorer.git ~/.local/share/terminal-explorer
ln -s ~/.local/share/terminal-explorer/bin/te ~/.local/bin/te

๐Ÿ“ฆ Package manager

For Bpkg user:

bpkg install NNBnh/terminal-explorer

For Basher user:

basher install NNBnh/terminal-explorer

Note If you can and want to port Terminal explorer to other package managers, feel free to do so.

โŒจ๏ธ Usage

Run te in the terminal:

te ACTION[REGISTER] FILES

or:

te PASTE[REGISTER] [COMMAND]
ACTION:
  c, y          copy FILES into REGISTER's clipboard and set paste's action to copy
  x, d          copy FILES into REGISTER's clipboard and set paste's action to cut
  l, s          copy FILES into REGISTER's clipboard and set paste's action to symlink
  h             copy FILES into REGISTER's clipboard and set paste's action to hardlink
PASTE:
  v, V, p, P    paste FILES from REGISTER's clipboard, using custom COMMAND if defined
  C, Y          ignore paste's action, copy     FILES from REGISTER's clipboard
  X, D          ignore paste's action, cut      FILES from REGISTER's clipboard
  L, S          ignore paste's action, symlink  FILES from REGISTER's clipboard
  H             ignore paste's action, hardlink FILES from REGISTER's clipboard
REGISTER if leave empty will use system clipboard,
otherwise it's name can be anything that doesn't include '/'.

Examples:

~/
โ”œโ”€ 1/
โ”œโ”€ 2/
โ”œโ”€ foo
โ””โ”€ bar
cd ~/
te x foo      # Cut foo
te ctest bar  # Copy bar to 'test' register

cd ~/1/
te p      # Paste foo then copy ~/1/foo
te ptest  # Paste bar from 'test' register
te ptest  # Paste bar from 'test' register again

cd ~/2/
te p # Paste foo from ~/1/foo

Result:

~/
โ”œโ”€ 1/
โ”‚ โ”œโ”€ foo
โ”‚ โ”œโ”€ bar
โ”‚ โ””โ”€ bar (2)
โ”‚
โ”œโ”€ 2/
โ”‚ โ””โ”€ foo
โ”‚
โ””โ”€ bar

โš™๏ธ Configuration

Terminal explorer is configured through environment variables: export TERMINALEXPLORER_<SETTING>="<value>"

Value Validity Default Description
TERMINALEXPLORER_CLIPBOARD_SET_COMMAND <commands> clipb copy Command to set the clipboard
TERMINALEXPLORER_CLIPBOARD_GET_COMMAND <commands> clipb paste Command to get the clipboard
TERMINALEXPLORER_COPY_COMMAND <commands> cp Command to copy files
TERMINALEXPLORER_CUT_COMMAND <commands> mv Command to cut files
TERMINALEXPLORER_TEMPORARY <path/to/file> /tmp/terminal-explorer Temporary file's location

Examples:

export TERMINALEXPLORER_CLIPBOARD_SET_COMMAND='xclip -in -selection clipboard'
export TERMINALEXPLORER_CLIPBOARD_GET_COMMAND='xclip -out -selection clipboard'
export TERMINALEXPLORER_COPY_COMMAND='rsync --recursive --archive -hh --partial --info=stats1 --info=progress2 --modify-window=1'
export TERMINALEXPLORER_CUT_COMMAND='rsync --recursive --archive -hh --partial --info=stats1 --info=progress2 --modify-window=1 --remove-source-files'

๐Ÿ’Œ Credits

Special thanks to:






Made with โค๏ธ by NNB

Buy Me a Coffee

terminal-explorer's People

Contributors

nnbnh avatar techwiz-3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

techwiz-3

terminal-explorer's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.