Skip to content

Commit 7727db5

Browse files
committed
ytdl-mpv: use injected properties
See: vivien#132
1 parent 8db2f8d commit 7727db5

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Diff for: ytdl-mpv/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ command=$SCRIPT_DIR/ytdl-mpv
2020
markup=pango
2121
interval=once
2222
signal=4
23+
#CACHE_DEFAULT=1048576
24+
#PLAYING_COLOR=red
25+
#NOT_PLAYING_COLOR=white
2326
```
2427

2528
Copy a youtube URL into your clipboard and then click on the blocklet to make sure everything works.

Diff for: ytdl-mpv/ytdl-mpv

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ use warnings;
1010
use utf8;
1111
use Data::Validate::URI;
1212

13-
my $cache_default = 1048576;
14-
my $signal = 4;
13+
my $cache_default = $ENV{CACHE_DEFAULT} || 1048576;
14+
my $signal = $ENV{SIGNAL} || or die;
1515
my $notify_i3bar = "pkill -RTMIN+$signal i3blocks";
1616
my $string = qx/xclip -out/;
1717
$string =~ s/[';\\]//g; # remove characters that can cause i3-msg to crash
1818
my $uriValidator = new Data::Validate::URI();
1919
my $BLOCK_BUTTON = $ENV{BLOCK_BUTTON} || 0;
20-
my $PLAYING_COLOR = "red";
21-
my $NOT_PLAYING_COLOR = "white";
20+
my $PLAYING_COLOR = $ENV{PLAYING_COLOR} || "red";
21+
my $NOT_PLAYING_COLOR = $ENV{PLAYING_COLOR} || "white";
2222
my $USER = $ENV{USER};
2323
my $i3cmd = "";
2424
my $i3cmdexitstatus = 0;

0 commit comments

Comments
 (0)