linux-copycache 1.0.2__tar.gz → 1.0.4__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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: linux-copycache
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: A lightweight, fast, and reliable clipboard manager for Linux (Ubuntu) mimicking Win+V.
5
5
  Home-page: https://github.com/randhana/linux-clipboard-manager
6
6
  Author: Pulathisi Kariyawasam
@@ -50,25 +50,46 @@ pip install linux-copycache
50
50
  ```
51
51
 
52
52
  ### System Dependencies
53
- The auto-pasting functionality requires `xdotool` and `xclip` to be installed on your system.
53
+ The auto-pasting functionality requires `xdotool` and `xclip` to be installed on your system. The GUI requires `libxcb-cursor0`.
54
54
  ```bash
55
- sudo apt install xdotool xclip
55
+ sudo apt install xdotool xclip libxcb-cursor0
56
56
  ```
57
57
 
58
58
  ## Running the tool
59
59
  Once installed, you can start the application from anywhere in your terminal:
60
60
  ```bash
61
- linux-clipboard
61
+ linux-copycache
62
62
  ```
63
63
  The application will launch, dock itself to your system tray, and quietly monitor your copied text!
64
64
 
65
+ > **Note on PATH:** If you installed as a normal user, `pip` might place the executable in `~/.local/bin`. If your terminal says `command not found`, add this directory to your PATH:
66
+ > `echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc`
67
+
68
+ ## Autostart on Boot (Ubuntu/Linux)
69
+ To make the clipboard manager start automatically when you log in, create a `.desktop` file in your autostart folder.
70
+
71
+ Run this command in your terminal:
72
+ ```bash
73
+ mkdir -p ~/.config/autostart && cat << 'EOF' > ~/.config/autostart/linux-copycache.desktop
74
+ [Desktop Entry]
75
+ Type=Application
76
+ Exec=linux-copycache
77
+ Hidden=false
78
+ NoDisplay=false
79
+ X-GNOME-Autostart-enabled=true
80
+ Name=Linux CopyCache
81
+ Comment=Linux Clipboard Manager
82
+ EOF
83
+ ```
84
+ *(If `linux-copycache` is not in your system PATH, replace `Exec=linux-copycache` with the full path, e.g., `Exec=/home/YOUR_USERNAME/.local/bin/linux-copycache`)*
85
+
65
86
  ## Setting up the `Super+V` (Win+V) Shortcut in Ubuntu
66
87
  For the native Windows experience, set up a custom shortcut:
67
88
  1. Open **Settings** -> **Keyboard**.
68
89
  2. Scroll to the bottom and click **View and Customize Shortcuts**.
69
90
  3. Select **Custom Shortcuts** and click the **+** or **Add Shortcut** button.
70
91
  4. **Name:** `Clipboard Manager`
71
- 5. **Command:** `linux-clipboard`
92
+ 5. **Command:** `linux-copycache`
72
93
  6. **Shortcut:** Press `Super + V` (Windows key + V).
73
94
  7. Click **Add**.
74
95
 
@@ -23,25 +23,46 @@ pip install linux-copycache
23
23
  ```
24
24
 
25
25
  ### System Dependencies
26
- The auto-pasting functionality requires `xdotool` and `xclip` to be installed on your system.
26
+ The auto-pasting functionality requires `xdotool` and `xclip` to be installed on your system. The GUI requires `libxcb-cursor0`.
27
27
  ```bash
28
- sudo apt install xdotool xclip
28
+ sudo apt install xdotool xclip libxcb-cursor0
29
29
  ```
30
30
 
31
31
  ## Running the tool
32
32
  Once installed, you can start the application from anywhere in your terminal:
33
33
  ```bash
34
- linux-clipboard
34
+ linux-copycache
35
35
  ```
36
36
  The application will launch, dock itself to your system tray, and quietly monitor your copied text!
37
37
 
38
+ > **Note on PATH:** If you installed as a normal user, `pip` might place the executable in `~/.local/bin`. If your terminal says `command not found`, add this directory to your PATH:
39
+ > `echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc`
40
+
41
+ ## Autostart on Boot (Ubuntu/Linux)
42
+ To make the clipboard manager start automatically when you log in, create a `.desktop` file in your autostart folder.
43
+
44
+ Run this command in your terminal:
45
+ ```bash
46
+ mkdir -p ~/.config/autostart && cat << 'EOF' > ~/.config/autostart/linux-copycache.desktop
47
+ [Desktop Entry]
48
+ Type=Application
49
+ Exec=linux-copycache
50
+ Hidden=false
51
+ NoDisplay=false
52
+ X-GNOME-Autostart-enabled=true
53
+ Name=Linux CopyCache
54
+ Comment=Linux Clipboard Manager
55
+ EOF
56
+ ```
57
+ *(If `linux-copycache` is not in your system PATH, replace `Exec=linux-copycache` with the full path, e.g., `Exec=/home/YOUR_USERNAME/.local/bin/linux-copycache`)*
58
+
38
59
  ## Setting up the `Super+V` (Win+V) Shortcut in Ubuntu
