Modified behaviour of bumblebee.output.scrollable to allow for custom scroll speed and toggling "bouncing" of text, and applied it to deadbeef and spotify
This commit is contained in:
parent
4bb10d6ea4
commit
8ea9762472
3 changed files with 27 additions and 12 deletions
|
@ -2,13 +2,10 @@
|
|||
|
||||
"""Displays the current song being played in DeaDBeeF and
|
||||
provides some media control bindings.
|
||||
|
||||
Left click toggles pause, scroll up skips the current song,
|
||||
scroll down returns to the previous song.
|
||||
|
||||
Requires the following library:
|
||||
* subprocess
|
||||
|
||||
Parameters:
|
||||
* deadbeef.format: Format string (defaults to "{artist} - {title}")
|
||||
Available values are: {artist}, {title}, {album}, {length},
|
||||
|
@ -17,7 +14,6 @@ Parameters:
|
|||
* deadbeef.previous: Change binding for previous song (default is left click)
|
||||
* deadbeef.next: Change binding for next song (default is right click)
|
||||
* deadbeef.pause: Change binding for toggling pause (default is middle click)
|
||||
|
||||
Available options for deadbeef.previous, deadbeef.next and deadbeef.pause are:
|
||||
LEFT_CLICK, RIGHT_CLICK, MIDDLE_CLICK, SCROLL_UP, SCROLL_DOWN
|
||||
"""
|
||||
|
@ -26,6 +22,8 @@ import bumblebee.input
|
|||
import bumblebee.output
|
||||
import bumblebee.engine
|
||||
|
||||
from bumblebee.output import scrollable
|
||||
|
||||
try:
|
||||
import subprocess
|
||||
except ImportError:
|
||||
|
@ -59,6 +57,7 @@ class Module(bumblebee.engine.Module):
|
|||
engine.input.register_callback(self, button=buttons[pause_button],
|
||||
cmd=cmd + "--play-pause")
|
||||
|
||||
@scrollable
|
||||
def deadbeef(self, widget):
|
||||
return str(self._song)
|
||||
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
# pylint: disable=C0111,R0903
|
||||
|
||||
"""Displays the current song being played
|
||||
|
||||
Requires the following library:
|
||||
* python-dbus
|
||||
|
||||
Parameters:
|
||||
* spotify.format: Format string (defaults to "{artist} - {title}")
|
||||
Available values are: {album}, {title}, {artist}, {trackNumber}, {playbackStatus}
|
||||
* spotify.previous: Change binding for previous song (default is left click)
|
||||
* spotify.next: Change binding for next song (default is right click)
|
||||
* spotify.pause: Change binding for toggling pause (default is middle click)
|
||||
|
||||
Available options for spotify.previous, spotify.next and spotify.pause are:
|
||||
LEFT_CLICK, RIGHT_CLICK, MIDDLE_CLICK, SCROLL_UP, SCROLL_DOWN
|
||||
"""
|
||||
|
@ -20,6 +17,8 @@ import bumblebee.input
|
|||
import bumblebee.output
|
||||
import bumblebee.engine
|
||||
|
||||
from bumblebee.output import scrollable
|
||||
|
||||
try:
|
||||
import dbus
|
||||
except ImportError:
|
||||
|
@ -53,6 +52,7 @@ class Module(bumblebee.engine.Module):
|
|||
engine.input.register_callback(self, button=buttons[pause_button],
|
||||
cmd=cmd + "PlayPause")
|
||||
|
||||
@scrollable
|
||||
def spotify(self, widget):
|
||||
return str(self._song)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue