Skip to content

Instantly share code, notes, and snippets.

@davidsharp
Created October 20, 2020 11:12
Show Gist options
  • Save davidsharp/164c69bbe60925122c727f526eaeab89 to your computer and use it in GitHub Desktop.
Save davidsharp/164c69bbe60925122c727f526eaeab89 to your computer and use it in GitHub Desktop.
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