Added warning if relevant clipboard tool is not installed

Former-commit-id: 2d89d7954a6d1c0133f235862e78b1bcfdcef9ff
Former-commit-id: 988a751409f02e2b065c461d4c3f723472ee725a
This commit is contained in:
2023-05-11 12:11:30 -04:00
parent 64e56fb871
commit a89b201fc7
3 changed files with 56 additions and 0 deletions
+13
View File
@@ -329,6 +329,19 @@ def tweak():
_lines += 1
_config_file.write('n')
print(f"{_divider}configuration complete\n")
# PORT START CLIPTOOL
# check for clipboard tool and display warning if missing
if uname()[0] in ('Linux', 'FreeBSD'):
if 'WAYLAND_DISPLAY' in environ:
_display_server, _clipboard_tool = 'Wayland', 'wl-clipboard'
else:
_display_server, _clipboard_tool = 'X11', 'xclip'
from shutil import which
if which(_clipboard_tool) is None:
print(f'\u001b[38;5;9mwarning: you are using {_display_server} and "{_clipboard_tool}" is not present -'
f'\ncopying entry fields will not function until "{_clipboard_tool}" is installed\u001b[0m\n')
# PORT END CLIPTOOL
# prints help text based on argument