-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0001-Ticket-4479-prioritize-console-players-for-audio-vid.patch
101 lines (89 loc) · 2.81 KB
/
0001-Ticket-4479-prioritize-console-players-for-audio-vid.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
From 01d2bdf31001b0f6553af586ed334eedddf7bcc3 Mon Sep 17 00:00:00 2001
From: "Yury V. Zaytsev" <yury@shurup.com>
Date: Thu, 29 Aug 2024 09:35:11 +0200
Subject: [PATCH] Ticket #4479: prioritize console players for audio/video and
images
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
---
misc/ext.d/image.sh | 13 +++++++++----
misc/ext.d/sound.sh | 2 +-
misc/ext.d/video.sh | 16 ++++------------
3 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/misc/ext.d/image.sh b/misc/ext.d/image.sh
index c191225c8..a99c137b1 100755
--- a/misc/ext.d/image.sh
+++ b/misc/ext.d/image.sh
@@ -6,7 +6,7 @@
action=$1
filetype=$2
-[ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open"
+[ [ -n "$DISPLAY" ] && [ -n "${MC_XDG_OPEN}" ] ] || MC_XDG_OPEN="xdg-open"
do_view_action() {
filetype=$1
@@ -50,10 +50,15 @@ do_open_action() {
else
(gqview "${MC_EXT_FILENAME}" &)
fi
- elif which see >/dev/null 2>&1; then
- (see "${MC_EXT_FILENAME}" &)
+ elif which fim >/dev/null 2>&1; then
+ (fim "${MC_EXT_FILENAME}")
+ elif which fbi >/dev/null 2>&1; then
+ (fbi "${MC_EXT_FILENAME}")
+ elif which zgv >/dev/null 2>&1; then
+ (zgv "${MC_EXT_FILENAME}")
else
- (zgv "${MC_EXT_FILENAME}" &)
+ echo "Please install either fim or fbi to view this file"
+ return
fi
;;
esac
diff --git a/misc/ext.d/sound.sh b/misc/ext.d/sound.sh
index 60a3cdd52..125e9b045 100755
--- a/misc/ext.d/sound.sh
+++ b/misc/ext.d/sound.sh
@@ -6,7 +6,7 @@
action=$1
filetype=$2
-[ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open"
+[ [ -n "$DISPLAY" ] && [ -n "${MC_XDG_OPEN}" ] ] || MC_XDG_OPEN="xdg-open"
do_view_action() {
filetype=$1
diff --git a/misc/ext.d/video.sh b/misc/ext.d/video.sh
index 9cba21020..01b0ddda0 100755
--- a/misc/ext.d/video.sh
+++ b/misc/ext.d/video.sh
@@ -6,7 +6,7 @@
action=$1
filetype=$2
-[ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open"
+[ [ -n "$DISPLAY" ] && [ -n "${MC_XDG_OPEN}" ] ] || MC_XDG_OPEN="xdg-open"
do_view_action() {
filetype=$1
@@ -29,23 +29,15 @@ do_open_action() {
filetype=$1
if which mpv >/dev/null 2>&1; then
- PLAYER=mpv
+ PLAYER="mpv --really-quiet"
elif which mplayer >/dev/null 2>&1; then
- PLAYER=mplayer
+ PLAYER="mplayer -really-quiet"
else
echo "Please install either mplayer or mpv to play this file"
return
fi
- case "${filetype}" in
- *)
- if [ -n "$DISPLAY" ]; then
- ($PLAYER "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
- else
- $PLAYER -vo null "${MC_EXT_FILENAME}"
- fi
- ;;
- esac
+ (clear && $PLAYER "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
}
case "${action}" in
--
2.39.3 (Apple Git-146)