improved clipboard method

This commit is contained in:
2021-09-11 16:45:28 -04:00
parent 3da92ff20b
commit 254aca0839
+5 -2
View File
@@ -15,7 +15,7 @@ import string
import pyperclip
pyperclip.determine_clipboard()
# custom modules
@@ -529,7 +529,10 @@ if argument == 'copy':
# end string and folder generation
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory + readentry + '.gpg')
copyline = open('/dev/shm/' + shmfolder + '/' + shmentry, 'r').readlines()
pyperclip.copy(copyline[1].replace('\n', ''))
if environ.get('WAYLAND_DISPLAY') == 'wayland-0':
term('wl-copy ' + copyline[1].replace('\n', ''))
else:
term('echo -n ' + "'" + copyline[1].replace('\n', '') + "'" + ' | xclip -sel c')
rmtree('/dev/shm/' + shmfolder)
# gen