39
60
  For the native Windows experience, set up a custom shortcut:
40
61
  1. Open **Settings** -> **Keyboard**.
41
62
  2. Scroll to the bottom and click **View and Customize Shortcuts**.
42
63
  3. Select **Custom Shortcuts** and click the **+** or **Add Shortcut** button.
43
64
  4. **Name:** `Clipboard Manager`
44
- 5. **Command:** `linux-clipboard`
65
+ 5. **Command:** `linux-copycache`
45
66
  6. **Shortcut:** Press `Super + V` (Windows key + V).
46
67
  7. Click **Add**.
47
68
 
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="linux-copycache",
8
- version="1.0.2",
8
+ version="1.0.4",
9
9
  author="Pulathisi Kariyawasam",
10
10
  author_email="pulathisi.kariyawasam@gmail.com",
11
11
  description="A lightweight, fast, and reliable clipboard manager for Linux (Ubuntu) mimicking Win+V.",
@@ -30,7 +30,7 @@ setuptools.setup(
30
30
  ],
31
31
  entry_points={
32
32
  "console_scripts": [
33
- "linux-clipboard=linux_clipboard_manager.clipboard_gui:main",
33
+ "linux-copycache=linux_clipboard_manager.clipboard_gui:main",
34
34
  ],
35
35
  },
36
36
  )
@@ -3,8 +3,8 @@ import os
3
3
  import subprocess
4
4
  import time
5
5
  from PyQt6.QtWidgets import (
6
- QApplication, QWidget, QVBoxLayout, QListWidget, QListWidgetItem, QLabel,
7
- QSystemTrayIcon, QMenu
6
+ QApplication, QWidget, QVBoxLayout, QHBoxLayout, QListWidget,
7
+ QListWidgetItem, QLabel, QSystemTrayIcon, QMenu, QPushButton, QMessageBox
8
8
  )
9
9
  from PyQt6.QtCore import Qt, pyqtSignal, QTimer
10
10
  from PyQt6.QtGui import QFont, QKeyEvent, QIcon, QClipboard
@@ -38,22 +38,40 @@ class ClipboardGUI(QWidget):
38
38
  Qt.WindowType.Tool
39
39
  )
40
40
  self.resize(400, 500)
