Skip to content

Commit d241adf

Browse files
authored
fix(bin/mpvctl)!: remove potentially faulty nc, use socat (#26)
* ci(lint.yml): install required `socat` dep * fix(bin/mpvctl)!: remove potentially faulty `nc`, use `socat` there are a plenty of `nc` flavours out there, and not all support `-U` flag to communicate with unix-socks BREAKING CHANGE: `socat` required dependency * fix(ytdl-mpv): update required deps (s/nc/socat)
1 parent ccef095 commit d241adf

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Install deps
2929
run: |
3030
sudo apt update
31-
sudo apt install mpv rofi
31+
sudo apt install socat mpv rofi
3232
python -m pip install yt-dlp
3333
- name: Setup some envs
3434
run: |

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
**Dependencies**
4848

49-
* `nc` `sqlite3` `xargs`
49+
* `socat` `sqlite3` `xargs`
5050
* [`mpv`](https://github.com/mpv-player/mpv)
5151
* [`rofi>=1.6.1`](https://github.com/davatorium/rofi)
5252
* [`yt-dlp==2023.02.17`](https://github.com/yt-dlp/yt-dlp)

bin/mpvctl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ _die() {
2626
_checkDep() {
2727
type mpv > /dev/null 2>&1 || _die "Cannot find mpv in your \$PATH"
2828
type yt-dlp > /dev/null 2>&1 || _die "Cannot find yt-dlp in your \$PATH"
29-
type nc > /dev/null 2>&1 && SOCKCMD="nc -U -N $SOCKET"
30-
type socat > /dev/null 2>&1 && SOCKCMD="socat - $SOCKET"
31-
[ "$SOCKCMD" ] || _die "Cannot find socat or nc in your \$PATH. Install before continue"
29+
type socat > /dev/null 2>&1 || _die "Cannot find socat in your \$PATH"
30+
SOCKCMD="socat - $SOCKET"
3231
}
3332

3433
# Check if sock is idle, otherwise exit
@@ -71,7 +70,7 @@ EOF
7170

7271
# Check sock status, only for information
7372
_getSock() {
74-
if [ ! -S $SOCKET ]; then
73+
if [ ! -S "$SOCKET" ]; then
7574
printf 'disabled\n'
7675
exit 0
7776
fi

bin/ytdl-mpv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ _info() {
125125
# Ensure dependencies
126126
_checkDep() {
127127
local deps
128-
deps=(mpv mpvctl nc rofi sqlite3 yt-dlp xargs xclip)
128+
deps=(mpv mpvctl socat rofi sqlite3 yt-dlp xargs xclip)
129129
for dep in "${deps[@]}"; do
130130
type "$dep" > /dev/null 2>&1 || {
131131
if [ "$dep" == "xclip" ]; then

0 commit comments

Comments
 (0)