
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
freedesktop-icons
Advanced tools
Find icon paths according to the freedesktop icon theme specification.
Requires at least NodeJS 10.
# via yarn
yarn add freedesktop-icons
# or via npm
npm install --save-prod freedesktop-icons
interface IconDescription {
// required
name: string;
// optional, filters each theme's icon directories, case-insensitive
type?: "fixed" | "scalable" | "threshold";
context?: string;
size?: number;
scale?: number;
}
module.exports = function freedesktopIcons(
// The icon query.
// Can either be a simple string, matching only icon names,
// or an icon description, including its name, type, context, size or scale.
// More specific queries result in faster lookups, since theme directories will be filtered.
// When searching for multiple icons, all queries will be applied to the current theme first
// before moving on to the next theme.
icons: ( IconDescription[] | IconDescription | string[] | string ),
// The themes to use for looking up icons.
// These have to be internal theme names, as opposed to theme display names.
// Always adds "hicolor" as the last theme, as defined in the icon theme specification.
// Looks up icons in the theme's parent themes first before continuing with the next one.
themes?: ( string[] | string ) = [ "hicolor" ],
// List of specific icon formats.
// Searches for png and svg icons by default.
fileExtensions?: ( string[] | string ) = [ "png", "svg" ],
// List of non-theme fallback paths.
// Icons are only being matched by name in fallback paths.
// Always adds /usr/share/pixmaps as the last fallback path.
fallbackPaths?: ( string[] | string ) = [ "/usr/share/pixmaps" ]
): ( string | null );
module.exports.clearCache = function clearCache(): void;
const freedesktopIcons = require( "freedesktop-icons" );
async () => {
await freedesktopIcons( "some-icon" );
await freedesktopIcons({ name: "my-app", context: "applications", size: 64 });
await freedesktopIcons(
[
{ name: "my-primary-icon", context: "applications", size: 64 },
{ name: "my-secondary-icon", context: "applications", size: 64 }
],
[
"Papirus",
"Paper",
"Adwaita"
],
"png",
"/path/to/my/app/icons"
);
freedesktopIcons.clearCache();
}
Implement theme directory caching, as mentioned in the freedesktop icon theme specification
FAQs
Find freedesktop icon paths
We found that freedesktop-icons demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.