Add bitbar scripts

This commit is contained in:
2019-04-05 10:29:44 +01:00
parent cf35985034
commit 1443d1c060
3 changed files with 28 additions and 1 deletions

View File

@@ -92,6 +92,7 @@ cask 'alfred'
cask 'appcleaner'
cask 'bartender'
cask 'betterzip'
cask 'bitbar'
cask 'daisydisk'
cask 'emacs'
cask 'firefox'
@@ -177,7 +178,6 @@ if hostname == 'noct'
cask 'autodmg'
cask 'avidemux'
cask 'balenaetcher'
cask 'bitbar'
cask 'boom-3d'
cask 'calibre'
cask 'chicken'

26
bitbar/brew-updates.1h.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
# <bitbar.title>Homebrew Updates</bitbar.title>
# <bitbar.author>killercup</bitbar.author>
# <bitbar.author.github>killercup</bitbar.author.github>
# <bitbar.desc>List available updates from Homebrew (OS X)</bitbar.desc>
exit_with_error() {
echo "err | color=red";
exit 1;
}
/usr/local/bin/brew update > /dev/null || exit_with_error;
PINNED=$(/usr/local/bin/brew list --pinned);
OUTDATED=$(/usr/local/bin/brew outdated --quiet);
UPDATES=$(comm -13 <(for X in "${PINNED[@]}"; do echo "${X}"; done) <(for X in "${OUTDATED[@]}"; do echo "${X}"; done))
UPDATE_COUNT=$(echo "$UPDATES" | grep -c '[^[:space:]]');
echo "$UPDATE_COUNT | dropdown=false"
echo "---";
if [ -n "$UPDATES" ]; then
echo "Upgrade all | bash=/usr/local/bin/brew param1=upgrade terminal=false refresh=true"
echo "$UPDATES" | awk '{print $0 " | terminal=false refresh=true bash=/usr/local/bin/brew param1=upgrade param2=" $1}'
fi

View File

@@ -11,6 +11,7 @@ PRIVATE_PATH="private"
SYMLINKS=(
ackrc
alacritty.yml
bitbar
bundle
coffeelint.json
emacs.d