From cd6b158e3e56a54f3719b9658a439184613f04b7 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Fri, 16 Dec 2022 01:03:35 +0100 Subject: [PATCH] feat: make reader mode right Use a whiter background, which is nicer on my screen. Add plugin step to install.sh --- config.h | 4 +-- install.sh | 2 ++ plugins/readability/readability.c | 2 +- plugins/readability/readability.h | 2 +- plugins/readability/readability.js | 31 +++++++++++++------ .../readability/recompute_READABILITY_N.sh | 4 +-- 6 files changed, 30 insertions(+), 15 deletions(-) mode change 100644 => 100755 plugins/readability/recompute_READABILITY_N.sh diff --git a/config.h b/config.h index 26cd817..b9b75b7 100644 --- a/config.h +++ b/config.h @@ -29,8 +29,8 @@ #define KEY(x) GDK_KEY_##x #define ZOOM 1.4 /* Starting zoom level.*/ #define ZOOM_VAL .1 /* Zooming value in zoomin/zoomout functions */ -#define BG_COLOR "#FEFEFE" /*"#1E1E2E" */ -#define DEBUG false +#define BG_COLOR "#FFFFFF" /* "FEFEFE", "#1E1E2E" */ +#define DEBUG false typedef enum { goback, diff --git a/install.sh b/install.sh index 884f6f2..d173a61 100755 --- a/install.sh +++ b/install.sh @@ -1,3 +1,5 @@ +./plugins/*/*.sh + ./build.sh && { cp -f rose /usr/bin mkdir -p /usr/share/themes/rose diff --git a/plugins/readability/readability.c b/plugins/readability/readability.c index e1b356a..cffa796 100644 --- a/plugins/readability/readability.c +++ b/plugins/readability/readability.c @@ -1,7 +1,7 @@ #include #include #include -#define READABILITY_N 83768 +#define READABILITY_N 84254 + 1 void read_readability_js(char* string){ FILE *fp=fopen("/home/loki/Documents/core/software/fresh/C/rose-browser/rose-bud-personal/plugins/readability/readability.js", "r"); diff --git a/plugins/readability/readability.h b/plugins/readability/readability.h index a3c2c70..6280bbf 100644 --- a/plugins/readability/readability.h +++ b/plugins/readability/readability.h @@ -1,7 +1,7 @@ #ifndef READABILITY #define READABILITY -#define READABILITY_N 83768 +#define READABILITY_N 84254 + 1 void read_readability_js(char* string); diff --git a/plugins/readability/readability.js b/plugins/readability/readability.js index bd86e03..deb64b8 100644 --- a/plugins/readability/readability.js +++ b/plugins/readability/readability.js @@ -2303,20 +2303,33 @@ var style_sheet_simple = ` ` + +/* +body { + max-width: 650px; + margin: 40px auto; + padding: 0 10px; + font: 18px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + color: #444 +} +*/ /* See also * * and the one included in firefox @ diff --git a/plugins/readability/recompute_READABILITY_N.sh b/plugins/readability/recompute_READABILITY_N.sh old mode 100644 new mode 100755 index b6af67b..3ca6e38 --- a/plugins/readability/recompute_READABILITY_N.sh +++ b/plugins/readability/recompute_READABILITY_N.sh @@ -3,6 +3,6 @@ function sedr(){ find ./ -type f -exec sed -i -e "$1" {} \; } ## e.g., sedr "s/target/replacement/g" -READABILITY_N=$(wc -c readability.js | cut -d " " -f 1) -sedr "s/^#define READABILITY_N .*/#define READABILITY_N $READABILITY_N/g" +READABILITY_N=$(wc -c ./plugins/*/readability.js | cut -d " " -f 1) +sedr "s/^#define READABILITY_N .*/#define READABILITY_N $READABILITY_N + 1/g"