Gnome : Load dconf settings from systemd.

This commit is contained in:
Dmitry Voronin 2024-02-20 16:06:53 +03:00
parent 0675a62b93
commit ecf17c6b52
3 changed files with 16 additions and 12 deletions

View file

@ -1,8 +0,0 @@
[Desktop Entry]
Name=DconfLoad
GenericName=Load Gnome settings
Comment=Load Gnome settings
Exec=bash -c "export path_dconf=${HOME}/.config/linux/Gnome.dconf ; sed -i -e s/voronind/$(whoami)/g ${path_dconf} ; dconf load / < ${path_dconf} ; git checkout ${path_dconf}"
Terminal=false
Type=Application
X-GNOME-Autostart-enabled=true

View file

@ -139,7 +139,7 @@ unmaximize=@as []
action-middle-click-titlebar='minimize' action-middle-click-titlebar='minimize'
action-right-click-titlebar='menu' action-right-click-titlebar='menu'
button-layout='appmenu:close' button-layout='appmenu:close'
focus-mode='click' focus-mode='sloppy'
titlebar-font='SF Pro Display 11' titlebar-font='SF Pro Display 11'
[org/gnome/desktop/session] [org/gnome/desktop/session]

View file

@ -1,6 +1,6 @@
{ pkgs, ... }: { pkgs, ... }: let
dconfConfig = "~/.config/linux/Gnome.dconf";
{ in {
# GUI. # GUI.
services.xserver.enable = true; services.xserver.enable = true;
services.xserver.displayManager.gdm.enable = true; services.xserver.displayManager.gdm.enable = true;
@ -51,4 +51,16 @@
alsa.support32Bit = true; alsa.support32Bit = true;
pulse.enable = true; pulse.enable = true;
}; };
# Auto-load config on start.
systemd.user.services.dconfload = {
description = "Load Gnome dconf settings in startup.";
wantedBy = [ "graphical-session-pre.target" ];
serviceConfig.Type = "oneshot";
script = ''
sed -i -e "s/voronind/$(whoami)/g" ${dconfConfig}
${pkgs.dconf}/bin/dconf load / < ${dconfConfig}
${pkgs.git}/bin/git checkout ${dconfConfig}
'';
};
} }