mirror of
https://github.com/tomru/hlwm-config.git
synced 2026-03-03 06:27:20 +01:00
"initial" commit :D
This commit is contained in:
15
conky-bat/index.js
Executable file
15
conky-bat/index.js
Executable 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
15
conky-bat/package.json
Normal 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"
|
||||
}
|
||||
Reference in New Issue
Block a user