Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pause icon option #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Restart your session or mpDris2 after changing mpDris2.conf.
[Bling]
notify = False
notify_paused = True
pause_icon = media-playback-pause-symbolic
mmkeys = True
cdprev = True

Expand Down
2 changes: 2 additions & 0 deletions src/mpDris2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#notify = True
# Send notifications while paused?
#notify_paused = True
# Notification icon when pausing. Leave empty to use album cover.
#pause_icon = media-playback-pause-symbolic
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this settings belongs in the [Notify] section and should be renamed to paused_icon.

There is already paused_summary and paused_body

# CD-like previous command: if playback is past 3 seconds, seek to the beginning
#cdprev = True

Expand Down
6 changes: 5 additions & 1 deletion src/mpDris2.in.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
'mmkeys': True,
'notify': (Notify is not None),
"notify_paused": False,
"pause_icon": "media-playback-pause-symbolic",
"cdprev": False,
# Notify
"summary": "",
Expand Down Expand Up @@ -643,7 +644,7 @@ def notify_about_track(self, meta, state="play"):
if state == "pause":
if not self._params["notify_paused"]:
return
uri = "media-playback-pause-symbolic"
uri = self._params["pause_icon"] or uri

if self._params["paused_summary"]:
title = self.format_notification(meta, self._params["paused_summary"])
Expand Down Expand Up @@ -1490,6 +1491,9 @@ def usage(params):
if config.has_option("Bling", p):
params[p] = config.getboolean("Bling", p)

if config.has_option("Bling", "pause_icon"):
params["pause_icon"] = config.get("Bling", "pause_icon")

if config.has_option("Notify", "summary"):
params["summary"] = config.get("Notify", "summary", raw=True)

Expand Down