Skip to content

Instantly share code, notes, and snippets.

View GrimTheReaper's full-sized avatar
☠️
Literally dead

Grim GrimTheReaper

☠️
Literally dead
  • Hiding in a panic room.
View GitHub Profile
@GrimTheReaper
GrimTheReaper / Better XClip.sh
Last active March 17, 2018 17:47
Append to bashrc to add better copying
# A shortcut function that simplifies usage of xclip.
# - Accepts input from either stdin (pipe), or params.
# Taken from: http://madebynathan.com/2011/10/04/a-nicer-way-to-use-xclip/
# ------------------------------------------------
cb() {
local _scs_col="\e[0;32m"; local _wrn_col='\e[1;31m'; local _trn_col='\e[0;33m'
# Check that xclip is installed.
if ! type xclip > /dev/null 2>&1; then
echo -e "$_wrn_col""You must have the 'xclip' program installed.\e[0m"
# Check user is not root (root doesn't have access to user xorg server)