1
0
mirror of https://github.com/eoli3n/dotfiles synced 2024-11-22 23:12:32 +01:00

changed gsettings script

This commit is contained in:
eoli3n 2020-12-18 11:59:23 +01:00
parent b5e476cb1c
commit 38d1197c27

@ -1,11 +1,15 @@
#!/bin/sh #!/bin/sh
# usage: import-gsettings <gsettings key>:<settings.ini key> <gsettings key>:<settings.ini key> ... # usage: import-gsettings
config="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini"
if [ ! -f "$config" ]; then exit 1; fi
expression="" gnome_schema="org.gnome.desktop.interface"
for pair in "$@"; do gtk_theme="$(grep 'gtk-theme-name' "$config" | cut -d'=' -f2)"
IFS=:; set -- $pair icon_theme="$(grep 'gtk-icon-theme-name' "$config" | cut -d'=' -f2)"
expressions="$expressions -e 's:^$2=(.*)$:gsettings set org.gnome.desktop.interface $1 \1:e'" cursor_theme="$(grep 'gtk-cursor-theme-name' "$config" | cut -d'=' -f2)"
done font_name="$(grep 'gtk-font-name' "$config" | cut -d'=' -f2)"
IFS= gsettings set "$gnome_schema" gtk-theme "$gtk_theme"
eval exec sed -E $expressions "${XDG_CONFIG_HOME:-$HOME/.config}"/gtk-3.0/settings.ini >/dev/null gsettings set "$gnome_schema" icon-theme "$icon_theme"
gsettings set "$gnome_schema" cursor-theme "$cursor_theme"
gsettings set "$gnome_schema" font-name "$font_name"