diff --git a/dotfiles/config/clipit/clipitrc b/dotfiles/config/clipit/clipitrc deleted file mode 100644 index 4e70d66e..00000000 --- a/dotfiles/config/clipit/clipitrc +++ /dev/null @@ -1,27 +0,0 @@ -[rc] -use_copy=true -use_primary=true -synchronize=false -automatic_paste=false -show_indexes=true -save_uris=true -use_rmb_menu=false -save_history=true -history_limit=1000 -history_timeout_seconds=30 -history_timeout=false -items_menu=50 -statics_show=true -statics_items=10 -hyperlinks_only=false -confirm_clear=false -single_line=false -reverse_history=false -item_length=50 -ellipsize=2 -history_key= -actions_key= -menu_key= -search_key= -offline_key= -offline_mode=false diff --git a/dotfiles/config/xmonad/xmonad.hs b/dotfiles/config/xmonad/xmonad.hs index 13821b35..039dc849 100644 --- a/dotfiles/config/xmonad/xmonad.hs +++ b/dotfiles/config/xmonad/xmonad.hs @@ -1019,7 +1019,7 @@ addKeys conf@XConfig { modMask = modm } = -- Non-XMonad , ((modm, xK_v), spawn "xclip -o | xdotool type --file -") - , ((hyper, xK_v), spawn "rofi_clipit.sh") + , ((hyper, xK_v), spawn "rofi_clipboard.sh") , ((hyper, xK_p), spawn "rofi-pass") , ((hyper, xK_h), spawn "rofi_shutter") , ((hyper, xK_c), spawn "shell_command.sh") diff --git a/dotfiles/lib/bin/clipit_history.py b/dotfiles/lib/bin/clipit_history.py deleted file mode 100755 index 96e9166e..00000000 --- a/dotfiles/lib/bin/clipit_history.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python -from __future__ import print_function -import appdirs -import argparse -import os -import struct - - -clipit_history_file = os.path.join( - appdirs.user_data_dir(), "clipit/history", -) - - -def get_clipit_history(filename): - with open(filename, 'rb') as f: - f.read(68) - size, _ = struct.unpack('2i', f.read(8)) - while (size > 0): - item = f.read(size) - if item: - yield item.decode('utf-8') - _, _, _, size, _ = struct.unpack('5i', f.read(20)) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='Lookup clipit history') - parser.add_argument( - '--separator', '-s', - help='the separator to use when outputting history', - type=str, - default='\n', - ) - parser.add_argument( - '--begin-index', '-b', - type=int, - default=0 - ) - parser.add_argument( - '--end-index', '-e', - type=int, - default=None - ) - parser.add_argument( - '--index', '-i', - type=int, - default=None - ) - parser.add_argument( - '--separator-replacement', '-r', - type=str, - default=None - ) - args = parser.parse_args() - if not args.separator_replacement: - args.separator_replacement = args.separator - history = list(get_clipit_history(clipit_history_file)) - if args.index is not None: - text = history[args.index] - else: - selected = history[args.begin_index:args.end_index] - text = args.separator.join([s.replace(args.separator, args.separator_replacement) - for s in selected]) - print(text, end='') diff --git a/dotfiles/lib/bin/rofi_clipboard.sh b/dotfiles/lib/bin/rofi_clipboard.sh new file mode 100755 index 00000000..61090b7a --- /dev/null +++ b/dotfiles/lib/bin/rofi_clipboard.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +rofi -modi "clipboard:greenclip print" -show clipboard diff --git a/dotfiles/lib/bin/rofi_clipit.sh b/dotfiles/lib/bin/rofi_clipit.sh deleted file mode 100755 index c8ddb7cf..00000000 --- a/dotfiles/lib/bin/rofi_clipit.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -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 diff --git a/nixos/desktop.nix b/nixos/desktop.nix index 7e586c66..0d1fb363 100644 --- a/nixos/desktop.nix +++ b/nixos/desktop.nix @@ -1,5 +1,6 @@ { inputs, config, pkgs, makeEnable, ... }: makeEnable config "myModules.desktop" true { + services.greenclip.enable = true; imports = [ ./fonts.nix ./hyprland.nix @@ -65,7 +66,6 @@ makeEnable config "myModules.desktop" true { feh firefox cheese - gpaste kdePackages.kleopatra libnotify libreoffice diff --git a/nixos/home-manager.nix b/nixos/home-manager.nix index a344deb2..487b6696 100644 --- a/nixos/home-manager.nix +++ b/nixos/home-manager.nix @@ -1,5 +1,18 @@ { pkgs, ... }: { + xdg.configFile."greenclip.toml".text = '' + [greenclip] + history_file = "~/.cache/greenclip.history" + max_history_length = 50 + max_selection_size_bytes = 0 + trim_space_from_selection = true + use_primary_selection_as_input = false + blacklisted_applications = [] + enable_image_support = true + image_cache_directory = "~/.cache/greenclip" + static_history = [] + ''; + xsession = { enable = true; preferStatusNotifierItems = true;