TermuxC 2.0.7__tar.gz → 2.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,21 @@
1
+ Metadata-Version: 2.4
2
+ Name: TermuxC
3
+ Version: 2.2.0
4
+ Summary: A lightweight utility to copy text to the device clipboard using OSC 52.
5
+ Author: Ruizennis
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/Ruizennis/TermuxC
8
+ Project-URL: Issues, https://github.com/Ruizennis/TermuxC/issues
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Classifier: Environment :: Console
13
+ Classifier: Topic :: Utilities
14
+ Requires-Python: >=3.7
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Dynamic: license-file
18
+
1
19
  # TermuxC
2
20
  ### Termux copy to clipboard made easy.
3
21
  ## Also known as TermuxCopy
@@ -7,13 +25,13 @@
7
25
  [![PyPI downloads](https://img.shields.io/pypi/dm/TermuxC.svg)](https://pypi.org/project/TermuxC/)
8
26
 
9
27
 
10
- 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.
28
+ 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.
11
29
 
12
30
  ## Cli Tool Usage:
13
31
 
14
32
  ### Copy text
15
33
  ```bash
16
- termux text
34
+ termuxc text
17
35
  ```
18
36
  **Or**
19
37
  ```bash
@@ -27,7 +45,7 @@ cat filename | termuxc
27
45
  ```bash
28
46
  pwd | termuxc
29
47
  ```
30
- Also compatable with
48
+ Also compatible with
31
49
  - bat
32
50
  - grep
33
51
  - curl
@@ -60,7 +78,7 @@ Copy(os.getcwd())
60
78
  ## Installation
61
79
  Install pip package
62
80
  ```bash
63
- pkg install TermuxC
81
+ pip install TermuxC
64
82
  ```
65
83
 
66
84
  ## Uninstallation
@@ -73,29 +91,8 @@ pip uninstall TermuxC
73
91
 
74
92
  Get Python from https://www.python.org!
75
93
 
76
- View Package here https://pypi.org/project/TermuxC/
94
+ View Package here! https://pypi.org/project/TermuxC/
77
95
 
78
- ## Aware:
79
- If using terminal multiplexers such as **Tmux** or **Screen** ensure they allow **OSC 52**.
80
96
 
81
97
  ### Tmux support
82
- run this command to allow tmux to write to device clipboard
83
- ```bash
84
- CONFIG_FILE=$( [ -d "$HOME/.config/tmux" ] \
85
- && echo "$HOME/.config/tmux/tmux.conf" \
86
- || echo "$HOME/.tmux.conf" ) ; \
87
- printf "\n# Enable clipboard and passthrough\nset -s set-clipboard on\nset -g allow-passthrough on\n" >> "$CONFIG_FILE" \
88
- && tmux kill-server 2>/dev/null \
89
- || true
90
- ```
91
-
92
- ### Screen support
93
- run this command to allow Screen to write to clipboard
94
- ```bash
95
- CONFIG_FILE=$( [ -f "$HOME/.screenrc" ] \
96
- && echo "$HOME/.screenrc" \
97
- || echo "$HOME/.screenrc" ) ; \
98
- printf "\n# Enable clipboard and passthrough\nregister [ \"\nbind ] paste [\n" >> "$CONFIG_FILE" \
99
- && screen -wipe >/dev/null 2>&1 \
100
- || true
101
- ```
98
+ As of version **2.2.0** TermuxC has native tmux support!
@@ -0,0 +1,80 @@
1
+ # TermuxC
2
+ ### Termux copy to clipboard made easy.
3
+ ## Also known as TermuxCopy
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![Python Version](https://img.shields.io/badge/python-3.6%2B-blue.svg)](https://www.python.org)
6
+ [![PyPI version](https://img.shields.io/pypi/v/TermuxC.svg?color=blue)](https://pypi.org/project/TermuxC/)
7
+ [![PyPI downloads](https://img.shields.io/pypi/dm/TermuxC.svg)](https://pypi.org/project/TermuxC/)
8
+
9
+
10
+ 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.
11
+
12
+ ## Cli Tool Usage:
13
+
14
+ ### Copy text
15
+ ```bash
16
+ termuxc text
17
+ ```
18
+ **Or**
19
+ ```bash
20
+ echo "test" | termuxc
21
+ ```
22
+ ### Copy text from file
23
+ ```bash
24
+ cat filename | termuxc
25
+ ```
26
+ ### Copy current working directory
27
+ ```bash
28
+ pwd | termuxc
29
+ ```
30
+ Also compatible with
31
+ - bat
32
+ - grep
33
+ - curl
34
+ - head
35
+ - tail
36
+ ## Pip package Usage:
37
+
38
+ ### Copy text
39
+ ```python
40
+ from TermuxC import Copy
41
+ Copy("Str") #works with strings,
42
+ Copy(1) # numbers
43
+ Copy(1.3) # and floats!
44
+ ```
45
+
46
+ ### Copy text from file
47
+ ```python
48
+ from TermuxC import Copy
49
+ with open("TermuxC.py", "r") as f:
50
+ content = f.read()
51
+ Copy(content)
52
+ ```
53
+ ### Copy current working directory
54
+ ```python
55
+ from TermuxC import Copy
56
+ import os
57
+ Copy(os.getcwd())
58
+ ```
59
+
60
+ ## Installation
61
+ Install pip package
62
+ ```bash
63
+ pip install TermuxC
64
+ ```
65
+
66
+ ## Uninstallation
67
+ ```bash
68
+ pip uninstall TermuxC
69
+ ```
70
+
71
+ ## Requirements:
72
+ **Python 3+**
73
+
74
+ Get Python from https://www.python.org!
75
+
76
+ View Package here! https://pypi.org/project/TermuxC/
77
+
78
+
79
+ ### Tmux support
80
+ As of version **2.2.0** TermuxC has native tmux support!
@@ -4,10 +4,11 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "TermuxC"
7
- version = "2.0.7"
7
+ version = "2.2.0"
8
8
  description = "A lightweight utility to copy text to the device clipboard using OSC 52."
9
9
  authors = [{name = "Ruizennis"}]
10
10
  requires-python = ">=3.7"
11
+ readme = "README.md"
11
12
  license = {text = "MIT"}
12
13
  classifiers = [
13
14
  "Programming Language :: Python :: 3",
@@ -0,0 +1,95 @@
1
+ # TermuxC aka Termux copy, view README.md for more info
2
+ # Copyright (c) 2026 Ruizennis
3
+ # This software is licensed under the MIT License.
4
+ # See the LICENSE file or https://opensource.org/licenses/MIT for full terms.
5
+ import base64
6
+ import sys
7
+ import os
8
+ from time import sleep
9
+ from threading import Lock
10
+ # configuration
11
+ Sleeptime = 0.5
12
+ help = {'-h', '--help', '-help'}
13
+ help_message = '''
14
+ Usage:
15
+
16
+ Copying text with cli
17
+ termuxc Test!
18
+ OR
19
+ echo "<text>" | Termuxc
20
+
21
+ Copying a number with cli
22
+ termuxc <number>
23
+
24
+ Copying filecontents with cli
25
+ cat <file> | Termuxc
26
+ (replace <file> with desired file path)
27
+
28
+ Using pip package to copy text
29
+ from TermuxC import Copy
30
+ Copy('<text>')
31
+
32
+ Using pip package to copy number
33
+ from TermuxC import Copy
34
+ Copy(<number>)
35
+
36
+ Using Pip package to text copy from file
37
+ from TermuxC import Copy
38
+ with open(filename, 'r') as F:
39
+ C = F.read()
40
+ Copy(C)
41
+
42
+ for more help see https://github.com/Ruizennis/TermuxC
43
+ '''
44
+ #New: added tmux support natively
45
+ def check_for_tmux():
46
+ if "TMUX" in os.environ:
47
+ return True #using tmux
48
+ else:
49
+ return False #normal code
50
+
51
+
52
+ lock = Lock()
53
+
54
+ def Copy(string):
55
+ with lock:
56
+ content = str(string)
57
+ b64 = base64.b64encode(content.encode('utf-8')).decode('ascii')
58
+ multiplexor = check_for_tmux()
59
+ if multiplexor:
60
+ tmuxpath = os.path.expanduser('~/.tmux.conf')
61
+ content = ''
62
+ if os.path.exists(tmuxpath):
63
+ with open(tmuxpath, 'r') as file_read:
64
+ content = file_read.read()
65
+ if not "allow-passthrough" in content:
66
+ with open(tmuxpath, 'a') as file:
67
+ file.write("\nset -g allow-passthrough on\n")
68
+ os.system(f"tmux source-file {tmuxpath} >/dev/null 2>&1")
69
+ write_code = f"\033Ptmux;\033\033]52;c;{b64}\a\033\\" # special tmux osc command
70
+ else:
71
+ write_code = f"\033]52;c;{b64}\a"
72
+ sys.stdout.write(write_code)
73
+ sys.stdout.flush()
74
+ sleep(Sleeptime)
75
+
76
+ def main():
77
+ if not sys.stdin.isatty():
78
+ readstdin = sys.stdin.read()
79
+ if readstdin.endswith('\n'):
80
+ readstdin = readstdin[:-1]
81
+ if readstdin:
82
+ Copy(readstdin)
83
+ sys.exit(0)
84
+ else:
85
+ print('Please provide an input', file=sys.stderr)
86
+ sys.exit(1)
87
+ elif help.intersection(sys.argv):
88
+ print(help_message)
89
+ sys.exit(0)
90
+ elif len(sys.argv) > 1:
91
+ Copy(' '.join(sys.argv[1:]))
92
+ sys.exit(0)
93
+ else:
94
+ print('Please provide at least 1 argument or run termuxc --help for help.', file=sys.stderr)
95
+ sys.exit(1)
@@ -0,0 +1,98 @@
1
+ Metadata-Version: 2.4
2
+ Name: TermuxC
3
+ Version: 2.2.0
4
+ Summary: A lightweight utility to copy text to the device clipboard using OSC 52.
5
+ Author: Ruizennis
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/Ruizennis/TermuxC
8
+ Project-URL: Issues, https://github.com/Ruizennis/TermuxC/issues
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Classifier: Environment :: Console
13
+ Classifier: Topic :: Utilities
14
+ Requires-Python: >=3.7
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Dynamic: license-file
18
+
19
+ # TermuxC
20
+ ### Termux copy to clipboard made easy.
21
+ ## Also known as TermuxCopy
22
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
23
+ [![Python Version](https://img.shields.io/badge/python-3.6%2B-blue.svg)](https://www.python.org)
24
+ [![PyPI version](https://img.shields.io/pypi/v/TermuxC.svg?color=blue)](https://pypi.org/project/TermuxC/)
25
+ [![PyPI downloads](https://img.shields.io/pypi/dm/TermuxC.svg)](https://pypi.org/project/TermuxC/)
26
+
27
+
28
+ 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.
29
+
30
+ ## Cli Tool Usage:
31
+
32
+ ### Copy text
33
+ ```bash
34
+ termuxc text
35
+ ```
36
+ **Or**
37
+ ```bash
38
+ echo "test" | termuxc
39
+ ```
40
+ ### Copy text from file
41
+ ```bash
42
+ cat filename | termuxc
43
+ ```
44
+ ### Copy current working directory
45
+ ```bash
46
+ pwd | termuxc
47
+ ```
48
+ Also compatible with
49
+ - bat
50
+ - grep
51
+ - curl
52
+ - head
53
+ - tail
54
+ ## Pip package Usage:
55
+
56
+ ### Copy text
57
+ ```python
58
+ from TermuxC import Copy
59
+ Copy("Str") #works with strings,
60
+ Copy(1) # numbers
61
+ Copy(1.3) # and floats!
62
+ ```
63
+
64
+ ### Copy text from file
65
+ ```python
66
+ from TermuxC import Copy
67
+ with open("TermuxC.py", "r") as f:
68
+ content = f.read()
69
+ Copy(content)
70
+ ```
71
+ ### Copy current working directory
72
+ ```python
73
+ from TermuxC import Copy
74
+ import os
75
+ Copy(os.getcwd())
76
+ ```
77
+
78
+ ## Installation
79
+ Install pip package
80
+ ```bash
81
+ pip install TermuxC
82
+ ```
83
+
84
+ ## Uninstallation
85
+ ```bash
86
+ pip uninstall TermuxC
87
+ ```
88
+
89
+ ## Requirements:
90
+ **Python 3+**
91
+
92
+ Get Python from https://www.python.org!
93
+
94
+ View Package here! https://pypi.org/project/TermuxC/
95
+
96
+
97
+ ### Tmux support
98
+ As of version **2.2.0** TermuxC has native tmux support!
termuxc-2.0.7/PKG-INFO DELETED
@@ -1,16 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: TermuxC
3
- Version: 2.0.7
4
- Summary: A lightweight utility to copy text to the device clipboard using OSC 52.
5
- Author: Ruizennis
6
- License: MIT
7
- Project-URL: Homepage, https://github.com/Ruizennis/TermuxC
8
- Project-URL: Issues, https://github.com/Ruizennis/TermuxC/issues
9
- Classifier: Programming Language :: Python :: 3
10
- Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Operating System :: POSIX :: Linux
12
- Classifier: Environment :: Console
13
- Classifier: Topic :: Utilities
14
- Requires-Python: >=3.7
15
- License-File: LICENSE
16
- Dynamic: license-file
@@ -1,72 +0,0 @@
1
- # TermuxC aka Termux copy, view README.md for more info
2
- # Copyright (c) 2026 Ruizennis
3
- # This software is licensed under the MIT License.
4
- # See the root LICENSE file or https://opensource.org/licenses/MIT for full terms.
5
- import base64
6
- import sys
7
- from time import sleep
8
- from threading import Lock
9
- # configuration
10
- Sleeptime = 0.5
11
- help = {'-h', '--help', '-help'}
12
- help_message = '''
13
- Usage:
14
-
15
- Copying text with cli
16
- termuxc Test!
17
- OR
18
- echo "test" | Termuxc
19
-
20
- Copying a number with cli
21
- termuxc 1
22
-
23
- Copying filecontents with cli
24
- cat Filename | Termuxc
25
- (replace filename with desired file path)
26
-
27
- Using pip package to copy text
28
- from TermuxC import Copy
29
- Copy('test')
30
-
31
- Using pip package to copy number
32
- from TermuxC import Copy
33
- Copy(1)
34
-
35
- Using Pip package to text copy from file
36
- from TermuxC import Copy
37
- with open(filename, 'r') as F:
38
- C = F.read()
39
- Copy(C)
40
-
41
- for more help see https://github.com/Ruizennis/TermuxC
42
- '''
43
- lock = Lock()
44
-
45
- def Copy(string):
46
- with lock:
47
- content = str(string)
48
- b64 = base64.b64encode(content.encode('utf-8')).decode('ascii')
49
- sys.stdout.write(f"\033]52;c;{b64}\a")
50
- sys.stdout.flush()
51
- sleep(Sleeptime)
52
-
53
- def main():
54
- if not sys.stdin.isatty():
55
- readstdin = sys.stdin.read()
56
- if readstdin.endswith('\n'):
57
- readstdin = readstdin[:-1]
58
- if readstdin:
59
- Copy(readstdin)
60
- sys.exit(0)
61
- else:
62
- print('Please provide an input')
63
- sys.exit(0)
64
- elif help.intersection(sys.argv):
65
- print(help_message)
66
- sys.exit(0)
67
- elif len(sys.argv) > 1:
68
- Copy(' '.join(sys.argv[1:]))
69
- sys.exit(0)
70
- else:
71
- print('Please provide atleast 1 argument or run termuxc --help for help.')
72
- sys.exit(0)
@@ -1,16 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: TermuxC
3
- Version: 2.0.7
4
- Summary: A lightweight utility to copy text to the device clipboard using OSC 52.
5
- Author: Ruizennis
6
- License: MIT
7
- Project-URL: Homepage, https://github.com/Ruizennis/TermuxC
8
- Project-URL: Issues, https://github.com/Ruizennis/TermuxC/issues
9
- Classifier: Programming Language :: Python :: 3
10
- Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Operating System :: POSIX :: Linux
12
- Classifier: Environment :: Console
13
- Classifier: Topic :: Utilities
14
- Requires-Python: >=3.7
15
- License-File: LICENSE
16
- Dynamic: license-file
File without changes
File without changes