From 96676069aaaea036dccb73f992852358a65bca47 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 3 May 2020 02:24:04 +0200 Subject: Add a logo --- Makefile | 15 +++- README.md | 2 + badwolf.c | 1 + badwolf.svg | 117 ++++++++++++++++++++++++++++++++ icons/hicolor/128x128/apps/badwolf.png | Bin 0 -> 6551 bytes icons/hicolor/256x256/apps/badwolf.png | Bin 0 -> 14810 bytes icons/hicolor/48x48/apps/badwolf.png | Bin 0 -> 1958 bytes icons/hicolor/64x64/apps/badwolf.png | Bin 0 -> 2847 bytes icons/hicolor/scalable/apps/badwolf.svg | 2 + icons_size.sh | 4 ++ keybindings.c | 1 + 11 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 badwolf.svg create mode 100644 icons/hicolor/128x128/apps/badwolf.png create mode 100644 icons/hicolor/256x256/apps/badwolf.png create mode 100644 icons/hicolor/48x48/apps/badwolf.png create mode 100644 icons/hicolor/64x64/apps/badwolf.png create mode 100644 icons/hicolor/scalable/apps/badwolf.svg create mode 100755 icons_size.sh diff --git a/Makefile b/Makefile index f8183b4..d1403cd 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,9 @@ DBG ?= PKGCONFIG ?= pkg-config MSGFMT ?= msgfmt +# for i in 48 64 128 256; do echo icons/hicolor/${i}x${i}/apps/badwolf.png; done | tr '\n' ' ' +ICON_SIZES = 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 SRCS = uri.c uri_test.c keybindings.c badwolf.c OBJS = uri.o keybindings.o badwolf.o @@ -33,7 +36,15 @@ CDEPS = -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_POSIX_C_SOURCE=2008 CDEPS += `$(PKGCONFIG) --cflags $(DEPS)` LIBS = `$(PKGCONFIG) --libs $(DEPS)` -all: $(EXE) $(TRANS) po/messages.pot +all: $(EXE) $(ICON_SIZES) $(TRANS) po/messages.pot + +icons/hicolor/scalable/apps/badwolf.svg: badwolf.svg + mkdir -p icons/hicolor/scalable/apps + scour --no-line-breaks --enable-id-stripping --remove-metadata $< $@ + +icons/hicolor/%/apps/badwolf.png: icons/hicolor/scalable/apps/badwolf.svg + mkdir -p `dirname $@` + rsvg-convert -a `echo $@ | cut -d/ -f3 | ./icons_size.sh` $< -o $@ po/messages.pot: $(SRCS) xgettext --keyword=_ --language=C --from-code=UTF-8 -o $@ --add-comments --sort-output --copyright-holder="Badwolf Authors " --package-name="$(PACKAGE)" --package-version="$(VERSION_FULL)" --msgid-bugs-address="contact+badwolf-msgid@hacktivis.me" $(SRCS) @@ -74,6 +85,8 @@ install: all cp -p badwolf.desktop $(DESTDIR)$(APPSDIR)/ mkdir -p $(DESTDIR)$(DOCDIR) cp -p $(DOCS) $(DESTDIR)$(DOCDIR)/ + mkdir -p $(DESTDIR)$(PREFIX)/share + cp -r icons $(DESTDIR)$(PREFIX)/share/ @printf '\nNote: An example AppArmor profile has been installed at '$(DOCDIR)/usr.bin.badwolf'\n' .PHONY: clean diff --git a/README.md b/README.md index 6ce8eef..98734e5 100644 --- a/README.md +++ b/README.md @@ -56,5 +56,7 @@ Dependencies are: Compilation is done with `make CC=${CC:-cc}`, install with `make install`. An example AppArmor profile is provided at `usr.bin.badwolf`, please do runtime checks before deploying. +You'll also need `rsvg-convert(1)` (from librsvg) and scour 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. + ## Notes Most of the privacy/security stuff will be done with patches against WebKit as quite a lot isn’t into [WebKitSettings](https://webkitgtk.org/reference/webkit2gtk/stable/WebKitSettings.html) and with generic WebKit extensions that should be resuseable. diff --git a/badwolf.c b/badwolf.c index 75296e4..275b033 100644 --- a/badwolf.c +++ b/badwolf.c @@ -790,6 +790,7 @@ main(int argc, char *argv[]) gtk_window_set_default_size( GTK_WINDOW(window->main_window), BADWOLF_DEFAULT_WIDTH, BADWOLF_DEFAULT_HEIGHT); gtk_window_set_role(GTK_WINDOW(window->main_window), "browser"); + gtk_window_set_icon_name(GTK_WINDOW(window->main_window), "badwolf"); GtkCssProvider *css_provider_app = gtk_css_provider_new(); gchar *provider_path_app = g_build_filename(DATADIR, "interface.css", NULL); diff --git a/badwolf.svg b/badwolf.svg new file mode 100644 index 0000000..3635724 --- /dev/null +++ b/badwolf.svg @@ -0,0 +1,117 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icons/hicolor/128x128/apps/badwolf.png b/icons/hicolor/128x128/apps/badwolf.png new file mode 100644 index 0000000..e2cd289 Binary files /dev/null and b/icons/hicolor/128x128/apps/badwolf.png differ diff --git a/icons/hicolor/256x256/apps/badwolf.png b/icons/hicolor/256x256/apps/badwolf.png new file mode 100644 index 0000000..c391692 Binary files /dev/null and b/icons/hicolor/256x256/apps/badwolf.png differ diff --git a/icons/hicolor/48x48/apps/badwolf.png b/icons/hicolor/48x48/apps/badwolf.png new file mode 100644 index 0000000..0f3af2c Binary files /dev/null and b/icons/hicolor/48x48/apps/badwolf.png differ diff --git a/icons/hicolor/64x64/apps/badwolf.png b/icons/hicolor/64x64/apps/badwolf.png new file mode 100644 index 0000000..a54c7aa Binary files /dev/null and b/icons/hicolor/64x64/apps/badwolf.png differ diff --git a/icons/hicolor/scalable/apps/badwolf.svg b/icons/hicolor/scalable/apps/badwolf.svg new file mode 100644 index 0000000..cae9b3d --- /dev/null +++ b/icons/hicolor/scalable/apps/badwolf.svg @@ -0,0 +1,2 @@ + + diff --git a/icons_size.sh b/icons_size.sh new file mode 100755 index 0000000..29adf3a --- /dev/null +++ b/icons_size.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# Transforms an icon size from the Icon Theme Specification to rsvg-convert(1) options +#sed -r -e 's;^([^x]*)x([^@]*)$;-w \1 -h \2;' -e 's;^([^x]*)x([^@]*)@(.*)$;-w \1 -h \2 -z \3;' +sed -r 's;^([^x]*)x([^@]*)$;-w \1 -h \2;' diff --git a/keybindings.c b/keybindings.c index e134fc4..b6806f3 100644 --- a/keybindings.c +++ b/keybindings.c @@ -46,6 +46,7 @@ badwolf_about_dialog(GtkWindow *main_window, gpointer user_data) gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(about_dialog), homepage); gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(about_dialog), comments); gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about_dialog), version); + gtk_about_dialog_set_logo_icon_name(GTK_ABOUT_DIALOG(about_dialog), "badwolf"); g_signal_connect(about_dialog, "activate-link", G_CALLBACK(about_dialogCb_activate_link), window); -- cgit v1.3.1-23-gd82d