From 2d5797cba8d4641e03d9554d1e5f420d4a51d0a7 Mon Sep 17 00:00:00 2001 From: Max O'Cull Date: Thu, 15 Aug 2024 23:32:19 -0400 Subject: [PATCH] Clipboard fixes, switch to xsel --- .tmux.conf | 2 +- .zshrc | 17 +++++++++++++++++ archiso/10-archiso.sh | 2 +- install.sh | 12 ++++++------ 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index f5cfe5b..e41d2b1 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -76,7 +76,7 @@ set -g @net_speed_format "󰁆 %8s 󰁞 %8s" set -g @yank_selection 'clipboard' # or 'primary' or 'secondary' set -g @yank_selection_mouse 'clipboard' # or 'primary' or 'secondary' set -g @yank_action 'copy-pipe' # or 'copy-pipe-and-cancel' for the default -set -g @yank_with_mouse on # or 'on' +set -g @yank_with_mouse on # or 'off' # Sensible: Fix the colors. #set -g default-terminal "xterm-256color" diff --git a/.zshrc b/.zshrc index d42651a..1f43ce9 100644 --- a/.zshrc +++ b/.zshrc @@ -1475,6 +1475,23 @@ zshrc_load_library() { fi done } + + clipboards() { + if [ -x "$(command -v xsel)" ]; then + echo "xsel:" + echo "Primary: \"$(xsel --output --primary)\"" + echo "Secondary: \"$(xsel --output --secondary)\"" + echo "Clipboard: \"$(xsel --output --clipboard)\"" + fi + + if [ -x "$(command -v xclip)" ]; then + echo "\nxclip:" + echo "Primary: \"$(xclip -out -selection primary)\"" + echo "Secondary: \"$(xclip -out -selection secondary)\"" + echo "Clipboard: \"$(xclip -out -selection clipboard)\"" + echo "Buffer-cut: \"$(xclip -out -selection buffer-cut)\"" + fi + } } zshrc_set_aliases() { diff --git a/archiso/10-archiso.sh b/archiso/10-archiso.sh index 52da7d3..c47698d 100644 --- a/archiso/10-archiso.sh +++ b/archiso/10-archiso.sh @@ -102,7 +102,7 @@ echo "Mount up" #ls /mnt echo "Install base packages" -pacstrap /mnt base linux-lts linux-lts-headers linux-firmware e2fsprogs lvm2 cryptsetup iproute2 networkmanager neovim man-db man-pages texinfo git tmux zsh htop curl ripgrep python nodejs xclip weechat newsboat neofetch chezmoi efivars zram-generator sudo reflector rsync base-devel dkms xorg xorg-server xorg-apps xorg-init xorg-twm xorg-xclock xterm wget unzip zip python python-pip rubygems chromium firefox vulcan-icd-loader vulkan-tools xdg-user-dirs thermald ethtool smartmontools gsmartcontrol pipewire wireplumber helvum pipewire-jack pipewire-alsa pipewire-pulse xdg-desktop-portal xdg-desktop-portal-gtk util-linux chrony +pacstrap /mnt base linux-lts linux-lts-headers linux-firmware e2fsprogs lvm2 cryptsetup iproute2 networkmanager neovim man-db man-pages texinfo git tmux zsh htop curl ripgrep python nodejs xsel weechat newsboat neofetch chezmoi efivars zram-generator sudo reflector rsync base-devel dkms xorg xorg-server xorg-apps xorg-init xorg-twm xorg-xclock xterm wget unzip zip python python-pip rubygems chromium firefox vulcan-icd-loader vulkan-tools xdg-user-dirs thermald ethtool smartmontools gsmartcontrol pipewire wireplumber helvum pipewire-jack pipewire-alsa pipewire-pulse xdg-desktop-portal xdg-desktop-portal-gtk util-linux chrony pacstrap /mnt tlp pacstrap /mnt amd-ucode pacstrap /mnt intel-ucode xf86-video-intel mesa diff --git a/install.sh b/install.sh index 380bb7d..1550614 100755 --- a/install.sh +++ b/install.sh @@ -194,7 +194,7 @@ case "$response" in tmux \ util-linux-user \ weechat \ - xclip \ + xsel \ zsh elif [[ -x "$(command -v brew)" ]]; then # macOS has outdated version of curl, make, binutils, gcc @@ -226,7 +226,7 @@ case "$response" in ripgrep \ tmux \ weechat \ - xclip \ + xsel \ zsh elif [[ -x "$(command -v apt)" ]]; then # NOTE: On slightly older versions of Debian/Ubuntu awscli is v1, not v2! @@ -255,7 +255,7 @@ case "$response" in ruby-rubygems \ tmux \ weechat \ - xclip \ + xsel \ zsh elif [[ -x "$(command -v pacman)" ]]; then sudo pacman -Syu --needed "$AUTOMATED_PACMAN_FLAGS" \ @@ -283,7 +283,7 @@ case "$response" in rubygems \ tmux \ weechat \ - xclip \ + xsel \ zsh if [[ -x "$(command -v yay)" ]]; then @@ -319,7 +319,7 @@ case "$response" in ruby \ tmux \ weechat \ - xclip \ + xsel \ zsh # TODO: Install awscli v2 on BSD @@ -999,7 +999,7 @@ case "$response" in ssh-add "${HOME}/.ssh/id_rsa" fi - xclip -sel clip < "${HOME}/.ssh/id_rsa.pub" && echo "Key copied to clipboard" + xsel --clipboard -i < "${HOME}/.ssh/id_rsa.pub" && echo "Key copied to clipboard" cat "${HOME}/.ssh/id_rsa.pub" ;; *)