This repository has been archived by the owner on Oct 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added hidden application menu Added close to (mpris) controller Added Start hidden LastURL functionality now working Notification not really fixed but is going to be re-implemented differently - soon Added 5 more seconds to notifications for now Notifications isWorthy function removed Instead, notification decides 'isWorthy' based on preferences in receiving playback/track change messages handler (still somewhat dodgy sometimes - working on it...) Fixed slow updated notifications/not showing/wrong info bug w/ 70% accuracy now from around 20% accuracy (constantly messing up names etc) - now sometimes just shows the previous information - working on it like I said... Notification album art missing shows up less Fixed Sing! sometimes not detecting TrackChange Prevent about and preferences window being resized Made sure Sing! node-unofficialmxm links to default browser Fixed light theme playlist black menu arrow head Add main media keys w/ D-Bus (no more custom dbus commands) Moved dbus_service to MRISAndNotifications_service.js allowing for MediaKeys_service.js Fixed empty lyrics - yet these are from restricted lyrics (appropriate error messages in place) Fixed Sing! multiple artist separation problem Added temporary login workaround These are temporary fixes - I am working on better implementations
- Loading branch information
1 parent
6871f0b
commit 17e85d0
Showing
18 changed files
with
319 additions
and
246 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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,28 @@ | ||
const interpreter = require('./dbus_interpreter'); | ||
function send(command, args){ | ||
console.log('Sending ' + command + ' event'); | ||
interpreter.send(process.stdout, command, args); | ||
} | ||
var DBus = require('dbus'); | ||
var dbus = new DBus(); | ||
var bus = dbus.getBus('session'); | ||
bus.getInterface('org.gnome.SettingsDaemon', '/org/gnome/SettingsDaemon/MediaKeys', 'org.gnome.SettingsDaemon.MediaKeys', function(err, iface) { | ||
if(err) console.log(err); | ||
iface.on('MediaPlayerKeyPressed', function (n, value) { | ||
switch (value) { | ||
case 'Play': | ||
send('PlayPause'); | ||
break; | ||
case 'Next': | ||
send('Next'); | ||
break; | ||
case 'Previous': | ||
send('Previous'); | ||
break; | ||
case 'Stop': | ||
send('Stop'); | ||
break; | ||
} | ||
}); | ||
iface.GrabMediaPlayerKeys(0, 'org.gnome.SettingsDaemon.MediaKeys'); | ||
}); |
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
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
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 |
---|---|---|
@@ -1,39 +1,57 @@ | ||
/* | ||
* @author Matthew James <[email protected]> | ||
* D-Bus MPRIS Messaging implementer | ||
* D-Bus MPRIS, Notifications and Media Keys Messaging Implementer | ||
*/ | ||
var child_process = require('child_process'); | ||
var spawn = child_process.spawn; | ||
var lib_node = process.cwd() + '/libs/node/bin/node'; | ||
const interpreter = require('./dbus_interpreter'); | ||
let dbus = spawnDBus(); | ||
let MPRISAndNotifications = spawnMPRISAndNotificationService(); | ||
let MediaKeys = spawnMediaKeyService(); | ||
|
||
function spawnDBus(){ | ||
var spawned = spawn(lib_node, [__dirname + '/dbus_service.js']); | ||
function spawnMPRISAndNotificationService(){ | ||
var spawned = spawn(lib_node, [__dirname + '/MPRISAndNotifications_service.js']); | ||
spawned.stderr.on('data', (data) => { | ||
console.log('D-Bus Error: ' + data.toString()) | ||
console.log('MPRIS & Notification Error: ' + data.toString()) | ||
}); | ||
spawned.stdout.on('data', (data) => { | ||
console.log('D-Bus/MPRIS says: \n' + data.toString()); | ||
console.log('MPRIS & Notification service: \n' + data.toString()); | ||
}); | ||
spawned.on('exit', () => { | ||
console.log('D-Bus has unexpectedly disconnected.'); | ||
console.log('MPRIS & Notification service quit!'); | ||
}); | ||
return spawned; | ||
} | ||
function spawnMediaKeyService(){ | ||
var spawned = spawn(lib_node, [__dirname + '/MediaKeys_service.js']); | ||
spawned.stderr.on('data', (data)=>{ | ||
console.log('Media Key Error: ' + data.toString()); | ||
}); | ||
spawned.stdout.on('data', (data) => { | ||
console.log('Media Keys service: ' + data.toString()); | ||
}); | ||
spawned.on('exit', () => { | ||
console.log('Media Keys quit!'); | ||
}); | ||
return spawned; | ||
} | ||
|
||
module.exports = { | ||
instance: dbus, | ||
instances: { | ||
MPRISAndNotifications: MPRISAndNotifications, | ||
MediaKeys: MediaKeys | ||
}, | ||
interpreter: interpreter, | ||
reload: () => { | ||
dbus = spawnDBus(); | ||
MPRISAndNotifications = spawnMPRISAndNotificationService(); | ||
MediaKeys = spawnMediaKeyService(); | ||
}, | ||
quit: () => { | ||
try { | ||
process.kill(dbus.pid); | ||
dbus = null; | ||
} catch (e){ | ||
//D-Bus quitted early | ||
} | ||
process.kill(MPRISAndNotifications.pid); | ||
process.kill(MediaKeys.pid); | ||
MPRISAndNotifications = null; | ||
MediaKeys = null; | ||
} catch (e){} | ||
} | ||
}; |
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
Oops, something went wrong.