Make theming the bar a configurable option
This commit is contained in:
parent
f0b79090de
commit
a2cdc4f2f1
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
"apiKey": "YOUR_LASTFM_API_KEY",
|
"apiKey": "YOUR_LASTFM_API_KEY",
|
||||||
"username": "YOUR_LASTFM_USERNAME"
|
"username": "YOUR_LASTFM_USERNAME",
|
||||||
|
"themeBar": true
|
||||||
}
|
}
|
||||||
|
|
31
main.js
31
main.js
|
@ -70,23 +70,24 @@ async function setAsWallpaper(buffer, dominantColor) {
|
||||||
try {
|
try {
|
||||||
await fs.promises.writeFile('/tmp/current_album_cover.png', buffer, 'binary');
|
await fs.promises.writeFile('/tmp/current_album_cover.png', buffer, 'binary');
|
||||||
|
|
||||||
const colorString = `#${dominantColor.r.toString(16).padStart(2, '0')}${dominantColor.g.toString(16).padStart(2, '0')}${dominantColor.b.toString(16).padStart(2, '0')}`;
|
|
||||||
|
|
||||||
console.log(`Sending color string to Python script: ${colorString}`);
|
|
||||||
|
|
||||||
const command = `python3 ./tap_in.py '${colorString}'`;
|
|
||||||
console.log("Running command:", command);
|
|
||||||
|
|
||||||
exec(command, (error, stdout, stderr) => {
|
|
||||||
if (error) {
|
|
||||||
console.error(`Error running the command: ${error}`);
|
|
||||||
}
|
|
||||||
console.log(`Python stdout: ${stdout}`);
|
|
||||||
console.log(`Python stderr: ${stderr}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
exec('feh --bg-center /tmp/current_album_cover.png');
|
exec('feh --bg-center /tmp/current_album_cover.png');
|
||||||
|
|
||||||
|
if (config.themeBar) {
|
||||||
|
const colorString = `#${dominantColor.r.toString(16).padStart(2, '0')}${dominantColor.g.toString(16).padStart(2, '0')}${dominantColor.b.toString(16).padStart(2, '0')}`;
|
||||||
|
console.log(`Sending color string to Python script: ${colorString}`);
|
||||||
|
|
||||||
|
const command = `python3 ./tap_in.py '${colorString}'`;
|
||||||
|
console.log("Running command:", command);
|
||||||
|
|
||||||
|
exec(command, (error, stdout, stderr) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(`Error running the command: ${error}`);
|
||||||
|
}
|
||||||
|
console.log(`Python stdout: ${stdout}`);
|
||||||
|
console.log(`Python stderr: ${stderr}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
console.log('Wallpaper and Qtile colors successfully updated.');
|
console.log('Wallpaper and Qtile colors successfully updated.');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to set wallpaper and update Qtile colors:", error);
|
console.error("Failed to set wallpaper and update Qtile colors:", error);
|
||||||
|
|
Loading…
Reference in New Issue