summaryrefslogtreecommitdiff
path: root/py_modules/lsfg_vk
diff options
context:
space:
mode:
Diffstat (limited to 'py_modules/lsfg_vk')
-rw-r--r--py_modules/lsfg_vk/plugin.py81
1 files changed, 0 insertions, 81 deletions
diff --git a/py_modules/lsfg_vk/plugin.py b/py_modules/lsfg_vk/plugin.py
index 83b318a..980cb53 100644
--- a/py_modules/lsfg_vk/plugin.py
+++ b/py_modules/lsfg_vk/plugin.py
@@ -493,87 +493,6 @@ class Plugin:
"error": f"Error reading launch script: {str(e)}"
}
- async def copy_to_system_clipboard(self, text: str) -> Dict[str, Any]:
- """Copy text to system clipboard using native tools
-
- Args:
- text: The text to copy to clipboard
-
- Returns:
- Dict indicating success or failure
- """
- try:
- # Detect desktop environment and available clipboard tools
- clipboard_tools = []
-
- # Check for Wayland (wl-clipboard)
- if os.environ.get('WAYLAND_DISPLAY'):
- if self._command_exists('wl-copy'):
- clipboard_tools.append(('wl-copy', lambda t: subprocess.run(['wl-copy'], input=t, text=True, check=True)))
-
- # Check for X11 (xclip or xsel)
- if os.environ.get('DISPLAY'):
- if self._command_exists('xclip'):
- clipboard_tools.append(('xclip', lambda t: subprocess.run(['xclip', '-selection', 'clipboard'], input=t, text=True, check=True)))
- elif self._command_exists('xsel'):
- clipboard_tools.append(('xsel', lambda t: subprocess.run(['xsel', '--clipboard', '--input'], input=t, text=True, check=True)))
-
- # Check for pbcopy (macOS - unlikely on Steam Deck but just in case)
- if self._command_exists('pbcopy'):
- clipboard_tools.append(('pbcopy', lambda t: subprocess.run(['pbcopy'], input=t, text=True, check=True)))
-
- if not clipboard_tools:
- return {
- "success": False,
- "error": "No compatible clipboard tools found (tried: wl-copy, xclip, xsel, pbcopy)",
- "method": None
- }
-
- # Try each clipboard tool until one works
- for tool_name, copy_func in clipboard_tools:
- try:
- copy_func(text)
- return {
- "success": True,
- "method": tool_name,
- "message": f"Successfully copied text using {tool_name}"
- }
- except subprocess.CalledProcessError as e:
- continue # Try next tool
- except Exception as e:
- continue # Try next tool
-
- return {
- "success": False,
- "error": "All clipboard tools failed to copy text",
- "method": None
- }
-
- except Exception as e:
- return {
- "success": False,
- "error": f"Error accessing system clipboard: {str(e)}",
- "method": None
- }
-
- def _command_exists(self, command: str) -> bool:
- """Check if a command exists in the system PATH
-
- Args:
- command: Command name to check
-
- Returns:
- True if command exists, False otherwise
- """
- try:
- subprocess.run(['which', command],
- stdout=subprocess.DEVNULL,
- stderr=subprocess.DEVNULL,
- check=True)
- return True
- except (subprocess.CalledProcessError, FileNotFoundError):
- return False
-
# Lifecycle methods
async def _main(self):
"""