aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md13
-rwxr-xr-xmpris_to_text.py (renamed from music_update.py)19
2 files changed, 20 insertions, 12 deletions
diff --git a/README.md b/README.md
index 0af062f..90251b7 100644
--- a/README.md
+++ b/README.md
@@ -6,5 +6,14 @@ A Python script that fetches media data from MPRIS-compliant media players and s
6 6
7## Required packages 7## Required packages
8 8
9- [blessed](https://github.com/jquast/blessed) 9- [blessed](https://github.com/jquast/blessed): Terminal UI
10- [dbussy](https://github.com/ldo/dbussy) 10- [dbussy](https://github.com/ldo/dbussy): DBus client
11
12## Parameters
13
14- `-h`: Display help
15- `--file`: Full path to the file the data is written into
16- `--format-artist`: Format string for the artist part
17- `--format-title`: Format string for the title part
18- `--format-album`: Format string for the album part
19- `--format`: Format string that puts all parts together
diff --git a/music_update.py b/mpris_to_text.py
index d9f14c3..1284300 100755
--- a/music_update.py
+++ b/mpris_to_text.py
@@ -9,15 +9,14 @@ import signal
9 9
10from blessed import Terminal 10from blessed import Terminal
11 11
12import dbussy as dbus
13import ravel 12import ravel
14 13
15 14
16loop = asyncio.get_event_loop() 15loop = asyncio.get_event_loop()
17name_regex = re.compile("^org\.mpris\.MediaPlayer2\.") 16name_regex = re.compile("^org\.mpris\.MediaPlayer2\.")
18
19bus = None 17bus = None
20term = Terminal() 18term = Terminal()
19
21refresh_cond = threading.Condition() 20refresh_cond = threading.Condition()
22refresh_flag = True 21refresh_flag = True
23exit_flag = False 22exit_flag = False
@@ -253,12 +252,6 @@ def read_args():
253 default = "/tmp/mpris_info.txt", 252 default = "/tmp/mpris_info.txt",
254 help = "Full path to file (default: \"/tmp/mpris_info.txt\")" 253 help = "Full path to file (default: \"/tmp/mpris_info.txt\")"
255 ) 254 )
256 parser.add_argument("--format-order",
257 type = str,
258 dest = "format",
259 default = "{artist}{title}{album} ",
260 help = "Format string (default: \"{artist}{title}{album} \")"
261 )
262 parser.add_argument("--format-artist", 255 parser.add_argument("--format-artist",
263 type = str, 256 type = str,
264 dest = "format_artist", 257 dest = "format_artist",
@@ -277,6 +270,12 @@ def read_args():
277 default = " from \"{}\"", 270 default = " from \"{}\"",
278 help = "Format string for the album part (default: \" from \"{}\"\")" 271 help = "Format string for the album part (default: \" from \"{}\"\")"
279 ) 272 )
273 parser.add_argument("--format",
274 type = str,
275 dest = "format",
276 default = "{artist}{title}{album} ",
277 help = "Full format string (default: \"{artist}{title}{album} \")"
278 )
280 279
281 args = parser.parse_args() 280 args = parser.parse_args()
282 filename = args.filename 281 filename = args.filename