[sway] initial step into template based theming for gtk, qt, kvantum settings;...

[sway] initial step into template based theming for gtk, qt, kvantum settings; removal of unnecessary shell script
parent ab2e69f5
......@@ -8,7 +8,7 @@ The directory hosts various configuration files of which the important ones are:
- ```/etc/sway/definitions```: host the global definitions such as the application launcher, terminal, the idle program, default and alternative modifier key, ...
- ```/etc/sway/config```: the default Sway configuration file. If you want to customize it, you should create a copy in ```$HOME/.config/sway``` and change it as needed.
- ```/etc/sway/config.d/99-autostart-applications```: contains all the programs that has to be started as soon as the Sway session initializes
- ```/etc/sway/themes/matcha```: the color configuration to match the matcha theme of Manjaro
- ```/etc/sway/themes/matcha-green```: the color configurations to match the matcha theme of Manjaro
## Basics
......@@ -110,7 +110,7 @@ As part of the Sway profile you also received a custom bash script `/usr/local/b
If you have the predecessor of the Pinebook Pro you will have to do the following minor tweaks on the default installation:
- for the correct battery status in Waybar you will have to update it's config (default in `/etc/xdg/waybar/`) by copying it to `$HOME/.config/waybar` and change the value of the "bat" property in the battery section
- for the correct battery status in Waybar you will have to update it's config (default in `/etc/sway/waybar/`) and change the value of the "bat" property in the battery section
```json
"battery": {
......
exec_always 'cat /etc/sway/themes/templates/gtk2 | sed "s/GTK_THEME/$gtk-theme/g; s/ICON_THEME/$icon-theme/g; s/GUI_FONT/$gui-font/g; s/CURSOR_THEME/$cursor-theme/g;" > $HOME/.gtkrc-2.0'
exec_always 'mkdir -p $HOME/.config/gtk-3.0 && \
cat /etc/sway/themes/templates/gtk3 | sed "s/GTK_THEME/$gtk-theme/g; s/ICON_THEME/$icon-theme/g; s/GUI_FONT/$gui-font/g; s/CURSOR_THEME/$cursor-theme/g;" > $HOME/.config/gtk-3.0/settings.ini'
exec_always 'mkdir -p $HOME/.config/gtk-4.0 && \
cat /etc/sway/themes/templates/gtk4 | sed "s/GTK_THEME/$gtk-theme/g; s/ICON_THEME/$icon-theme/g; s/GUI_FONT/$gui-font/g; s/CURSOR_THEME/$cursor-theme/g;" > $HOME/.config/gtk-4.0/settings.ini'
exec_always 'mkdir -p $HOME/.config/qt5ct && \
cat /etc/sway/themes/templates/qt5ct | sed "s/ICON_THEME/$icon-theme/g" > $HOME/.config/qt5ct/qt5ct.conf'
exec_always 'mkdir -p $HOME/.config/Kvantum && \
cat /etc/sway/themes/templates/kvantum | sed "s/KVANTUM_THEME/$kvantum-theme/g" > $HOME/.config/Kvantum/kvantum.kvconfig'
exec_always {
gsettings set org.gnome.desktop.interface gtk-theme $gtk-theme
gsettings set org.gnome.desktop.interface icon-theme $icon-theme
gsettings set org.gnome.desktop.interface cursor-theme $cursor-theme
gsettings set org.gnome.desktop.interface font-name $gui-font
}
# enable idle mode
exec $idle
# enable gtk3 theming
exec_always import-theme-settings.sh $theme \
gtk-theme:gtk-theme-name \
icon-theme:gtk-icon-theme-name \
cursor-theme:gtk-cursor-theme-name
# enable gnome-keyring daemon
exec systemctl --user import-environment && gnome-keyring-daemon --components=ssh\,secrets\,pkcs11 --start
......
......@@ -4,6 +4,10 @@
# some global theme specific variables
set $background /usr/share/wallpapers/manjaro-arm/generic/manjaro-arm.png
set $gtk-theme Matcha-dark-azul
set $icon-theme Papirus-Dark
set $cursor-theme xcursor-breeze
set $gui-font Noto Sans 11
set $kvantum-theme Matchama-Dark-Azul
# a theme specific color map
set $base00 #14161b
......
......@@ -4,6 +4,10 @@
# some global theme specific variables
set $background /usr/share/wallpapers/manjaro-arm/generic/manjaro-arm2.png
set $gtk-theme Matcha-dark-sea
set $icon-theme Papirus-Dark-Maia
set $cursor-theme xcursor-breeze
set $gui-font Noto Sans 11
set $kvantum-theme Matchama-Dark
# a theme specific color map
set $base00 #141a1b
......
include "$HOME/.gtkrc-2.0.mine"
gtk-theme-name="GTK_THEME"
gtk-icon-theme-name="ICON_THEME"
gtk-font-name="GUI_FONT"
gtk-cursor-theme-name="CURSOR_THEME"
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=1
gtk-menu-images=1
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintfull
gtk-theme-name="Matcha-dark-azul"
gtk-icon-theme-name="Papirus-Dark"
gtk-font-name="Noto Sans 11"
gtk-cursor-theme-name="xcursor-breeze"
[Settings]
gtk-theme-name=GTK_THEME
gtk-icon-theme-name=ICON_THEME
gtk-font-name=GUI_FONT
gtk-cursor-theme-name=CURSOR_THEME
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
......@@ -11,5 +12,5 @@ gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintfull"
gtk-xft-hintstyle=hintfull
gtk-theme-name="Matcha-dark-sea"
gtk-icon-theme-name="Papirus-Dark-Maia"
gtk-font-name="Noto Sans 11"
gtk-cursor-theme-name="xcursor-breeze"
[Settings]
gtk-theme-name=GTK_THEME
gtk-icon-theme-name=ICON_THEME
gtk-font-name=GUI_FONT
gtk-cursor-theme-name=CURSOR_THEME
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
......@@ -11,4 +12,5 @@ gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintfull"
gtk-xft-hintstyle=hintfull
[Appearance]
color_scheme_path=
custom_palette=false
icon_theme=Papirus-Dark-Maia
icon_theme=ICON_THEME
style=kvantum
[Fonts]
......
#!/bin/sh
# usage: import-gsettings <theme-dir> <gsettings key>:<settings.ini key> <gsettings key>:<settings.ini key> ...
prepare_gtk2_settings() {
local theme_file=$1
local settings_dir=$HOME
echo "include \"$HOME/.gtkrc-2.0.mine\"" > $settings_dir/.gtkrc-2.0
cat $1 >> $settings_dir/.gtkrc-2.0
}
prepare_gtk3_settings() {
local theme_file=$1
local settings_dir=$HOME/.config/gtk-3.0
mkdir -p $settings_dir
echo "[Settings]" > $settings_dir/settings.ini
cat $1 | sed 's/"//g' >> $settings_dir/settings.ini
}
prepare_gtk4_settings() {
local theme_file=$1
local settings_dir=$HOME/.config/gtk-4.0
mkdir -p $settings_dir
echo "[Settings]" > $settings_dir/settings.ini
cat $1 | sed 's/"//g' >> $settings_dir/settings.ini
}
prepare_kvantum_settings() {
local theme_file=$1
local settings_dir=$HOME/.config/Kvantum
mkdir -p $settings_dir
echo "[General]" > $settings_dir/kvantum.kvconfig
cat $1 >> $settings_dir/kvantum.kvconfig
}
update_gsettings() {
local theme_file=$1/gtk
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 $theme_file >/dev/null
}
if [ -d "$HOME/.config" ]; then
if [ -f "$1/gtk" ]; then
prepare_gtk2_settings $1/gtk
prepare_gtk3_settings $1/gtk
prepare_gtk4_settings $1/gtk
fi
if [ -f "$1/kvantum" ]; then
prepare_kvantum_settings $1/kvantum
fi
fi
update_gsettings $@
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment