Merge branch 'style' into 'master'

Use dark style by default

See merge request Librem5/squeekboard!239
This commit is contained in:
Dorota Czaplejewicz
2019-11-15 13:49:28 +00:00
4 changed files with 32 additions and 2 deletions

2
debian/control vendored
View File

@ -34,6 +34,8 @@ Homepage: https://source.puri.sm/Librem5/squeekboard
Package: squeekboard
Architecture: linux-any
Depends:
# for the Adwaita-dark theme
gnome-themes-extra-data,
${shlibs:Depends}
${misc:Depends}
Description: On-screen keyboard for Wayland

View File

@ -1,2 +1,2 @@
# yaml-rust 0.4.3 shares some roots with libyaml, including the string which lintian checks, creating a false positive
squeekboard binary: embedded-library usr/bin/squeekboard: libyaml
squeekboard binary: embedded-library usr/bin/squeekboard-real: libyaml

View File

@ -95,7 +95,20 @@ libsqueekboard = static_library('libsqueekboard',
'-DEEK_COMPILATION=1'],
)
squeekboard = executable('squeekboard',
# the straight binary needs to be demoted in favor of the wrapper script
# due to styling being inconsistent
bindir = join_paths(prefix, get_option('bindir'))
wrapper_conf = configuration_data()
wrapper_conf.set('bindir', bindir)
configure_file(
input: '../tools/squeekboard.in',
output: 'squeekboard',
install_dir: bindir,
configuration: wrapper_conf,
install: true,
)
squeekboard = executable('squeekboard-real',
'server-main.c',
wl_proto_sources,
squeekboard_resources,

15
tools/squeekboard.in Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
set -e
# Override default theme but allow selecting the replacement
export GTK_THEME="Adwaita:dark"
CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
DIRS="${CONFIG_HOME} $(set -f; IFS=:; printf '%s\n' $XDG_CONFIG_DIRS)"
for DIR in ${DIRS}; do
if cat $DIR/squeekboard/gtk_theme 2> /dev/null; then
export GTK_THEME="$(cat $DIR/squeekboard/gtk_theme 2> /dev/null)"
break;
fi;
done;
exec @bindir@/squeekboard-real