Skip to content
This repository has been archived by the owner on Mar 5, 2022. It is now read-only.

Commit

Permalink
Support xclip and termux-clipboard-set
Browse files Browse the repository at this point in the history
  • Loading branch information
jarun committed Jul 30, 2018
1 parent 4e699ae commit 1569e11
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion googler
Expand Up @@ -2085,13 +2085,19 @@ class GooglerCmd(object):
copier_params = []
copier_mode = 'stdin'
if sys.platform.startswith(('linux', 'freebsd', 'openbsd')):
if shutil.which('xsel'):
if shutil.which('xsel') is not None:
copier_params = ['xsel', '-b', '-i']
elif shutil.which('xclip') is not None:
copier_params = ['xclip', '-selection', 'clipboard']
elif shutil.which('termux-clipboard-set') is not None:
copier_params = ['termux-clipboard-set']
elif sys.platform == 'darwin':
copier_params = ['pbcopy']
elif sys.platform == 'win32':
copier_params = ['clip']

# If native clipboard utilities are absent, try to use terminal
# multiplexers, tmux/GNU screen, as fallback.
if not copier_params:
if os.getenv('TMUX_PANE'): # check for tmux
# Try to use tmux buffer as fallback. Use case suggested by #230.
Expand Down

0 comments on commit 1569e11

Please sign in to comment.