soap-config.diff (1922B)
1 From c762b66ee13eaa6a31608cf69cbabd8679931960 Mon Sep 17 00:00:00 2001 2 From: Riaz <riaz@riazj.com> 3 Date: Sun, 7 Sep 2025 20:20:55 -0700 4 Subject: [PATCH] config 5 6 --- 7 Makefile | 7 ++++--- 8 config.h | 8 ++++---- 9 soap.c | 3 +-- 10 3 files changed, 9 insertions(+), 9 deletions(-) 11 12 diff --git a/Makefile b/Makefile 13 index 5a6af7f..a757c51 100644 14 --- a/Makefile 15 +++ b/Makefile 16 @@ -1,4 +1,4 @@ 17 -# soap - simple xdg-open replacement with fallback 18 +# soap - simple xdg-open replacement 19 20 include config.mk 21 22 @@ -30,8 +30,9 @@ clean: 23 install: all 24 @test -f /usr/bin/xdg-open_ || (echo backing up to /usr/bin/xdg-open_; mv /usr/bin/xdg-open /usr/bin/xdg-open_) 25 @echo installing new xdg-open 26 - @cp -f soap /usr/bin/xdg-open 27 - @chmod 755 /usr/bin/xdg-open 28 + @cp -f soap /usr/bin 29 + @chmod 755 /usr/bin/soap 30 + @ln -sf /usr/bin/soap /usr/bin/xdg-open 31 32 uninstall: 33 @echo moving xdg-open_ back into place 34 diff --git a/config.h b/config.h 35 index c2e3ee6..92edcc9 100644 36 --- a/config.h 37 +++ b/config.h 38 @@ -2,8 +2,8 @@ 39 40 static const Pair pairs[] = { 41 /* regex action */ 42 - { "\.(jpg|png|tiff)$", "feh %s" }, 43 - { "\.gif$", "wget -O /tmp/tmp_gifview.gif %s && gifview -a /tmp/tmp_gifview.gif" }, 44 - { "\.mp3$", "st -e mplayer %s" }, 45 - { "^(http://|https://)?(www\.)?(youtube.com/watch\?|youtu\.be/)", "youtube-viewer %s" } 46 + { "\.(jpg|png|tiff)$", "nsxiv %s" }, 47 + { "\.(mp3|mp4|mkv)$", "mpv %s" }, 48 + { "\.(htm|html)$", "st w3m %s" }, 49 + { "\.pdf$", "zathura %s" } 50 }; 51 diff --git a/soap.c b/soap.c 52 index 3e6ed20..79d893e 100644 53 --- a/soap.c 54 +++ b/soap.c 55 @@ -49,8 +49,7 @@ main(int argc, char *argv[]){ 56 regfree(®ex); 57 } 58 59 - /* alternatively, fall back to xdg-open_ */ 60 - snprintf(cmd, sizeof cmd, "xdg-open_ %s", sharg); 61 + snprintf(cmd, sizeof cmd, "st less %s", sharg); 62 system(cmd); 63 return EXIT_SUCCESS; 64 } 65 -- 66 2.51.0 67