mirror of
https://github.com/swaywm/sway.git
synced 2024-11-21 23:41:27 +00:00
Updated GTK 3 settings on Wayland (markdown)
parent
b79bc0ab80
commit
cfb93254ff
|
@ -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 <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=""
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue