From cfb93254ff8c3544d05cbd4cb7f9a333c496c093 Mon Sep 17 00:00:00 2001 From: Jonathan Kirszling Date: Fri, 18 Dec 2020 12:00:49 +0100 Subject: [PATCH] Updated GTK 3 settings on Wayland (markdown) --- GTK-3-settings-on-Wayland.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/GTK-3-settings-on-Wayland.md b/GTK-3-settings-on-Wayland.md index 4db0509..52eabb8 100644 --- a/GTK-3-settings-on-Wayland.md +++ b/GTK-3-settings-on-Wayland.md @@ -36,25 +36,25 @@ If you'd rather have those values picked from your settings.ini file, here is a ```bash #!/bin/sh -# usage: import-gsettings : : ... +# usage: import-gsettings +config="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini" +if [ ! -f "$config" ]; then exit 1; fi -expression="" -for pair in "$@"; do - IFS=:; set -- $pair - expressions="$expressions -e 's:^$2=(.*)$:gsettings set org.gnome.desktop.interface $1 \1:e'" -done -IFS= -eval exec sed -E $expressions "${XDG_CONFIG_HOME:-$HOME/.config}"/gtk-3.0/settings.ini >/dev/null +gnome_schema="org.gnome.desktop.interface" +gtk_theme="$(grep 'gtk-theme-name' "$config" | cut -d'=' -f2)" +icon_theme="$(grep 'gtk-icon-theme-name' "$config" | cut -d'=' -f2)" +cursor_theme="$(grep 'gtk-cursor-theme-name' "$config" | cut -d'=' -f2)" +font_name="$(grep 'gtk-font-name' "$config" | cut -d'=' -f2)" +gsettings set "$gnome_schema" gtk-theme "$gtk_theme" +gsettings set "$gnome_schema" icon-theme "$icon_theme" +gsettings set "$gnome_schema" cursor-theme "$cursor_theme" +gsettings set "$gnome_schema" font-name "$font_name" ``` Importing the gtk, icon, and cursor themes: ``` -exec_always import-gsettings \ - gtk-theme:gtk-theme-name \ - icon-theme:gtk-icon-theme-name \ - cursor-theme:gtk-cursor-theme-name\ - font-name:gtk-font-name +exec_always import-gsettings ``` ## XSettings