You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**manager for Clips app **
I am trying to add a manager for https://github.com/hezral/clips, it works fine in elementaryOs but I see it's missing on your extension so i am trying to make a manager for it, but i can't make it work, here's the code i am doing:
from shutil import which
class MyClipsManager:
def __init__(self):
self.name = 'clips'
self.binary = '/usr/bin/clips'
if not self.can_start():
raise Exception('Clips app is not installed or not in PATH')
if not self.is_running():
self.start()
def can_start(self):
return bool(which(self.binary))
def is_running(self):
return bool(self.pid_of('clips'))
def pid_of(self, process_name):
return subprocess.check_output(['pgrep', process_name]).strip()
def start(self):
subprocess.call([self.binary])
def stop(self):
subprocess.call(['killall', 'clips'])
def add(self, text):
subprocess.call([self.binary, '-a', text])
def get_history(self):
return subprocess.check_output([self.binary, '-l']).decode('utf-8').splitlines()
The text was updated successfully, but these errors were encountered:
I have pushed some refactoring to the main branch (used for Ulauncher v6) to add stricter types, so they're actually classes now, more similar to your example. I would recommend to copy one of the existing integrations (ex GPaste), replacing the name and the implementation of the methods rather than writing your own separate implementation from scratch. Then you also have to import it to main.py
**manager for Clips app **
I am trying to add a manager for https://github.com/hezral/clips, it works fine in elementaryOs but I see it's missing on your extension so i am trying to make a manager for it, but i can't make it work, here's the code i am doing:
The text was updated successfully, but these errors were encountered: