From fcf27a74966e9d68302c9ee7e5d6338ae21bd925 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 20 Apr 2021 09:08:24 +0200 Subject: downloads: Destroy stop_icon only in downloadCb_finished --- downloads.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/downloads.c b/downloads.c index 09b7bb0..4c54b95 100644 --- a/downloads.c +++ b/downloads.c @@ -122,8 +122,6 @@ downloadCb_failed(WebKitDownload *webkit_download, GError *error, gpointer user_ gtk_label_set_text(GTK_LABEL(download->status), formatted); - gtk_widget_destroy(download->stop_icon); - gtk_image_set_from_icon_name( GTK_IMAGE(download->icon), "network-error-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); } -- cgit v1.3.1-23-gd82d From 5da426dab654296ff8c53ad138317df0d7984d12 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 20 Apr 2021 09:09:12 +0200 Subject: badwolf.1: Fix extension path --- badwolf.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/badwolf.1 b/badwolf.1 index 111c0cc..d0a9e68 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -99,7 +99,7 @@ XBEL (XML Bookmark Exchange Language) file, known to be currently supported by: .Pp For more information about this format see: .Lk http://pyxml.sourceforge.net/topics/xbel/ -.It Pa ${XDG_DATA_HOME:-$HOME/.local/share}/badwolf/webkit-web-extensions/ +.It Pa ${XDG_DATA_HOME:-$HOME/.local/share}/badwolf/webkit-web-extension/ Directory containing the .Lk https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebExtension.html WebKitWebExtensions to be loaded into -- cgit v1.3.1-23-gd82d From 1661e0380ec0a37b04d33f9a487c9b2c0047b05a Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 22 Apr 2021 03:35:14 +0200 Subject: about-dialog: Auto-switch, use gtk_window_close gtk_widget_destroy on about_dialog shouldn't SEGV but it does on GTK+ 3.24.26 --- keybindings.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keybindings.c b/keybindings.c index bfc8f7a..ad704d1 100644 --- a/keybindings.c +++ b/keybindings.c @@ -14,9 +14,9 @@ about_dialogCb_activate_link(GtkAboutDialog *about_dialog, gchar *uri, gpointer (void)about_dialog; struct Window *window = (struct Window *)user_data; - badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, uri, NULL), FALSE); + badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, uri, NULL), TRUE); - gtk_widget_destroy(GTK_WIDGET(about_dialog)); + gtk_window_close(GTK_WINDOW(about_dialog)); return TRUE; } -- cgit v1.3.1-23-gd82d From 97fa6ede7a9cec6e2a3cc6c32ef38363552c6dc4 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 15 Jul 2021 15:23:06 +0200 Subject: Makefile: Add EXTRA_CFLAGS --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2ec3a80..4349593 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ DATADIR ?= $(PREFIX)/share/badwolf APPSDIR ?= $(PREFIX)/share/applications CC ?= cc -CFLAGS ?= -g -O2 -pie -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wconversion -Wsign-conversion -O2 -Werror=implicit-function-declaration -Werror=implicit-int -Werror=vla +CFLAGS ?= -g -O2 -pie -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wconversion -Wsign-conversion -O2 -Werror=implicit-function-declaration -Werror=implicit-int -Werror=vla $(EXTRA_CFLAGS) DBG ?= PKGCONFIG ?= pkg-config MSGFMT ?= msgfmt -- cgit v1.3.1-23-gd82d From cd0f66ed04f2604cce81dfd6ed1cce9715d376bf Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 15 Jul 2021 15:23:36 +0200 Subject: badwolf.1: Add tip to list dictionairies in enchant --- badwolf.1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/badwolf.1 b/badwolf.1 index d0a9e68..ced99e1 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -72,6 +72,11 @@ For example .Ic BADWOLF_L10N="en_GB:fr_FR:de_DE" . When this variable isn't set, spelling isn't activated. A more generic variable name is also intended to be used in the future. +.Pp +To get the list of supported dictionaries execute +.Ic enchant-lsmod-2 -list-dicts +or before enchant 2.0: +.Ic enchant-lsmod -list-dicts .El .Sh FILES .Bl -tag -width Ds -compact -- cgit v1.3.1-23-gd82d From 3c8aa19036086624029f314cc6f0d75b9c757171 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 15 Jul 2021 18:51:20 +0200 Subject: Makefile: Force some cflags, bump _XOPEN_SOURCE to 700 --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4349593..10bd767 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,8 @@ DATADIR ?= $(PREFIX)/share/badwolf APPSDIR ?= $(PREFIX)/share/applications CC ?= cc -CFLAGS ?= -g -O2 -pie -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wconversion -Wsign-conversion -O2 -Werror=implicit-function-declaration -Werror=implicit-int -Werror=vla $(EXTRA_CFLAGS) +CFLAGS ?= -g -O2 -pie -fPIE +CFLAGS += -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wconversion -Wsign-conversion -Werror=implicit-function-declaration -Werror=implicit-int -Werror=vla $(EXTRA_CFLAGS) DBG ?= PKGCONFIG ?= pkg-config MSGFMT ?= msgfmt @@ -33,7 +34,7 @@ EXE_test = uri_test TRANS = fr.mo pt_BR.mo tr.mo de.mo DOCS = usr.bin.badwolf README.md KnowledgeBase.md interface.txt -CDEPS = -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION_FULL)\" +CDEPS = -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION_FULL)\" CDEPS += `$(PKGCONFIG) --cflags $(DEPS)` LIBS = `$(PKGCONFIG) --libs $(DEPS)` -- cgit v1.3.1-23-gd82d From 2bdcf0acfc94f64fd2c287bd560143d3d840b9db Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 5 Aug 2021 11:44:18 +0200 Subject: README.md: FreeNode → GeekNode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d2f194b..d99da03 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,8 @@ You need to have gettext installed. If you want a GUI, poedit exists and Weblate - Initialising a new PO file (example for German, `de_DE`): ``msginit -l de_DE -i po/messages.pot -o po/de.po`` ## Contacts / Discussions -- IRC: `#badwolf-browser` on FreeNode -- Matrix (bridge): +- IRC: `#badwolf-browser` on [GeekNode](https://www.geeknode.org/) +- Matrix (bridge): [#badwolf-browser:matrix.fdn.fr](https://matrix.to/#/#badwolf-browser:matrix.fdn.fr) ## Repositories ### git -- cgit v1.3.1-23-gd82d From 714dea37efa4ef1be1b0bb12ef56c8128fcfd24f Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 16 Aug 2021 16:17:06 +0200 Subject: badwolf.h: Add WEBKIT_CHECK_VERSION Thanks for people inability to check the README --- badwolf.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/badwolf.h b/badwolf.h index 7919be8..2b2882a 100644 --- a/badwolf.h +++ b/badwolf.h @@ -5,6 +5,10 @@ #include /* uint64_t */ #include +#if ! WEBKIT_CHECK_VERSION(2,32,0) +#error WebkitGTK 2.32.0 is the latest supported version for badwolf. +#endif + extern const gchar *homepage; extern const gchar *version; -- cgit v1.3.1-23-gd82d From c5fca92a08a8a63ad4d746b4d3a44a9cf724ea61 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 7 Sep 2021 02:46:07 +0200 Subject: Change buildsystem to use a ./configure script This is done to support webkit2gtk-4.1 (libsoup3) vs. webkit2gtk-4.0 (libsoup2). It will also be useful once WebKitGTK with support for GTK4 lands in badwolf. --- .gitignore | 1 + Makefile | 39 +++++----------------- README.md | 4 +-- configure | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ version.sh | 13 +++++--- 5 files changed, 130 insertions(+), 37 deletions(-) create mode 100755 configure diff --git a/.gitignore b/.gitignore index fba98ae..b1e22a0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /badwolf /locale +/config.mk *.o *.mo diff --git a/Makefile b/Makefile index 10bd767..b8d8e3e 100644 --- a/Makefile +++ b/Makefile @@ -3,29 +3,8 @@ # - Usage of ?= for defining variables when not already defined # - Usage of += for appending to a variable -PACKAGE = Badwolf -VERSION = 1.1.0 -VERSION_FULL = $(VERSION)`./version.sh` - -PREFIX ?= /usr/local -BINDIR ?= $(PREFIX)/bin -MANDIR ?= $(PREFIX)/share/man -DOCDIR ?= $(PREFIX)/share/doc/badwolf-$(VERSION) -DATADIR ?= $(PREFIX)/share/badwolf -APPSDIR ?= $(PREFIX)/share/applications - -CC ?= cc -CFLAGS ?= -g -O2 -pie -fPIE -CFLAGS += -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wconversion -Wsign-conversion -Werror=implicit-function-declaration -Werror=implicit-int -Werror=vla $(EXTRA_CFLAGS) -DBG ?= -PKGCONFIG ?= pkg-config -MSGFMT ?= msgfmt -INKSCAPE ?= inkscape - -# for i in 24 32 48 64 128 256; do echo icons/hicolor/${i}x${i}/apps/badwolf.png; done | tr '\n' ' ' -ICON_SIZES = icons/hicolor/24x24/apps/badwolf.png icons/hicolor/32x32/apps/badwolf.png icons/hicolor/48x48/apps/badwolf.png icons/hicolor/64x64/apps/badwolf.png icons/hicolor/128x128/apps/badwolf.png icons/hicolor/256x256/apps/badwolf.png - -DEPS = gtk+-3.0 webkit2gtk-4.0 libsoup-2.4 libxml-2.0 +include config.mk + SRCS = bookmarks.c uri.c uri_test.c keybindings.c downloads.c badwolf.c OBJS = bookmarks.o uri.o keybindings.o downloads.o badwolf.o OBJS_test = uri_test.o @@ -34,11 +13,11 @@ EXE_test = uri_test TRANS = fr.mo pt_BR.mo tr.mo de.mo DOCS = usr.bin.badwolf README.md KnowledgeBase.md interface.txt -CDEPS = -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION_FULL)\" -CDEPS += `$(PKGCONFIG) --cflags $(DEPS)` -LIBS = `$(PKGCONFIG) --libs $(DEPS)` +all: config.mk $(EXE) $(TRANS) po/messages.pot -all: $(EXE) $(TRANS) po/messages.pot +config.mk: configure + @echo "Error: You need to execute ./configure before running make" + @exit 1 icons: $(ICON_SIZES) @@ -64,10 +43,10 @@ badwolf: $(OBJS) $(CC) -std=c11 -o $@ $(OBJS) $(LDFLAGS) $(LIBS) .c: - $(CC) -std=c11 $(CFLAGS) $(CDEPS) $(LDFLAGS) $(LIBS) -o $@ $< + $(CC) -std=c11 $(CFLAGS) $(LDFLAGS) $(LIBS) -o $@ $< .c.o: - $(CC) -std=c11 $(CFLAGS) $(CDEPS) -c -o $@ $< + $(CC) -std=c11 $(CFLAGS) -c -o $@ $< uri_test: uri.o uri_test.o $(CC) -std=c11 -o $@ uri.o uri_test.o $(LDFLAGS) $(LIBS) @@ -95,7 +74,7 @@ install: all .PHONY: clean clean: - rm -fr locale $(OBJS) $(OBJS_test) $(EXE) $(EXE_test) + rm -fr locale config.mk $(OBJS) $(OBJS_test) $(EXE) $(EXE_test) format: *.c *.h clang-format -style=file -assume-filename=.clang-format -i *.c *.h diff --git a/README.md b/README.md index d99da03..5f61b0a 100644 --- a/README.md +++ b/README.md @@ -54,13 +54,13 @@ You need to have gettext installed. If you want a GUI, poedit exists and Weblate Dependencies are: - C11 Compiler (such as clang or gcc) -- [WebKitGTK](https://webkitgtk.org/), only the latest stable is supported +- [WebKitGTK](https://webkitgtk.org/), only the latest stable(2.32.0+) is supported - [libxml-2.0](http://www.xmlsoft.org/), no known version limitation - POSIX make with extension for shell in variables (works with GNU, {Net,Free,Open}BSD) - A pkg-config implementation (pkgconf is recommended) - (optionnal) gettext implementation (such as GNU Gettext) -Compilation is done with `make`, install with `make install` (`DESTDIR` and `PREFIX` environment variables are supported, amongs other common ones). An example AppArmor profile is provided at `usr.bin.badwolf`, please do some long runtime checks before shipping it or a modified version, help can be provided but with no support. +Compilation is done with `./configure && make`, install with `make install` (`DESTDIR` and `PREFIX` environment variables are supported, amongs other common ones). An example AppArmor profile is provided at `usr.bin.badwolf`, please do some long runtime checks before shipping it or a modified version, help can be provided but with no support. You'll also need inkscape (command line only) if you want to regenerate the icons, for example after modifying them or adding a new size. These aren't needed for normal installation as it is bundled. diff --git a/configure b/configure new file mode 100755 index 0000000..17510a0 --- /dev/null +++ b/configure @@ -0,0 +1,110 @@ +#!/bin/sh +VERSION=1.1.0 +VERSION_FULL=${VERSION}$(./version.sh) +PREFIX="${PREFIX:-/usr/local}" +BINDIR="${BINDIR:-${PREFIX}/bin}" +MANDIR="${MANDIR:-${PREFIX}/share/man}" +DOCDIR="${DOCDIR:-${PREFIX}/share/doc/badwolf-${VERSION}}" +DATADIR="${DATADIR:-${PREFIX}/share/badwolf}" +APPSDIR="${APPSDIR:-${PREFIX}/share/applications}" + +PKGCONFIG="${PKGCONFIG:-pkg-config}" +MSGFMT="${MSGFMT:-msgfmt}" +INKSCAPE="${INKSCAPE:-inkscape}" +CC="${CC:-cc}" +CFLAGS="${CFLAGS:--g -O2 -pie -fPIE} -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wconversion -Wsign-conversion -Werror=implicit-function-declaration -Werror=implicit-int -Werror=vla ${EXTRA_CFLAGS}" + +DEPS="gtk+-3.0 libxml-2.0" + +is_ok() { + status="$?" + + if test "$status" == 0; then + printf " OK\n" + else + printf " FAIL\n" + fi + + return $status +} + +required() { + is_ok || exit 1 +} + +pkg_config_check() { + printf 'Checking: %s %s ...' "${PKGCONFIG}" "$*" + "${PKGCONFIG}" "$@" + is_ok +} + +printf 'Checking %s command existance ...' "${PKGCONFIG}" +command -v "${PKGCONFIG}" >/dev/null ; required + +printf 'Checking %s command existance ...' "${CC}" +command -v "${CC}" >/dev/null ; required + +for dep in ${DEPS} +do + pkg_config_check --exists "$dep" || exit 1 +done + +case "${WITH_WEBKITGTK}n" in + 4.1n) + pkg_config_check --atleast-version=2.32.0 webkit2gtk-4.1 || exit 1 + DEPS="${DEPS} webkit2gtk-4.1 libsoup-3.0" + ;; + 4.0n) + pkg_config_check --atleast-version=2.32.0 webkit2gtk-4.0 || exit 1 + DEPS="${DEPS} webkit2gtk-4.0 libsoup-2.4" + ;; + n) + echo "warning: Packagers should specify the ABI version (4.0 or 4.1) in WITH_WEBKITGTK" >&2 + if pkg_config_check --atleast-version=2.32.0 webkit2gtk-4.1 + then + DEPS="${DEPS} webkit2gtk-4.1 libsoup-3.0" + else + pkg_config_check --atleast-version=2.32.0 webkit2gtk-4.0 || exit 1 + DEPS="${DEPS} webkit2gtk-4.0 libsoup-2.4" + fi + ;; + *) + echo "error: invalid webkit2gtk version in WITH_WEBKITGTK environment variable, must be 4.0 or 4.1" >&2 + exit 1 + ;; +esac + +get_cflags() { "${PKGCONFIG}" --cflags "${DEPS}"; } +DEPS_cflags="$(get_cflags)" +get_libs() { "${PKGCONFIG}" --libs "${DEPS}"; } +DEPS_libs="$(get_libs)" + +ICON_SIZES="$(for i in 24 32 48 64 128 256; do printf 'icons/hicolor/%sx%s/apps/badwolf.png ' $i $i ; done)" + +printf 'Writing to config.mk ...' +cat >config.mk </dev/null) -branch=$(git --git-dir="$(dirname $0)/.git" rev-parse --abbrev-ref HEAD | sed -r 's/.*[^0-9A-Za-z-]([0-9A-Za-z-]*)$/\1/g') - -if [ -n "$hash" ] || [ -n "$branch" ] +if command -v git 2>/dev/null >/dev/null then - printf '+g%s.%s' "$hash" "$branch" + hash=$(git --git-dir="$(dirname $0)/.git" rev-parse --short HEAD 2>/dev/null) + branch=$(git --git-dir="$(dirname $0)/.git" rev-parse --abbrev-ref HEAD 2>/dev/null | sed -r 's/.*[^0-9A-Za-z-]([0-9A-Za-z-]*)$/\1/g') + + if [ -n "$hash" ] || [ -n "$branch" ] + then + printf '+g%s.%s' "$hash" "$branch" + fi fi echo -- cgit v1.3.1-23-gd82d From 6ee5839da2515bd3d44f549b10da4363b48ae685 Mon Sep 17 00:00:00 2001 From: "striker.sh" Date: Fri, 5 Feb 2021 20:37:24 +0100 Subject: Close tab when releasing middle mouse click --- badwolf.c | 17 ++++++++++++++--- interface.txt | 4 +++- keybindings.c | 14 ++++++++++++++ keybindings.h | 2 ++ 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/badwolf.c b/badwolf.c index aea2bbc..1202944 100644 --- a/badwolf.c +++ b/badwolf.c @@ -165,16 +165,23 @@ badwolf_new_tab_box(const gchar *title, struct Client *browser) GtkWidget *tab_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_name(tab_box, "browser__tabbox"); + GtkWidget *close = gtk_button_new_from_icon_name("window-close-symbolic", GTK_ICON_SIZE_LARGE_TOOLBAR); gtk_widget_set_name(close, "browser__tabbox__close"); GtkWidget *label = gtk_label_new(title); gtk_widget_set_name(label, "browser__tabbox__label"); + GtkWidget *label_event_box = gtk_event_box_new(); + gtk_container_add(GTK_CONTAINER(label_event_box), label); GtkWidget *context_label = gtk_label_new(context_id_str); gtk_widget_set_name(context_label, "browser__tabbox__context_label"); + GtkWidget *context_label_event_box = gtk_event_box_new(); + gtk_container_add(GTK_CONTAINER(context_label_event_box), context_label); GtkWidget *playing = gtk_image_new_from_icon_name("audio-volume-high-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_widget_set_name(playing, "browser__tabbox__playing"); + GtkWidget *playing_event_box = gtk_event_box_new(); + gtk_container_add(GTK_CONTAINER(playing_event_box), playing); #ifdef BADWOLF_TAB_BOX_WIDTH gtk_widget_set_size_request(label, BADWOLF_TAB_BOX_WIDTH, -1); @@ -188,9 +195,9 @@ badwolf_new_tab_box(const gchar *title, struct Client *browser) gtk_label_set_single_line_mode(GTK_LABEL(label), TRUE); gtk_label_set_single_line_mode(GTK_LABEL(context_label), TRUE); - gtk_box_pack_start(GTK_BOX(tab_box), context_label, TRUE, TRUE, 0); - gtk_box_pack_start(GTK_BOX(tab_box), playing, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(tab_box), label, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(tab_box), context_label_event_box, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(tab_box), playing_event_box, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(tab_box), label_event_box, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(tab_box), close, FALSE, FALSE, 0); gtk_button_set_relief(GTK_BUTTON(close), GTK_RELIEF_NONE); @@ -201,6 +208,9 @@ badwolf_new_tab_box(const gchar *title, struct Client *browser) gtk_widget_show_all(tab_box); gtk_widget_set_visible(playing, webkit_web_view_is_playing_audio(browser->webView)); + gtk_widget_set_events(label, GDK_BUTTON_RELEASE_MASK); + g_signal_connect( + tab_box, "button-release-event", G_CALLBACK(tab_boxCb_button_release_event), browser); return tab_box; } @@ -863,6 +873,7 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b browser); g_signal_connect(browser->webView, "create", G_CALLBACK(WebViewCb_create), browser); g_signal_connect(browser->webView, "close", G_CALLBACK(WebViewCb_close), browser); + g_signal_connect( browser->webView, "key-press-event", G_CALLBACK(WebViewCb_key_press_event), browser); g_signal_connect(browser->webView, "scroll-event", G_CALLBACK(WebViewCb_scroll_event), browser); diff --git a/interface.txt b/interface.txt index 42f7f5c..e90e32b 100644 --- a/interface.txt +++ b/interface.txt @@ -1,5 +1,7 @@ # Badwolf -- A tablist with a new tab button at the end, right-clicking on the tablist gives you the list in a context-menu format +- A tablist with a new tab button at the end +- right-clicking on the tablist gives you the list in a context-menu format +- middle-clicking on the focused tab closes it - Each tab contains a Browser View or the Downloads View ## Tab Labels diff --git a/keybindings.c b/keybindings.c index ad704d1..cb033fd 100644 --- a/keybindings.c +++ b/keybindings.c @@ -190,3 +190,17 @@ main_windowCb_key_press_event(GtkWidget *widget, GdkEvent *event, gpointer user_ return FALSE; } + +gboolean +tab_boxCb_button_release_event(GtkWidget *widget, GdkEvent *event, gpointer user_data) +{ + (void)widget; + struct Client *browser = (struct Client *)user_data; + + if(((GdkEventButton *)event)->button == GDK_BUTTON_MIDDLE) + { + webkit_web_view_try_close(browser->webView); + return TRUE; + } + return FALSE; +} diff --git a/keybindings.h b/keybindings.h index e7d1d6b..bec9189 100644 --- a/keybindings.h +++ b/keybindings.h @@ -9,4 +9,6 @@ gboolean boxCb_key_press_event(GtkWidget *widget, GdkEvent *event, gpointer user gboolean commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client *browser); gboolean main_windowCb_key_press_event(GtkWidget *widget, GdkEvent *event, gpointer user_data); gboolean WebViewCb_key_press_event(WebKitWebView *webView, GdkEvent *event, gpointer user_data); +gboolean tab_boxCb_button_release_event(GtkWidget *widget, GdkEvent *event, gpointer user_data); + #endif /* KEYBINDINGS_H_INCLUDED */ -- cgit v1.3.1-23-gd82d From ffc2fc8762f7f496162e4c2fa0d535a9fe1a27fe Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 14 Mar 2021 10:12:06 +0100 Subject: Initialize a GApplication --- badwolf.c | 7 +++++++ keybindings.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/badwolf.c b/badwolf.c index 1202944..6ef4cf3 100644 --- a/badwolf.c +++ b/badwolf.c @@ -1035,11 +1035,18 @@ int main(int argc, char *argv[]) { struct Window *window = &(struct Window){NULL, NULL, NULL, NULL, NULL, NULL}; + GApplication *application; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, DATADIR "/locale"); bind_textdomain_codeset(PACKAGE, "UTF-8"); textdomain(PACKAGE); + application = g_application_new("me.hacktivis.badwolf", + G_APPLICATION_HANDLES_COMMAND_LINE | + G_APPLICATION_SEND_ENVIRONMENT | G_APPLICATION_NON_UNIQUE); + g_application_register(application, NULL, NULL); + //g_application_activate(application); + gtk_init(&argc, &argv); fprintf(stderr, _("Running Badwolf version: %s\n"), version); diff --git a/keybindings.c b/keybindings.c index cb033fd..7108acd 100644 --- a/keybindings.c +++ b/keybindings.c @@ -102,7 +102,7 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client * return TRUE; case GDK_KEY_p: webkit_print_operation_run_dialog(webkit_print_operation_new(browser->webView), - GTK_WINDOW(browser->window)); + GTK_WINDOW(browser->window->main_window)); return TRUE; } } -- cgit v1.3.1-23-gd82d From 3f0e2f50f21a1968fc3217c3be436f7fb586dca0 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 19 Sep 2021 07:44:54 +0200 Subject: Switch from libsoup-2.4 to glib's GUri - SoupURI is gone in libsoup-3.0 - GUri got added in glib-2.66 - WebKitGTK 2.32.0 depends on >=glib-2.67 --- badwolf.c | 11 ++++++++--- badwolf.h | 2 +- configure | 8 ++++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/badwolf.c b/badwolf.c index 6ef4cf3..a0a7d09 100644 --- a/badwolf.c +++ b/badwolf.c @@ -439,7 +439,8 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view, struct Client *browser = (struct Client *)user_data; gchar *error_details = detail_tls_certificate_flags(errors); gint dialog_response; - SoupURI *failing_uri = soup_uri_new(failing_text); + + GUri *failing_uri = g_uri_parse(failing_text, G_URI_FLAGS_NONE, NULL); GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(browser->window->main_window), GTK_DIALOG_MODAL & GTK_DIALOG_DESTROY_WITH_PARENT, @@ -449,6 +450,10 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view, failing_text); gtk_dialog_add_buttons( GTK_DIALOG(dialog), _("Temporarily Add Exception"), 1, _("Continue"), 0, NULL); + if(!failing_uri) + { + gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog), 1, FALSE); + } gtk_dialog_set_default_response(GTK_DIALOG(dialog), 0); gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), "%s\n", error_details); @@ -457,11 +462,11 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view, if(dialog_response == 1) { webkit_web_context_allow_tls_certificate_for_host( - webkit_web_view_get_context(browser->webView), certificate, failing_uri->host); + webkit_web_view_get_context(browser->webView), certificate, g_uri_get_host(failing_uri)); webkit_web_view_reload(browser->webView); } - soup_uri_free(failing_uri); + g_free(failing_uri); g_free(error_details); gtk_widget_destroy(dialog); diff --git a/badwolf.h b/badwolf.h index 2b2882a..f751842 100644 --- a/badwolf.h +++ b/badwolf.h @@ -5,7 +5,7 @@ #include /* uint64_t */ #include -#if ! WEBKIT_CHECK_VERSION(2,32,0) +#if !WEBKIT_CHECK_VERSION(2, 32, 0) #error WebkitGTK 2.32.0 is the latest supported version for badwolf. #endif diff --git a/configure b/configure index 17510a0..c5fe4a8 100755 --- a/configure +++ b/configure @@ -52,20 +52,20 @@ done case "${WITH_WEBKITGTK}n" in 4.1n) pkg_config_check --atleast-version=2.32.0 webkit2gtk-4.1 || exit 1 - DEPS="${DEPS} webkit2gtk-4.1 libsoup-3.0" + DEPS="${DEPS} webkit2gtk-4.1" ;; 4.0n) pkg_config_check --atleast-version=2.32.0 webkit2gtk-4.0 || exit 1 - DEPS="${DEPS} webkit2gtk-4.0 libsoup-2.4" + DEPS="${DEPS} webkit2gtk-4.0" ;; n) echo "warning: Packagers should specify the ABI version (4.0 or 4.1) in WITH_WEBKITGTK" >&2 if pkg_config_check --atleast-version=2.32.0 webkit2gtk-4.1 then - DEPS="${DEPS} webkit2gtk-4.1 libsoup-3.0" + DEPS="${DEPS} webkit2gtk-4.1" else pkg_config_check --atleast-version=2.32.0 webkit2gtk-4.0 || exit 1 - DEPS="${DEPS} webkit2gtk-4.0 libsoup-2.4" + DEPS="${DEPS} webkit2gtk-4.0" fi ;; *) -- cgit v1.3.1-23-gd82d From b5cd1db565d4747591d1fbf1167db7f57e89cf61 Mon Sep 17 00:00:00 2001 From: Ngô Ngọc Đức Huy Date: Wed, 29 Sep 2021 11:26:22 +0700 Subject: Add Vietnamese translation --- po/vi.po | 237 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 po/vi.po diff --git a/po/vi.po b/po/vi.po new file mode 100644 index 0000000..ecbb253 --- /dev/null +++ b/po/vi.po @@ -0,0 +1,237 @@ +# Vietnamese translations for Badwolf package +# Bản dịch Tiếng Việt dành cho gói Badwolf. +# Copyright (C) 2021 Badwolf Authors +# This file is distributed under the same license as the Badwolf package. +# Ngô Ngọc Đức Huy , 2021. +# +msgid "" +msgstr "" +"Project-Id-Version: Badwolf 1.0.3+gedbbb27.develop\n" +"Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" +"POT-Creation-Date: 2021-04-09 08:48+0200\n" +"PO-Revision-Date: 2021-09-29 10:51+0700\n" +"Last-Translator: Ngô Ngọc Đức Huy \n" +"Language-Team: Vietnamese\n" +"Language: vi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: downloads.c:117 +#, c-format +msgid "%02i:%02i:%02i Download cancelled" +msgstr "%02i:%02i:%02i Đã huỷ tải xuống" + +#: downloads.c:119 +#, c-format +msgid "%02i:%02i:%02i Download error" +msgstr "%02i:%02i:%02i Lỗi tải xuống" + +#: downloads.c:141 +#, c-format +msgid "%02i:%02i:%02i Download finished" +msgstr "%02i:%02i:%02i Đã tải xong" + +#: downloads.c:167 +#, c-format +msgid "%02i:%02i:%02i Downloading…" +msgstr "%02i:%02i:%02i Đang tải…" + +#: downloads.c:199 downloads.c:216 downloads.c:219 +msgid "Badwolf Downloads" +msgstr "Các tệp tin đã tải từ Badwolf" + +#: bookmarks.c:116 +msgid "Bookmarks: Done.\n" +msgstr "Dấu trang: Xong.\n" + +#: bookmarks.c:59 +#, c-format +msgid "Bookmarks: Found %d bookmarks.\n" +msgstr "Dấu trang: Đã tìm thấy %d dấu trang.\n" + +#: bookmarks.c:81 +#, c-format +msgid "Bookmarks: No loadable file found at %s\n" +msgstr "Dấu trang: Không có tệp tin nào được tìm thấy tại %s\n" + +#: bookmarks.c:85 +#, c-format +msgid "Bookmarks: loading at %s\n" +msgstr "Dấu trang: đang tải ở %s\n" + +#: bookmarks.c:99 +msgid "Bookmarks: unable to create new XPath context\n" +msgstr "Dấu trang: không thể tạo context XPath mới\n" + +#: bookmarks.c:107 +#, c-format +msgid "Bookmarks: unable to evaluate XPath expression \"%s\"\n" +msgstr "Dấu trang: không thể tính biểu thức XPath \"%s\"\n" + +#: bookmarks.c:89 +#, c-format +msgid "Bookmarks: unable to parse file \"%s\"\n" +msgstr "Dấu trang: không thể đọc tệp tin \"%s\"\n" + +#: badwolf.c:1034 +#, c-format +msgid "Buildtime WebKit version: %d.%d.%d\n" +msgstr "Phiên bản WebKit tại thời điểm dựng: %d.%d.%d\n" + +#: badwolf.c:440 +msgid "Continue" +msgstr "Tiếp tục" + +#: badwolf.c:390 +msgid "" +"Couldn't verify the TLS certificate to ensure a better security of the " +"connection. You might want to verify your machine and network.\n" +"\n" +msgstr "" +"Không thể xác thực chứng thực TLS để đảm bảo tính bảo mật của kết nối này." +"Bạn có thể muống xác thực máy của bạn và mạng.\n" + +#: badwolf.c:100 +msgid "Crashed" +msgstr "Gặp sự cố" + +#: downloads.c:39 +msgid "Download starting…" +msgstr "Bắt đầu tải xuống…" + +#: badwolf.c:413 +msgid "Error: Some unknown error occurred validating the certificate.\n" +msgstr "Lỗi: Có một lỗi không xác định đã xảy ra khi đang hợp lệ hoá chứng thực." + +#: badwolf.c:394 +msgid "Error: The X509 Certificate Authority is unknown.\n" +msgstr "Lỗi: Nhà cung cấp Chứng thực X509 không được biết đến.\n" + +#: badwolf.c:407 +msgid "Error: The certificate has been revoked.\n" +msgstr "Lỗi: Chứng thực đã bị vô hiệu hoá.\n" + +#: badwolf.c:404 +msgid "Error: The certificate has expired. Check your system's clock.\n" +msgstr "Lỗi: Chứng thực đã hết hạn. Hãy kiểm tra đồng hồ hệ thống của bạn.\n" + +#: badwolf.c:410 +msgid "Error: The certificate is considered to be insecure.\n" +msgstr "Lỗi: Chứng thực được cho là không bảo mật.\n" + +#: badwolf.c:401 +msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" +msgstr "" +"Lỗi: Chứng thực chưa có hiệu lực. Hãy kiểm tra đồng hồ hệ thống của bạn.\n" + +#: badwolf.c:397 +msgid "Error: The given identity doesn't match the expected one.\n" +msgstr "Lỗi: Danh tính nhận được không trùng khớp với danh tính mong đợi.\n" + +#: keybindings.c:32 +#, c-format +msgid "" +"Minimalist and privacy-oriented web browser based on WebKitGTK\n" +"Runtime WebKit version: %d.%d.%d" +msgstr "" +"Trình duyệt web tối giản và hướng đến sự riêng tư dựa trên WebKitGTK\n" +"Phiên bản WebKit tại thời điểm chạy: %d.%d.%d" + +#: badwolf.c:904 +msgid "New tab" +msgstr "Tab mới" + +#: badwolf.c:1102 +msgid "Open new tab" +msgstr "Mở tab mới" + +#: badwolf.c:104 +msgid "Out of Memory" +msgstr "Đầy bộ nhớ" + +#: badwolf.c:1032 +#, c-format +msgid "Running Badwolf version: %s\n" +msgstr "Phiên bản Badwolf đang chạy: %s\n" + +#: badwolf.c:1039 +#, c-format +msgid "Runtime WebKit version: %d.%d.%d\n" +msgstr "Phiên bản WebKit tại thời điểm chạy: %d.%d.%d" + +#: badwolf.c:437 +#, c-format +msgid "TLS Error for %s." +msgstr "Lỗi TLS cho %s." + +#: badwolf.c:440 +msgid "Temporarily Add Exception" +msgstr "Tạm thời thêm ngoại lệ" + +#: badwolf.c:650 +msgid "Toggle javascript" +msgstr "Bật/tắt javascript" + +#: badwolf.c:655 +msgid "Toggle loading images automatically" +msgstr "Bật/tắt tự động tải ảnh" + +#: badwolf.c:108 +msgid "Unknown Crash" +msgstr "Gặp sự cố không xác định" + +#: badwolf.c:653 +msgid "_IMG" +msgstr "_IMG" + +#: badwolf.c:648 +msgid "_JS" +msgstr "_JS" + +#: badwolf.c:982 +#, c-format +msgid "badwolf: content-filter loaded, adding to content-manager…\n" +msgstr "badwolf: đã tải bộ lọc nội dung, đang thêm vào trình quản lý nội dung…\n" + +#: badwolf.c:1002 badwolf.c:1009 +#, c-format +msgid "badwolf: failed to compile content-filters.json, err: [%d] %s\n" +msgstr "badwolf: biên dịch content-filters.json thất bại, lỗi: [%d] %s\n" + +#: badwolf.c:970 badwolf.c:975 +#, c-format +msgid "badwolf: failed to load content-filter, err: [%d] %s\n" +msgstr "badwolf: tải bộ lọc nội dung thất bại, lỗi: [%d] %s\n" + +#: badwolf.c:1060 +#, c-format +msgid "content-filters file set to: %s\n" +msgstr "tệp tin chứa bộ lọc nội dung đã được cài thành: %s\n" + +#: badwolf.c:792 +msgid "search in current page" +msgstr "tìm trong trang hiện tại" + +#: badwolf.c:99 +msgid "the web process crashed.\n" +msgstr "tiến trình web gặp sự cố.\n" + +#: badwolf.c:103 +msgid "the web process exceeded the memory limit.\n" +msgstr "tiến trình web dùng quá giới hạn bộ nhớ.\n" + +#: badwolf.c:107 +msgid "the web process terminated for an unknown reason.\n" +msgstr "tiến trình web đã kết thúc với lý do không xác định.\n" + +#: badwolf.c:1046 +#, c-format +msgid "webkit-web-extension directory set to: %s\n" +msgstr "thư mục chứa tiện ích mở rộng webkit đực cài thành: %s\n" + +#. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. +#: badwolf.c:1138 +msgid "ø" +msgstr "" -- cgit v1.3.1-23-gd82d From 7e0b7516625bc94bf0734890ba07c5b2f7bc36f2 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 29 Sep 2021 07:06:42 +0200 Subject: Hook and fixup Vietnamese translation $ make [...] msgfmt -o locale/vi/LC_MESSAGES/Badwolf.mo po/vi.po po/vi.po:106: 'msgid' and 'msgstr' entries do not both end with '\n' po/vi.po:162: 'msgid' and 'msgstr' entries do not both end with '\n' msgfmt: found 2 fatal errors $ --- Makefile | 2 +- po/vi.po | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b8d8e3e..328da17 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ OBJS = bookmarks.o uri.o keybindings.o downloads.o badwolf.o OBJS_test = uri_test.o EXE = badwolf EXE_test = uri_test -TRANS = fr.mo pt_BR.mo tr.mo de.mo +TRANS = fr.mo pt_BR.mo tr.mo de.mo vi.mo DOCS = usr.bin.badwolf README.md KnowledgeBase.md interface.txt all: config.mk $(EXE) $(TRANS) po/messages.pot diff --git a/po/vi.po b/po/vi.po index ecbb253..b4e4ed8 100644 --- a/po/vi.po +++ b/po/vi.po @@ -103,7 +103,7 @@ msgstr "Bắt đầu tải xuống…" #: badwolf.c:413 msgid "Error: Some unknown error occurred validating the certificate.\n" -msgstr "Lỗi: Có một lỗi không xác định đã xảy ra khi đang hợp lệ hoá chứng thực." +msgstr "Lỗi: Có một lỗi không xác định đã xảy ra khi đang hợp lệ hoá chứng thực.\n" #: badwolf.c:394 msgid "Error: The X509 Certificate Authority is unknown.\n" @@ -159,7 +159,7 @@ msgstr "Phiên bản Badwolf đang chạy: %s\n" #: badwolf.c:1039 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" -msgstr "Phiên bản WebKit tại thời điểm chạy: %d.%d.%d" +msgstr "Phiên bản WebKit tại thời điểm chạy: %d.%d.%d\n" #: badwolf.c:437 #, c-format -- cgit v1.3.1-23-gd82d From 76c98a18dfe8459c09ee051c8860a406c527687b Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 1 Oct 2021 21:01:10 +0200 Subject: badwolf.1: Fix problems seen with mandoc -Tlint --- badwolf.1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/badwolf.1 b/badwolf.1 index ced99e1..f27ef20 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -3,6 +3,7 @@ .\" SPDX-License-Identifier: BSD-3-Clause .Dd 2019-10-31 .Dt BADWOLF 1 +.Os .Sh NAME .Nm badwolf .Nd minimalist and privacy-oriented web browser based on WebKitGTK @@ -43,7 +44,7 @@ Toggles caret browsing. .It browser F12 Opens the web inspector. .It browser Ctrl-[ / Ctrl-] -Go back/forward in current tab’s history +Go back/forward in current tab's history .It browser Ctrl-p Print the current page. (spawns a dialog) .It any Alt-Left / Alt-Right @@ -83,11 +84,9 @@ or before enchant 2.0: .It Pa ${XDG_CONFIG_HOME:-$HOME/.config}/badwolf/content-filters.json WebKit-specific content-filter file, this allows to block unwanted content (ads, nagware, ...). For some introductory information about the format see: -.Bl -compact .Lk https://webkit.org/blog/3476/content-blockers-first-look/ .Lk https://webkit.org/blog/4062/targeting-domains-with-content-blockers/ .Lk https://developer.apple.com/documentation/safariservices/creating_a_content_blocker -.El .Pp For a converter using AblockPlus-style filters, try: .Lk https://gitlab.com/eyeo/adblockplus/abp2blocklist -- cgit v1.3.1-23-gd82d From dd3e46487b980fd0f2b9aa017b27e1af2f2bd07a Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 1 Oct 2021 21:19:58 +0200 Subject: Make: Add manpage linting mandb / GNU groff seems to have less tolerance than mandoc for rendering slightly broken manpages, which is rather annoying in my case. --- Makefile | 1 + README.md | 4 +++- configure | 11 +++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 328da17..0ff8b3d 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,7 @@ uri_test: uri.o uri_test.o .PHONY: test test: $(EXE_test) + $(MANDOC) -Tlint -Wunsupp,error,warning ./badwolf.1 .PHONY: install install: all diff --git a/README.md b/README.md index 5f61b0a..e5205e1 100644 --- a/README.md +++ b/README.md @@ -53,12 +53,14 @@ You need to have gettext installed. If you want a GUI, poedit exists and Weblate ## Manual Installation Dependencies are: +- POSIX-compatible Shell (ie. mrsh, dash, lksh) - C11 Compiler (such as clang or gcc) - [WebKitGTK](https://webkitgtk.org/), only the latest stable(2.32.0+) is supported - [libxml-2.0](http://www.xmlsoft.org/), no known version limitation - POSIX make with extension for shell in variables (works with GNU, {Net,Free,Open}BSD) - A pkg-config implementation (pkgconf is recommended) -- (optionnal) gettext implementation (such as GNU Gettext) +- (optional) gettext implementation (such as GNU Gettext) +- (optional, test) [mandoc](https://mdocml.bsd.lv/) (the command) for linting the manpage Compilation is done with `./configure && make`, install with `make install` (`DESTDIR` and `PREFIX` environment variables are supported, amongs other common ones). An example AppArmor profile is provided at `usr.bin.badwolf`, please do some long runtime checks before shipping it or a modified version, help can be provided but with no support. diff --git a/configure b/configure index c5fe4a8..b3e179a 100755 --- a/configure +++ b/configure @@ -13,6 +13,7 @@ MSGFMT="${MSGFMT:-msgfmt}" INKSCAPE="${INKSCAPE:-inkscape}" CC="${CC:-cc}" CFLAGS="${CFLAGS:--g -O2 -pie -fPIE} -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wconversion -Wsign-conversion -Werror=implicit-function-declaration -Werror=implicit-int -Werror=vla ${EXTRA_CFLAGS}" +MANDOC="mandoc" DEPS="gtk+-3.0 libxml-2.0" @@ -44,6 +45,15 @@ command -v "${PKGCONFIG}" >/dev/null ; required printf 'Checking %s command existance ...' "${CC}" command -v "${CC}" >/dev/null ; required +printf 'Checking %s command existance ...' "${MANDOC}" +if command -v "${CC}" >/dev/null ; is_ok +then + : +else + MANDOC="true" +fi + + for dep in ${DEPS} do pkg_config_check --exists "$dep" || exit 1 @@ -100,6 +110,7 @@ CC = ${CC} INKSCAPE = ${INKSCAPE} MSGFMT = ${MSGFMT} DBG = ${DBG} +MANDOC = ${MANDOC} CFLAGS = ${CFLAGS} -DDATADIR=\"\${DATADIR}\" -DPACKAGE=\"\${PACKAGE}\" -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"\${VERSION_FULL}\" ${DEPS_cflags} LIBS = ${DEPS_libs} -- cgit v1.3.1-23-gd82d From f20a2e583e075f728a133c920fd8479993d5233f Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 1 Oct 2021 21:19:58 +0200 Subject: badwolf.1: Add more details in the FILES section --- badwolf.1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/badwolf.1 b/badwolf.1 index f27ef20..63b7e4a 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -80,6 +80,12 @@ or before enchant 2.0: .Ic enchant-lsmod -list-dicts .El .Sh FILES +The following paths are using +.Xr sh 1 +syntax to correctly support XDG Base Directory Specification, you can use the +.Xr echo 1 +command to check where it is on your system. +.Pp .Bl -tag -width Ds -compact .It Pa ${XDG_CONFIG_HOME:-$HOME/.config}/badwolf/content-filters.json WebKit-specific content-filter file, this allows to block unwanted content (ads, nagware, ...). @@ -95,6 +101,7 @@ For a ready-to-use file (that you should update periodically), try: .Lk https://easylist-downloads.adblockplus.org/easylist_min_content_blocker.json .It Pa ${XDG_CACHE_HOME:-$HOME/.cache}/badwolf/filters This is where the compiled filters are stored, the file(s) in it are automatically generated and so shouldn't be edited. +Documented here only for sandboxing / access-control purposes. .It Pa ${XDG_DATA_HOME:-$HOME/.local/share}/badwolf/bookmarks.xbel XBEL (XML Bookmark Exchange Language) file, known to be currently supported by: .Xr elinks 1 , @@ -103,6 +110,9 @@ XBEL (XML Bookmark Exchange Language) file, known to be currently supported by: .Pp For more information about this format see: .Lk http://pyxml.sourceforge.net/topics/xbel/ +.Pp +For an example XBEL file see: +.Lk https://hacktivis.me/bookmarks.xbel .It Pa ${XDG_DATA_HOME:-$HOME/.local/share}/badwolf/webkit-web-extension/ Directory containing the .Lk https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebExtension.html WebKitWebExtensions -- cgit v1.3.1-23-gd82d From 8575d17bc1bc432682f1db5f16867adee1f75b6c Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 1 Oct 2021 21:49:26 +0200 Subject: badwolf.1: Fix gtk-doc css-properties URL --- badwolf.1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/badwolf.1 b/badwolf.1 index 63b7e4a..fc57955 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -125,7 +125,8 @@ Examples of useful extensions may be found at: .It Pa ${XDG_DATA_HOME:-$HOME/.local/share}/badwolf/interface.css CSS files (respectively system and user-level) for styling badwolf interface. See -.Lk https://developer.gnome.org/gtk3/stable/chap-css-properties.html +.\" GNOME can't even into doing any redirections of the few docs available +.Lk http://web.archive.org/web/20210420214617/https://developer.gnome.org/gtk3/stable/chap-css-properties.html for the properties being available. .Pp For testing your styles I would recommend using the -- cgit v1.3.1-23-gd82d From 03503fcd1fcfe05a212dbf40083f5593ee2d9b52 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 2 Oct 2021 18:43:36 +0200 Subject: configure: Fix test case in is_ok For some reason this only broke in NetBSD while it's entirely out of POSIX. --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index b3e179a..9646723 100755 --- a/configure +++ b/configure @@ -20,7 +20,7 @@ DEPS="gtk+-3.0 libxml-2.0" is_ok() { status="$?" - if test "$status" == 0; then + if test $status -eq 0; then printf " OK\n" else printf " FAIL\n" -- cgit v1.3.1-23-gd82d From f539edf6f68be78e7be36a94f5020a6193f58867 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 2 Oct 2021 19:04:42 +0200 Subject: Bump to 1.2.0 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 9646723..3776bfa 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #!/bin/sh -VERSION=1.1.0 +VERSION=1.2.0 VERSION_FULL=${VERSION}$(./version.sh) PREFIX="${PREFIX:-/usr/local}" BINDIR="${BINDIR:-${PREFIX}/bin}" -- cgit v1.3.1-23-gd82d