diff options
| author | Sam Nystrom <sam@samnystrom.dev> | 2023-07-19 11:50:26 -0400 |
|---|---|---|
| committer | Sam Nystrom <sam@samnystrom.dev> | 2023-07-19 11:52:52 -0400 |
| commit | e976d9f0d8138a199a182b8266979338c23711d2 (patch) | |
| tree | 9729c4b1f9a3f2692e18f2b0a4cdaeaf309aa5d6 /bin | |
| parent | 74805789cd1c1c6aa4f8233cfd4c03d8dc3033fe (diff) | |
shuffle: add volume flag
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/shuffle | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/bin/shuffle b/bin/shuffle index 103b95c..d676963 100755 --- a/bin/shuffle +++ b/bin/shuffle @@ -15,11 +15,10 @@ def main(): nargs='?', help= 'play files in <path>, or the current directory if <path> is not passed') - parser.add_argument('-m', - dest='mpv_opts', - default=['--no-video'], - action='append', - help='pass <opts> to mpv') + parser.add_argument('--volume', + default=100.0, + type=float, + help='volume for mpv (should be in 0-100 range)') args = parser.parse_args() # Keep track of the last few files we played and avoid playing them again @@ -37,7 +36,7 @@ def main(): del prev[:len(prev) - 2] print('Playing', file) - subprocess.run(['mpv', *args.mpv_opts, file]) + subprocess.run(['mpv', f'--volume={args.volume}', file]) if __name__ == "__main__": try: |
