Skip to content

Commit

Permalink
Add plasmusic-toolbar v1.6.0 option (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeitorAugustoLN authored Sep 7, 2024
1 parent b82b9ba commit 8868692
Showing 1 changed file with 32 additions and 23 deletions.
55 changes: 32 additions & 23 deletions modules/widgets/plasmusic-toolbar.nix
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,14 @@ in
enumVals
);
};
albumCover = {
albumPlaceholder = mkOption {
type = types.nullOr types.str;
default = null;
example = "file:///home/user/placeholder.png";
description = "Path to the album placeholder image.";
};
};
settings = mkOption {
type = configValueType;
default = null;
Expand All @@ -331,7 +339,7 @@ in
};
description = ''
Extra configuration for the widget options.
See available options at https://github.com/ccatterina/plasmusic-toolbar/blob/main/src/contents/config/main.xml
'';
apply = settings: if settings == null then {} else settings;
Expand All @@ -346,37 +354,38 @@ in
, musicControls
, font
, background
, albumCover
, settings
}: {
name = "plasmusic-toolbar";

config = lib.recursiveUpdate {
General = lib.filterAttrs (_: v: v != null) (
{
panelIcon = panelIcon.icon;
useAlbumCoverAsPanelIcon = panelIcon.albumCover.useAsIcon;
albumCoverRadius = panelIcon.albumCover.radius;
fallbackToIconWhenArtNotAvailable = panelIcon.albumCover.fallbackToIcon;
General = lib.filterAttrs (_: v: v != null) {
panelIcon = panelIcon.icon;
useAlbumCoverAsPanelIcon = panelIcon.albumCover.useAsIcon;
albumCoverRadius = panelIcon.albumCover.radius;
fallbackToIconWhenArtNotAvailable = panelIcon.albumCover.fallbackToIcon;

sourceIndex = preferredSource;

sourceIndex = preferredSource;
maxSongWidthInPanel = songText.maximumWidth;
separateText = songText.displayInSeparateLines;

maxSongWidthInPanel = songText.maximumWidth;
separateText = songText.displayInSeparateLines;
textScrollingEnabled = songText.scrolling.enable;
textScrollingBehaviour = songText.scrolling.behavior;
textScrollingSpeed = songText.scrolling.speed;
textScrollingResetOnPause = songText.scrolling.resetOnPause;

textScrollingEnabled = songText.scrolling.enable;
textScrollingBehaviour = songText.scrolling.behavior;
textScrollingSpeed = songText.scrolling.speed;
textScrollingResetOnPause = songText.scrolling.resetOnPause;
commandsInPanel = musicControls.showPlaybackControls;
volumeStep = musicControls.volumeStep;

commandsInPanel = musicControls.showPlaybackControls;
volumeStep = musicControls.volumeStep;

useCustomFont = (font != null);
customFont = font;
useCustomFont = (font != null);
customFont = font;

desktopWidgetBg = background;
}
);
desktopWidgetBg = background;

albumPlaceholder = albumCover.albumPlaceholder;
};
} settings;
};
};
Expand Down

0 comments on commit 8868692

Please sign in to comment.