def alternative_to_gtk_clipboard(): """ This is an ugly fix for pyperclip to stop using gtk for unknown reason Gtk clipboard cause PyIDM to freeze system task bar in Manjaro kde, if we use is_solo() """ def executable_exists(name): return subprocess.call(['which', name], stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0 if executable_exists("xsel"): return clipboard.init_xsel_clipboard() if executable_exists("xclip"): return clipboard.init_xclip_clipboard() if executable_exists("klipper") and executable_exists("qdbus"): return clipboard.init_klipper_clipboard() else: log('clipboard needs "xsel", or "xclip" installed to run properly') return clipboard.init_no_clipboard()
class TestXSel(_TestClipboard): if _executable_exists("xsel"): clipboard = init_xsel_clipboard()