"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);
});
});

15
conky-bat/package.json Normal file
View File

@@ -0,0 +1,15 @@
{
"name": "conky-bat",
"version": "0.0.0",
"description": "battery status for conky",
"main": "index.js",
"dependencies": {
"linux-battery": "^3.0.1"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Thomas Ruoff",
"license": "MIT"
}