-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cbf1596
Showing
7 changed files
with
1,454 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[**.js] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[**.json] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[**.css] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[**.scss] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[**.html] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[**.jsx] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[src/**.{h,cc}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[configure] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[Makefile] | ||
indent_style = tab | ||
indent_size = 8 | ||
|
||
[{deps,tools}/**] | ||
indent_style = ignore | ||
indent_size = ignore | ||
end_of_line = ignore | ||
trim_trailing_whitespace = ignore | ||
charset = ignore | ||
|
||
[{test/fixtures,deps,tools/eslint,tools/gyp,tools/icu,tools/msvs}/**] | ||
insert_final_newline = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# tidal-hifi-electron | ||
|
||
The web version of [listen.tidal.com](listen.tidal.com) running in electron with hifi support thanks to widevine. | ||
|
||
<!-- toc --> | ||
|
||
- [Why](#why) | ||
- [Requirements](#requirements) | ||
- [Integrations](#integrations) | ||
|
||
<!-- tocstop --> | ||
|
||
## Why | ||
|
||
When I started this project there weren't any Linux apps that offered Tidal's "hifi" options nor any scripts to control it. | ||
|
||
## Requirements | ||
|
||
- Internet connection | ||
|
||
## Integrations | ||
|
||
- [i3 blocks config]() - My dotfiles where I use this app to fetch currently playing music |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
const { app, globalShortcut, BrowserWindow, process } = require("electron"); | ||
const path = require("path"); | ||
const tidalUrl = "https://listen.tidal.com"; | ||
let mainWindow; | ||
|
||
/** | ||
* Enable live reload in development builds | ||
*/ | ||
require("electron-reload")(__dirname, { | ||
electron: require(`${__dirname}/node_modules/electron`), | ||
}); | ||
|
||
function createWindow(options = {}) { | ||
// Create the browser window. | ||
mainWindow = new BrowserWindow({ | ||
x: options.x, | ||
y: options.y, | ||
width: 1024, | ||
height: 800, | ||
backgroundColor: options.backgroundColor, | ||
webPreferences: { | ||
affinity: "window", | ||
preload: path.join(__dirname, "preload.js"), | ||
plugins: true, | ||
}, | ||
}); | ||
|
||
// load the Tidal website | ||
mainWindow.loadURL(tidalUrl); | ||
|
||
// run stuff after first load | ||
mainWindow.webContents.once("did-finish-load", () => {}); | ||
|
||
// Emitted when the window is closed. | ||
mainWindow.on("closed", function() { | ||
mainWindow = null; | ||
}); | ||
} | ||
|
||
function addGlobalShortcuts() { | ||
globalShortcut.register("Control+A", () => { | ||
mainWindow.webContents.send("getPlayInfo"); | ||
}); | ||
} | ||
|
||
// This method will be called when Electron has finished | ||
// initialization and is ready to create browser windows. | ||
// Some APIs can only be used after this event occurs. | ||
app.on("ready", () => { | ||
// window with white backround | ||
createWindow(); | ||
addGlobalShortcuts(); | ||
}); | ||
|
||
app.on("activate", function() { | ||
// On OS X it's common to re-create a window in the app when the | ||
// dock icon is clicked and there are no other windows open. | ||
if (mainWindow === null) { | ||
createWindow(); | ||
} | ||
}); |
Oops, something went wrong.