41
+ self.setObjectName("MainWindow")
41
42
  self.setStyleSheet("""
42
- QWidget {
43
+ #MainWindow {
43
44
  background-color: #1e1e2e;
44
45
  color: #cdd6f4;
45
46
  border: 1px solid #45475a;
46
47
  border-radius: 8px;
47
48
  }
48
- QLabel {
49
- padding: 10px;
50
- font-weight: bold;
51
- font-size: 14px;
49
+ #Header {
52
50
  background-color: #313244;
53
51
  border-bottom: 1px solid #45475a;
54
52
  border-top-left-radius: 8px;
55
53
  border-top-right-radius: 8px;
56
54
  }
55
+ #Header QLabel {
56
+ padding: 10px;
57
+ font-weight: bold;
58
+ font-size: 14px;
59
+ border: none;
60
+ color: #cdd6f4;
61
+ }
62
+ QPushButton {
63
+ background-color: transparent;
64
+ color: #a6adc8;
65
+ border: 1px solid #45475a;
66
+ border-radius: 4px;
67
+ padding: 5px 10px;
68
+ font-weight: bold;
69
+ margin-right: 10px;
70
+ }
71
+ QPushButton:hover {
72
+ background-color: #45475a;
73
+ color: #cdd6f4;
74
+ }
57
75
  QListWidget {
58
76
  border: none;
59
77
  outline: none;
@@ -74,8 +92,23 @@ class ClipboardGUI(QWidget):
74
92
  layout.setContentsMargins(0, 0, 0, 0)
75
93
  layout.setSpacing(0)
76
94
 
95
+ # Header section with title and clear button
96
+ header_widget = QWidget()
97
+ header_widget.setObjectName("Header")
98
+ header_layout = QHBoxLayout(header_widget)
99
+ header_layout.setContentsMargins(0, 0, 0, 0)
100
+
77
101
  title = QLabel("Clipboard History")
78
- layout.addWidget(title)
102
+ header_layout.addWidget(title)
103
+
104
+ header_layout.addStretch()
105
+
106
+ self.clear_btn = QPushButton("Clear")
107
+ self.clear_btn.setCursor(Qt.CursorShape.PointingHandCursor)
108
+ self.clear_btn.clicked.connect(self.on_clear_clicked)
109
+ header_layout.addWidget(self.clear_btn)
110
+
111
+ layout.addWidget(header_widget)
79
112
 
80
113
  self.list_widget = QListWidget()
81
114
  font = QFont("Sans Serif", 11)
@@ -105,8 +138,6 @@ class ClipboardGUI(QWidget):
105
138
  # Update clipboard silently
106
139
  clipboard = QApplication.clipboard()
107
140
  clipboard.setText(content, QClipboard.Mode.Clipboard)
108
- if clipboard.supportsSelection():
109
- clipboard.setText(content, QClipboard.Mode.Selection)
110
141
 
111
142
  import pyperclip
112
143
  try:
@@ -170,6 +201,11 @@ class ClipboardGUI(QWidget):
170
201
  def on_item_clicked(self, item):
171
202
  self.perform_paste(item)
172
203
 
204
+ def on_clear_clicked(self):
205
+ db.clear_all()
206
+ self.list_widget.clear()
207
+ self.internal_clipboard_update_text = None
208
+
173
209
  def keyPressEvent(self, event: QKeyEvent):
174
210
  self.reset_hide_timer()
175
211
  if event.key() == Qt.Key.Key_Escape:
@@ -66,5 +66,12 @@ def delete_item(item_id: int):
66
66
  conn.commit()
67
67
  conn.close()
68
68
 
69
+ def clear_all():
70
+ conn = get_connection()
71
+ cursor = conn.cursor()
72
+ cursor.execute('DELETE FROM clipboard_items')
73
+ conn.commit()
74
+ conn.close()
75
+
69
76
  if __name__ == '__main__':
70
77
  init_db()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: linux-copycache
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: A lightweight, fast, and reliable clipboard manager for Linux (Ubuntu) mimicking Win+V.
5
5
  Home-page: https://github.com/randhana/linux-clipboard-manager
6
6
  Author: Pulathisi Kariyawasam
@@ -50,25 +50,46 @@ pip install linux-copycache
50
50
  ```
51
51
 
52
52
  ### System Dependencies
53
- The auto-pasting functionality requires `xdotool` and `xclip` to be installed on your system.
53
+ The auto-pasting functionality requires `xdotool` and `xclip` to be installed on your system. The GUI requires `libxcb-cursor0`.
54
54
  ```bash
55
- sudo apt install xdotool xclip
55
+ sudo apt install xdotool xclip libxcb-cursor0
56
56
  ```
57
57
 
58
58
  ## Running the tool
59
59
  Once installed, you can start the application from anywhere in your terminal:
60
60
  ```bash
61
- linux-clipboard
61
+ linux-copycache
62
62
  ```
63
63
  The application will launch, dock itself to your system tray, and quietly monitor your copied text!
64
64
 
65
+ > **Note on PATH:** If you installed as a normal user, `pip` might place the executable in `~/.local/bin`. If your terminal says `command not found`, add this directory to your PATH:
66
+ > `echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc`
67
+
68
+ ## Autostart on Boot (Ubuntu/Linux)
69
+ To make the clipboard manager start automatically when you log in, create a `.desktop` file in your autostart folder.
70
+
71
+ Run this command in your terminal:
72
+ ```bash
73
+ mkdir -p ~/.config/autostart && cat << 'EOF' > ~/.config/autostart/linux-copycache.desktop
74
+ [Desktop Entry]
75
+ Type=Application
76
+ Exec=linux-copycache
77
+ Hidden=false
78
+ NoDisplay=false
79
+ X-GNOME-Autostart-enabled=true
80
+ Name=Linux CopyCache
81
+ Comment=Linux Clipboard Manager
82
+ EOF
83
+ ```
84
+ *(If `linux-copycache` is not in your system PATH, replace `Exec=linux-copycache` with the full path, e.g., `Exec=/home/YOUR_USERNAME/.local/bin/linux-copycache`)*
85
+
65
86
  ## Setting up the `Super+V` (Win+V) Shortcut in Ubuntu
66
87
  For the native Windows experience, set up a custom shortcut:
67
88
  1. Open **Settings** -> **Keyboard**.
68
89
  2. Scroll to the bottom and click **View and Customize Shortcuts**.
69
90
  3. Select **Custom Shortcuts** and click the **+** or **Add Shortcut** button.
70
91
  4. **Name:** `Clipboard Manager`
71
- 5. **Command:** `linux-clipboard`
92
+ 5. **Command:** `linux-copycache`
72
93
  6. **Shortcut:** Press `Super + V` (Windows key + V).
73
94
  7. Click **Add**.
74
95
 
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ linux-copycache = linux_clipboard_manager.clipboard_gui:main
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- linux-clipboard = linux_clipboard_manager.clipboard_gui:main