1.0.3 • Published 4 years ago
linux-desktop v1.0.3
linux-desktop
This is a module that indexes .desktop files on linux, and then allows you to query them using js. It also converts them to JSON, so
[Desktop Entry]
Name=Discord
GenericName=Internet Messenger
Exec=/usr/bin/discord
Icon=discord
Type=Application
Categories=Network;InstantMessaging;
Path=/usr/bin
becomes
{
Name: Discord,
GenericName: 'Internet Messenger',
Exec: '/usr/bin/discord',
Icon: '/usr/share/pixmaps/discord.png',
Type: 'Application',
Categories: [ 'Network', 'InstantMessaging' ],
Path: '/usr/bin'
}
Example usage:
var linuxDesktop = require('linux-desktop');
linuxDesktop.indexItems()
.then(() => {
console.log(
linuxDesktop.refineEntry(
linuxDesktop.findByCommand('discord')
)
)
})