Last active
July 7, 2018 23:57
-
-
Save zanza00/2365f66c31477e48b984444a3aeb932f to your computer and use it in GitHub Desktop.
bitbar plugin, work in progress
This file contains hidden or 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
#!/usr/bin/env /usr/local/bin/node | |
const { execSync } = require('child_process'); | |
const basedir = | |
'/Users/simonepicciani/Dropbox (Personal)/IFTTT/reddit/wallpapers/'; | |
const command = | |
"sqlite3 '/Users/simonepicciani/Library/Application Support/Dock/desktoppicture.db' 'select value from data;'"; | |
const res = execSync(command) | |
.toString('utf8') | |
.split('\n'); | |
const display = res | |
.filter(x => x.length > 0) | |
.map(wlp => `${wlp.replace('.jpg','')} | terminal=true bash=open param1="${basedir}${wlp}"`); | |
console.log('🎨'); | |
console.log('---'); | |
display.forEach(item => { | |
console.log(item); | |
}); | |
console.log('---'); | |
console.log('Refresh | refresh=true terminal=false'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment