mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
Merge pull request #284 from dmitmel/master
[pull] master from dmitmel:master
This commit is contained in:
commit
0023372fb8
2 changed files with 12 additions and 0 deletions
|
@ -233,6 +233,7 @@ set commentstring=//%s
|
||||||
let g:delimitMate_expand_cr = 1
|
let g:delimitMate_expand_cr = 1
|
||||||
|
|
||||||
let g:surround_{char2nr('*')} = "**\r**"
|
let g:surround_{char2nr('*')} = "**\r**"
|
||||||
|
let g:surround_{char2nr('~')} = "~~\r~~"
|
||||||
|
|
||||||
let g:pencil#wrapModeDefault = 'soft'
|
let g:pencil#wrapModeDefault = 'soft'
|
||||||
let g:pencil#conceallevel = 0
|
let g:pencil#conceallevel = 0
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
# type: ignore
|
||||||
|
|
||||||
# A simple graphical menu to control MPRIS-compatible players through Playerctl.
|
# A simple graphical menu to control MPRIS-compatible players through Playerctl.
|
||||||
# <https://wiki.archlinux.org/index.php/MPRIS>
|
# <https://wiki.archlinux.org/index.php/MPRIS>
|
||||||
|
@ -7,7 +8,9 @@
|
||||||
# TODO: Update the menu on player status changes.
|
# TODO: Update the menu on player status changes.
|
||||||
|
|
||||||
import math
|
import math
|
||||||
|
import posixpath
|
||||||
import sys
|
import sys
|
||||||
|
import urllib.parse
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
|
|
||||||
|
@ -59,6 +62,14 @@ def iter_metadata_entries_for_player(player):
|
||||||
if album:
|
if album:
|
||||||
yield album.get_string()
|
yield album.get_string()
|
||||||
|
|
||||||
|
else:
|
||||||
|
url = metadata.lookup_value("xesam:url")
|
||||||
|
if url:
|
||||||
|
url_parsed = urllib.parse.urlparse(url.get_string())
|
||||||
|
if url_parsed.scheme == "file":
|
||||||
|
filename = posixpath.basename(urllib.parse.unquote(url_parsed.path))
|
||||||
|
yield filename
|
||||||
|
|
||||||
if player.props.can_seek:
|
if player.props.can_seek:
|
||||||
position_secs = player.props.position / 1e6
|
position_secs = player.props.position / 1e6
|
||||||
duration = metadata.lookup_value("mpris:length")
|
duration = metadata.lookup_value("mpris:length")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue