Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-shell-notification-center
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximper-shell-notification-center
Commits
3320bdb1
Unverified
Commit
3320bdb1
authored
Jul 07, 2025
by
Erik Reider
Committed by
GitHub
Jul 07, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to hide the MPRIS album art (#566)
parent
6f1bf432
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
3 deletions
+36
-3
config.json.in
src/config.json.in
+2
-3
configSchema.json
src/configSchema.json
+6
-0
mpris.vala
src/controlCenter/widgets/mpris/mpris.vala
+24
-0
mpris_player.vala
src/controlCenter/widgets/mpris/mpris_player.vala
+4
-0
No files found.
src/config.json.in
View file @
3320bdb1
...
...
@@ -13,7 +13,6 @@
"control-center-margin-left": 0,
"notification-2fa-action": true,
"notification-inline-replies": false,
"notification-icon-size": 64,
"notification-body-image-height": 100,
"notification-body-image-width": 200,
"timeout": 10,
...
...
@@ -74,9 +73,9 @@
"text": "Label Text"
},
"mpris": {
"image-size": 96,
"blacklist": [],
"autohide": false
"autohide": false,
"show-album-art": "always"
},
"buttons-grid": {
"actions": [
...
...
src/configSchema.json
View file @
3320bdb1
...
...
@@ -415,6 +415,12 @@
"deprecated"
:
true
,
"description"
:
"deprecated (change the CSS root variable
\"
--mpris-album-art-icon-size
\"
): The size of the album art"
,
"default"
:
-1
},
"show-album-art"
:
{
"type"
:
"string"
,
"description"
:
"Whether or not the album art should be hidden, always visible, or only visible when a valid album art is provided."
,
"default"
:
"always"
,
"enum"
:
[
"always"
,
"when-available"
,
"never"
]
}
}
},
...
...
src/controlCenter/widgets/mpris/mpris.vala
View file @
3320bdb1
namespace
SwayNotificationCenter.Widgets.Mpris
{
public
enum
AlbumArtState
{
ALWAYS
,
WHEN_AVAILABLE
,
NEVER
;
public
static
AlbumArtState
parse
(
string
value
)
{
switch
(
value
)
{
default
:
case
"always"
:
return
AlbumArtState
.
ALWAYS
;
case
"when-available"
:
return
AlbumArtState
.
WHEN_AVAILABLE
;
case
"never"
:
return
AlbumArtState
.
NEVER
;
}
}
}
public
struct
Config
{
[
Version
(
deprecated
=
true
,
replacement
=
"CSS root variable"
)]
int
image_size
;
AlbumArtState
show_album_art
;
bool
autohide
;
string
[]
blacklist
;
}
...
...
@@ -29,6 +46,7 @@ namespace SwayNotificationCenter.Widgets.Mpris {
// Default config values
Config
mpris_config
=
Config
()
{
image_size
=
-
1
,
show_album_art
=
AlbumArtState
.
ALWAYS
,
autohide
=
false
,
};
...
...
@@ -88,6 +106,12 @@ namespace SwayNotificationCenter.Widgets.Mpris {
mpris_config
.
image_size
=
image_size
;
}
bool
show_art_found
;
string
?
show_album_art
=
get_prop
<
string
>
(
config
,
"show-album-art"
,
out
show_art_found
);
if
(
show_art_found
&&
show_album_art
!=
null
)
{
mpris_config
.
show_album_art
=
AlbumArtState
.
parse
(
show_album_art
);
}
Json
.
Array
?
blacklist
=
get_prop_array
(
config
,
"blacklist"
);
if
(
blacklist
!=
null
)
{
mpris_config
.
blacklist
=
new
string
[
blacklist
.
get_length
()];
...
...
src/controlCenter/widgets/mpris/mpris_player.vala
View file @
3320bdb1
...
...
@@ -95,6 +95,7 @@ namespace SwayNotificationCenter.Widgets.Mpris {
});
});
album_art
.
set_pixel_size
(
mpris_config
.
image_size
);
album_art
.
set_visible
(
mpris_config
.
show_album_art
==
AlbumArtState
.
ALWAYS
);
}
public
void
before_destroy
()
{
...
...
@@ -280,6 +281,7 @@ namespace SwayNotificationCenter.Widgets.Mpris {
get_scale_factor
(),
snapshot
);
Graphene
.
Size
size
=
Graphene
.
Size
().
init
(
icon_size
,
icon_size
);
album_art
.
set_from_paintable
(
snapshot
.
free_to_paintable
(
size
));
album_art
.
set_visible
(
mpris_config
.
show_album_art
!=
AlbumArtState
.
NEVER
);
// Set background album art
background_picture
.
set_paintable
(
album_art_texture
);
...
...
@@ -289,6 +291,8 @@ namespace SwayNotificationCenter.Widgets.Mpris {
}
}
album_art
.
set_visible
(
mpris_config
.
show_album_art
==
AlbumArtState
.
ALWAYS
);
// Get the app icon
Icon
?
icon
=
null
;
if
(
desktop_entry
is
DesktopAppInfo
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment