Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TermuxC

Termux Copy To Clipboard Made simple.

Also known as TermuxCopy

License: MIT Python Version PyPI version PyPI downloads

This dual function pip package & cli tool was made to solve an issue with Termux, not allowing copying to device clipboard easily without their companion app; This package solves that.

Table of Contents

Why use TermuxC?

  • Allows coping from files or text using OSC52
  • Allows piping data
  • Requires Zero external dependencies; no extra pip packages required
  • Designed specifically to work on Termux
  • Termux API app is not required

Installation

Install using pip

pip install TermuxC

Install using git

git clone https://github.com/Ruizennis/TermuxC
cd TermuxC

Quick Start

Once you install TermuxC you can start easily copying text using the termuxc cli.

termuxc hi!

This will copy "hi!" to your device clipboard.

Cli Tool Usage:

Copy text

termuxc text

Or

echo "test" | termuxc

Copy text from file

cat filename | termuxc

Copy text from file using the read from file flag

termuxc -f filename

Copy current working directory

pwd | termuxc

Also compatible with

  • bat
  • grep
  • curl
  • head
  • tail
  • ls

And other stdin based cli tools!

Pip package Usage:

Copy text

from TermuxC import copy
copy("Str") # works with strings,
copy(1) # numbers,
copy(1.3) # and floats!

Copy text from file

from TermuxC import copy
with open("filename", "r") as f:
    content = f.read()
    copy(content)

Copy current working directory

from TermuxC import copy
import os
copy(os.getcwd())

Flags

Flag Function
-f Read from file
-i Interactive mode
-v Enable verbose output
-h Show help menu
-V Show package version

Additional flag aliases

  • --file
  • --interactive
  • --verbose
  • --help
  • --version

Handling special characters

Some text may get interpreted incorrectly by the bash (or zsh) interpreter, to fix this issue wrap your text in single or double quotes

Incorrect:

termuxc (

This will throw an error!

Correct:

termuxc "("

This will copy the text successfully!

Requirements:

Python 3.10+

Links

Troubleshooting

Python Runtime Issues

Ensure your Python version is above 3.10.

Version flag issues

Ensure you've downloaded the package directly from PyPi.

Tmux support

To allow TermuxC to work inside of termux add "set -g allow-passthrough on" to your tmux configuration file.


License

This project is licensed under the MIT license, see LICENSE

About

Python Pip package that makes copying text to clipboard effortless, requires no dependency installs [Python 3.10+]

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages