clipsy 1.5.0__tar.gz → 1.6.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.
Files changed (26) hide show
  1. {clipsy-1.5.0/src/clipsy.egg-info → clipsy-1.6.0}/PKG-INFO +18 -17
  2. {clipsy-1.5.0 → clipsy-1.6.0}/README.md +17 -16
  3. {clipsy-1.5.0 → clipsy-1.6.0}/pyproject.toml +1 -1
  4. {clipsy-1.5.0 → clipsy-1.6.0}/src/clipsy/__init__.py +1 -1
  5. clipsy-1.6.0/src/clipsy/__main__.py +188 -0
  6. {clipsy-1.5.0 → clipsy-1.6.0/src/clipsy.egg-info}/PKG-INFO +18 -17
  7. clipsy-1.5.0/src/clipsy/__main__.py +0 -26
  8. {clipsy-1.5.0 → clipsy-1.6.0}/LICENSE +0 -0
  9. {clipsy-1.5.0 → clipsy-1.6.0}/setup.cfg +0 -0
  10. {clipsy-1.5.0 → clipsy-1.6.0}/src/clipsy/app.py +0 -0
  11. {clipsy-1.5.0 → clipsy-1.6.0}/src/clipsy/config.py +0 -0
  12. {clipsy-1.5.0 → clipsy-1.6.0}/src/clipsy/models.py +0 -0
  13. {clipsy-1.5.0 → clipsy-1.6.0}/src/clipsy/monitor.py +0 -0
  14. {clipsy-1.5.0 → clipsy-1.6.0}/src/clipsy/redact.py +0 -0
  15. {clipsy-1.5.0 → clipsy-1.6.0}/src/clipsy/storage.py +0 -0
  16. {clipsy-1.5.0 → clipsy-1.6.0}/src/clipsy/utils.py +0 -0
  17. {clipsy-1.5.0 → clipsy-1.6.0}/src/clipsy.egg-info/SOURCES.txt +0 -0
  18. {clipsy-1.5.0 → clipsy-1.6.0}/src/clipsy.egg-info/dependency_links.txt +0 -0
  19. {clipsy-1.5.0 → clipsy-1.6.0}/src/clipsy.egg-info/entry_points.txt +0 -0
  20. {clipsy-1.5.0 → clipsy-1.6.0}/src/clipsy.egg-info/requires.txt +0 -0
  21. {clipsy-1.5.0 → clipsy-1.6.0}/src/clipsy.egg-info/top_level.txt +0 -0
  22. {clipsy-1.5.0 → clipsy-1.6.0}/tests/test_app.py +0 -0
  23. {clipsy-1.5.0 → clipsy-1.6.0}/tests/test_monitor.py +0 -0
  24. {clipsy-1.5.0 → clipsy-1.6.0}/tests/test_redact.py +0 -0
  25. {clipsy-1.5.0 → clipsy-1.6.0}/tests/test_storage.py +0 -0
  26. {clipsy-1.5.0 → clipsy-1.6.0}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clipsy
3
- Version: 1.5.0
3
+ Version: 1.6.0
4
4
  Summary: Lightweight clipboard history manager for macOS
5
5
  Author-email: Brendan Conrad <brendan.conrad@gmail.com>
6
6
  License: MIT
@@ -59,10 +59,19 @@ A lightweight clipboard history manager for macOS. Runs as a menu bar icon — n
59
59
 
60
60
  ## Installation
61
61
 
62
- ### Via pip (recommended)
62
+ ### Via pipx (recommended)
63
+
64
+ ```bash
65
+ brew install pipx
66
+ pipx install clipsy
67
+ clipsy install
68
+ ```
69
+
70
+ ### Via pip
63
71
 
64
72
  ```bash
65
73
  pip install clipsy
74
+ clipsy install
66
75
  ```
67
76
 
68
77
  ### From source
@@ -72,14 +81,12 @@ git clone https://github.com/brencon/clipsy.git
72
81
  cd clipsy
73
82
  python3 -m venv .venv
74
83
  .venv/bin/pip install -e .
84
+ .venv/bin/clipsy install
75
85
  ```
76
86
 
77
87
  ## Usage
78
88
 
79
- ```bash
80
- # Run clipsy (a scissors icon appears in your menu bar)
81
- clipsy
82
- ```
89
+ After running `clipsy install`, the app runs in the background and starts automatically on login. A scissors icon (✂️) appears in your menu bar.
83
90
 
84
91
  Then just use your Mac normally. Every time you copy something, it shows up in the Clipsy menu:
85
92
 
@@ -102,19 +109,13 @@ Then just use your Mac normally. Every time you copy something, it shows up in t
102
109
  └── Quit Clipsy
103
110
  ```
104
111
 
105
- ## Auto-Start on Login
106
-
107
- Run clipsy automatically when you log in — no terminal needed:
112
+ ## Commands
108
113
 
109
114
  ```bash
110
- # Install as a LaunchAgent
111
- scripts/install_launchagent.sh install
112
-
113
- # Check status
114
- scripts/install_launchagent.sh status
115
-
116
- # Remove auto-start
117
- scripts/install_launchagent.sh uninstall
115
+ clipsy install # Install as background service (starts on login)
116
+ clipsy uninstall # Remove from login items
117
+ clipsy status # Check if running
118
+ clipsy # Run in foreground (for debugging)
118
119
  ```
119
120
 
120
121
  ## Data Storage
@@ -28,10 +28,19 @@ A lightweight clipboard history manager for macOS. Runs as a menu bar icon — n
28
28
 
29
29
  ## Installation
30
30
 
31
- ### Via pip (recommended)
31
+ ### Via pipx (recommended)
32
+
33
+ ```bash
34
+ brew install pipx
35
+ pipx install clipsy
36
+ clipsy install
37
+ ```
38
+
39
+ ### Via pip
32
40
 
33
41
  ```bash
34
42
  pip install clipsy
43
+ clipsy install
35
44
  ```
36
45
 
37
46
  ### From source
@@ -41,14 +50,12 @@ git clone https://github.com/brencon/clipsy.git
41
50
  cd clipsy
42
51
  python3 -m venv .venv
43
52
  .venv/bin/pip install -e .
53
+ .venv/bin/clipsy install
44
54
  ```
45
55
 
46
56
  ## Usage
47
57
 
48
- ```bash
49
- # Run clipsy (a scissors icon appears in your menu bar)
50
- clipsy
51
- ```
58
+ After running `clipsy install`, the app runs in the background and starts automatically on login. A scissors icon (✂️) appears in your menu bar.
52
59
 
53
60
  Then just use your Mac normally. Every time you copy something, it shows up in the Clipsy menu:
54
61
 
@@ -71,19 +78,13 @@ Then just use your Mac normally. Every time you copy something, it shows up in t
71
78
  └── Quit Clipsy
72
79
  ```
73
80
 
74
- ## Auto-Start on Login
75
-
76
- Run clipsy automatically when you log in — no terminal needed:
81
+ ## Commands
77
82
 
78
83
  ```bash
79
- # Install as a LaunchAgent
80
- scripts/install_launchagent.sh install
81
-
82
- # Check status
83
- scripts/install_launchagent.sh status
84
-
85
- # Remove auto-start
86
- scripts/install_launchagent.sh uninstall
84
+ clipsy install # Install as background service (starts on login)
85
+ clipsy uninstall # Remove from login items
86
+ clipsy status # Check if running
87
+ clipsy # Run in foreground (for debugging)
87
88
  ```
88
89
 
89
90
  ## Data Storage
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "clipsy"
7
- version = "1.5.0"
7
+ version = "1.6.0"
8
8
  description = "Lightweight clipboard history manager for macOS"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -1,2 +1,2 @@
1
- __version__ = "1.5.0"
1
+ __version__ = "1.6.0"
2
2
  __app_name__ = "Clipsy"
@@ -0,0 +1,188 @@
1
+ import argparse
2
+ import logging
3
+ import os
4
+ import subprocess
5
+ import sys
6
+ from pathlib import Path
7
+
8
+ from clipsy.config import LOG_PATH
9
+ from clipsy.utils import ensure_dirs
10
+
11
+ PLIST_NAME = "com.clipsy.app.plist"
12
+ LAUNCHAGENT_DIR = Path.home() / "Library" / "LaunchAgents"
13
+ PLIST_PATH = LAUNCHAGENT_DIR / PLIST_NAME
14
+
15
+
16
+ def get_clipsy_path() -> str:
17
+ """Get the path to the clipsy executable."""
18
+ import shutil
19
+
20
+ # Check if we're running from an installed location
21
+ clipsy_path = shutil.which("clipsy")
22
+ if clipsy_path:
23
+ return clipsy_path
24
+ # Fallback to current Python module
25
+ return f"{sys.executable} -m clipsy"
26
+
27
+
28
+ def create_plist(clipsy_path: str) -> str:
29
+ """Generate the LaunchAgent plist content."""
30
+ data_dir = Path.home() / ".local" / "share" / "clipsy"
31
+ return f"""<?xml version="1.0" encoding="UTF-8"?>
32
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
+ <plist version="1.0">
34
+ <dict>
35
+ <key>Label</key>
36
+ <string>com.clipsy.app</string>
37
+ <key>ProgramArguments</key>
38
+ <array>
39
+ <string>{clipsy_path}</string>
40
+ </array>
41
+ <key>RunAtLoad</key>
42
+ <true/>
43
+ <key>KeepAlive</key>
44
+ <true/>
45
+ <key>StandardOutPath</key>
46
+ <string>{data_dir}/clipsy.log</string>
47
+ <key>StandardErrorPath</key>
48
+ <string>{data_dir}/clipsy.log</string>
49
+ </dict>
50
+ </plist>
51
+ """
52
+
53
+
54
+ def install_launchagent() -> int:
55
+ """Install and start the LaunchAgent."""
56
+ ensure_dirs()
57
+
58
+ clipsy_path = get_clipsy_path()
59
+ print(f"Installing LaunchAgent for: {clipsy_path}")
60
+
61
+ # Create LaunchAgents directory if needed
62
+ LAUNCHAGENT_DIR.mkdir(parents=True, exist_ok=True)
63
+
64
+ # Unload existing if present
65
+ if PLIST_PATH.exists():
66
+ subprocess.run(
67
+ ["launchctl", "unload", str(PLIST_PATH)],
68
+ capture_output=True,
69
+ )
70
+
71
+ # Write plist
72
+ PLIST_PATH.write_text(create_plist(clipsy_path))
73
+ print(f"Created: {PLIST_PATH}")
74
+
75
+ # Load the agent
76
+ result = subprocess.run(
77
+ ["launchctl", "load", str(PLIST_PATH)],
78
+ capture_output=True,
79
+ text=True,
80
+ )
81
+
82
+ if result.returncode == 0:
83
+ print("Clipsy is now running in the background.")
84
+ print("It will start automatically on login.")
85
+ return 0
86
+ else:
87
+ print(f"Failed to load LaunchAgent: {result.stderr}")
88
+ return 1
89
+
90
+
91
+ def uninstall_launchagent() -> int:
92
+ """Stop and remove the LaunchAgent."""
93
+ if not PLIST_PATH.exists():
94
+ print("LaunchAgent not installed.")
95
+ return 0
96
+
97
+ # Unload
98
+ subprocess.run(
99
+ ["launchctl", "unload", str(PLIST_PATH)],
100
+ capture_output=True,
101
+ )
102
+
103
+ # Remove plist
104
+ PLIST_PATH.unlink()
105
+ print("LaunchAgent uninstalled.")
106
+ print("Clipsy will no longer start on login.")
107
+ return 0
108
+
109
+
110
+ def check_status() -> int:
111
+ """Check if Clipsy is running."""
112
+ result = subprocess.run(
113
+ ["launchctl", "list", "com.clipsy.app"],
114
+ capture_output=True,
115
+ text=True,
116
+ )
117
+
118
+ if result.returncode == 0:
119
+ print("Clipsy is running.")
120
+ if PLIST_PATH.exists():
121
+ print(f"LaunchAgent: {PLIST_PATH}")
122
+ return 0
123
+ else:
124
+ print("Clipsy is not running.")
125
+ if PLIST_PATH.exists():
126
+ print(f"LaunchAgent installed but not loaded: {PLIST_PATH}")
127
+ else:
128
+ print("LaunchAgent not installed. Run: clipsy install")
129
+ return 1
130
+
131
+
132
+ def run_app():
133
+ """Run the Clipsy application."""
134
+ ensure_dirs()
135
+
136
+ logging.basicConfig(
137
+ level=logging.INFO,
138
+ format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",
139
+ handlers=[
140
+ logging.FileHandler(LOG_PATH),
141
+ logging.StreamHandler(sys.stderr),
142
+ ],
143
+ )
144
+
145
+ from clipsy.app import ClipsyApp
146
+
147
+ app = ClipsyApp()
148
+ app.run()
149
+
150
+
151
+ def main():
152
+ parser = argparse.ArgumentParser(
153
+ description="Clipsy - Clipboard history manager for macOS",
154
+ formatter_class=argparse.RawDescriptionHelpFormatter,
155
+ epilog="""
156
+ Commands:
157
+ (none) Run Clipsy in foreground
158
+ install Install as LaunchAgent (runs on login)
159
+ uninstall Remove LaunchAgent
160
+ status Check if Clipsy is running
161
+
162
+ Examples:
163
+ clipsy install # Install and start as background service
164
+ clipsy status # Check if running
165
+ clipsy uninstall # Stop and remove from login items
166
+ """,
167
+ )
168
+ parser.add_argument(
169
+ "command",
170
+ nargs="?",
171
+ choices=["install", "uninstall", "status"],
172
+ help="Command to run",
173
+ )
174
+
175
+ args = parser.parse_args()
176
+
177
+ if args.command == "install":
178
+ sys.exit(install_launchagent())
179
+ elif args.command == "uninstall":
180
+ sys.exit(uninstall_launchagent())
181
+ elif args.command == "status":
182
+ sys.exit(check_status())
183
+ else:
184
+ run_app()
185
+
186
+
187
+ if __name__ == "__main__":
188
+ main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clipsy
3
- Version: 1.5.0
3
+ Version: 1.6.0
4
4
  Summary: Lightweight clipboard history manager for macOS
5
5
  Author-email: Brendan Conrad <brendan.conrad@gmail.com>
6
6
  License: MIT
@@ -59,10 +59,19 @@ A lightweight clipboard history manager for macOS. Runs as a menu bar icon — n
59
59
 
60
60
  ## Installation
61
61
 
62
- ### Via pip (recommended)
62
+ ### Via pipx (recommended)
63
+
64
+ ```bash
65
+ brew install pipx
66
+ pipx install clipsy
67
+ clipsy install
68
+ ```
69
+
70
+ ### Via pip
63
71
 
64
72
  ```bash
65
73
  pip install clipsy
74
+ clipsy install
66
75
  ```
67
76
 
68
77
  ### From source
@@ -72,14 +81,12 @@ git clone https://github.com/brencon/clipsy.git
72
81
  cd clipsy
73
82
  python3 -m venv .venv
74
83
  .venv/bin/pip install -e .
84
+ .venv/bin/clipsy install
75
85
  ```
76
86
 
77
87
  ## Usage
78
88
 
79
- ```bash
80
- # Run clipsy (a scissors icon appears in your menu bar)
81
- clipsy
82
- ```
89
+ After running `clipsy install`, the app runs in the background and starts automatically on login. A scissors icon (✂️) appears in your menu bar.
83
90
 
84
91
  Then just use your Mac normally. Every time you copy something, it shows up in the Clipsy menu:
85
92
 
@@ -102,19 +109,13 @@ Then just use your Mac normally. Every time you copy something, it shows up in t
102
109
  └── Quit Clipsy
103
110
  ```
104
111
 
105
- ## Auto-Start on Login
106
-
107
- Run clipsy automatically when you log in — no terminal needed:
112
+ ## Commands
108
113
 
109
114
  ```bash
110
- # Install as a LaunchAgent
111
- scripts/install_launchagent.sh install
112
-
113
- # Check status
114
- scripts/install_launchagent.sh status
115
-
116
- # Remove auto-start
117
- scripts/install_launchagent.sh uninstall
115
+ clipsy install # Install as background service (starts on login)
116
+ clipsy uninstall # Remove from login items
117
+ clipsy status # Check if running
118
+ clipsy # Run in foreground (for debugging)
118
119
  ```
119
120
 
120
121
  ## Data Storage
@@ -1,26 +0,0 @@
1
- import logging
2
- import sys
3
-
4
- from clipsy.config import LOG_PATH
5
- from clipsy.utils import ensure_dirs
6
-
7
-
8
- def main():
9
- ensure_dirs()
10
-
11
- logging.basicConfig(
12
- level=logging.INFO,
13
- format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",
14
- handlers=[
15
- logging.FileHandler(LOG_PATH),
16
- logging.StreamHandler(sys.stderr),
17
- ],
18
- )
19
-
20
- from clipsy.app import ClipsyApp
21
- app = ClipsyApp()
22
- app.run()
23
-
24
-
25
- if __name__ == "__main__":
26
- main()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes