diff --git a/dotfiles/lib/bin/clipit_history.py b/dotfiles/lib/bin/clipit_history.py index fb485555..39c051b8 100755 --- a/dotfiles/lib/bin/clipit_history.py +++ b/dotfiles/lib/bin/clipit_history.py @@ -4,7 +4,6 @@ import appdirs import argparse import os import struct -import string clipit_history_file = os.path.join(appdirs.user_data_dir(), "clipit/history") @@ -17,7 +16,7 @@ def get_clipit_history(filename): while (size > 0): item = f.read(size) if item: - yield item + yield item.decode('utf-8') _, _, _, size, _ = struct.unpack('5i', f.read(20)) @@ -57,6 +56,6 @@ if __name__ == '__main__': text = history[args.index] else: selected = history[args.begin_index:args.end_index] - text = args.separator.join([string.replace(s, args.separator, args.separator_replacement) + text = args.separator.join([s.replace(args.separator, args.separator_replacement) for s in selected]) print(text, end='') diff --git a/dotfiles/lib/bin/copyq_all.js b/dotfiles/lib/bin/copyq_all.js deleted file mode 100644 index aed704bb..00000000 --- a/dotfiles/lib/bin/copyq_all.js +++ /dev/null @@ -1,9 +0,0 @@ -String.prototype.replaceAll = function(search, replacement) { - var target = this; - return target.split(search).join(replacement); -}; - -for (var i=0; i/dev/null; then - copyq select "$SELECTED_INDEX" - copyq paste -fi diff --git a/dotfiles/lib/bin/clipit_rofi.sh b/dotfiles/lib/bin/rofi_clipit.sh similarity index 94% rename from dotfiles/lib/bin/clipit_rofi.sh rename to dotfiles/lib/bin/rofi_clipit.sh index c6e4a7c8..c8ddb7cf 100755 --- a/dotfiles/lib/bin/clipit_rofi.sh +++ b/dotfiles/lib/bin/rofi_clipit.sh @@ -5,3 +5,5 @@ SELECTED_INDEX="$(clipit_history.py -r '(newline)' | rofi -dmenu -format i)" if [ "$SELECTED_INDEX" -eq "$SELECTED_INDEX" ] 2>/dev/null; then xdotool type "$(clipit_history.py -e 5 -i $SELECTED_INDEX)" fi + +xdotool type