"initial" commit :D

This commit is contained in:
Thomas Ruoff
2018-04-03 23:17:34 +02:00
commit ed3d2e04b9
15 changed files with 484 additions and 0 deletions

15
conky-bat/index.js Executable file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/env node
'use strict';
var linuxBattery = require('linux-battery');
linuxBattery().then(batteries => {
batteries.forEach(battery => {
var color = battery.warningLevel !== 'none' ? '#ff0000' : '#eee8d5';
var stateSymbol = battery.state === 'charging' ? '↑' : '↓';
var timeLeft = battery.timeToFull || battery.timeToEmpty || '';
var text = `%{F${color}}${battery.percentage} ${stateSymbol} ${timeLeft}%{F-}`;
console.log(text);
});
});