Created
October 20, 2020 11:12
-
-
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]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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