Skip to content

Instantly share code, notes, and snippets.

@zanza00
Last active July 7, 2018 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zanza00/2365f66c31477e48b984444a3aeb932f to your computer and use it in GitHub Desktop.
Save zanza00/2365f66c31477e48b984444a3aeb932f to your computer and use it in GitHub Desktop.
bitbar plugin, work in progress
#!/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