Skip to content

Instantly share code, notes, and snippets.

@masih
Last active January 2, 2024 10:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masih/d529694465805f94d930 to your computer and use it in GitHub Desktop.
Save masih/d529694465805f94d930 to your computer and use it in GitHub Desktop.
Installs XClip locally
#!/bin/bash
# Script for installing xclip on systems without root access.
# xclip will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
XCLIP_VERSION=0.12
# create our directories
mkdir -p $HOME/local $HOME/xclip_tmp
cd $HOME/xclip_tmp
# download source files for XClip
wget https://versaweb.dl.sourceforge.net/project/xclip/xclip/${XCLIP_VERSION}/xclip-${XCLIP_VERSION}.tar.gz
# extract files, configure, and compile
tar xvzf xclip-${XCLIP_VERSION}.tar.gz
cd xclip-${XCLIP_VERSION}
./configure --prefix=$HOME/local --disable-shared
make
make install
@ajason08
Copy link

Hi, Im trying to use it, but after installation I could use it as usual e.g. "pwd | xclip" am I missing something? Thank you for the code.

@rfletchr
Copy link

ensure that $HOME/local/bin is in your path.

put this into your $HOME/.bashrc file

export PATH="$HOME/local/bin:$PATH"

@chongchonghe
Copy link

As of Sep 2022, the link in your file does not work. Instead, use
wget https://versaweb.dl.sourceforge.net/project/xclip/xclip/0.12/xclip-0.12.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment