-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathimport-gsettings
More file actions
executable file
·34 lines (28 loc) · 1012 Bytes
/
import-gsettings
File metadata and controls
executable file
·34 lines (28 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
### Imports settings from gtk-3.0/settings.ini to gsettings
### Used for wayland
### See [sway wiki page about GTK 3](https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland)
### I edited it
config="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini"
if [ ! -f "$config" ]; then exit 1; fi
gnome_schema="org.gnome.desktop.interface"
get_setting() {
grep "$1" "$config" | sed 's/.*\s*=\s*//'
}
set_gsetting() {
value="$(get_setting "$1")"
if [ -n "$value" ]; then
gsettings set "$gnome_schema" "$2" "$value"
fi
}
set_gsetting "gtk-theme-name" "gtk-theme"
set_gsetting "gtk-icon-theme-name" "icon-theme"
set_gsetting "gtk-cursor-theme-name" "cursor-theme"
set_gsetting "gtk-cursor-theme-size" "cursor-size"
set_gsetting "gtk-font-name" "font-name"
color_scheme="$(get_setting 'gtk-application-prefer-dark-theme')"
if [ "$color_scheme" = "1" ]; then
gsettings set "$gnome_schema" color-scheme "prefer-dark"
else
gsettings set "$gnome_schema" color-scheme "prefer-light"
fi