Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
bitbar plugin that shows whats in your clipboard, and allows you to clear it too [wip]
#!/bin/bash
function check(){
pbpaste | wc -m
}
function render(){
pbpaste
}
function clear(){
echo -n '' | pbcopy
}
if [[ "$1" = "clear" ]]; then
clear
fi
function main(){
echo "👁‍🗨"
echo "---"
render=$(render)
if [[ $render ]];then
echo "$render" # TODO, escape pipes
echo "---"
echo "clear|bash=$0 param1=clear terminal=false refresh=true"
else
echo "empty"
fi
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment