diff --git a/provision/hosts/kestrel/configuration.nix b/provision/hosts/kestrel/configuration.nix index c57d2687..b8f032b4 100644 --- a/provision/hosts/kestrel/configuration.nix +++ b/provision/hosts/kestrel/configuration.nix @@ -79,7 +79,10 @@ modules = { desktop = { sway.enable = false; - gnome.enable = true; + gnome = { + enable = true; + wallpaper = "file://${../../../resources/img/wallpapers/gruvbox/kestrel.png}"; + }; browser.enable = true; }; devel = { diff --git a/provision/modules/desktop/gnome.nix b/provision/modules/desktop/gnome.nix index 53ce917b..9ddc391d 100644 --- a/provision/modules/desktop/gnome.nix +++ b/provision/modules/desktop/gnome.nix @@ -1,18 +1,28 @@ { config, lib, pkgs, user, home-manager, ... }: -let cfg = config.modules.desktop.gnome; +let + cfg = config.modules.desktop.gnome; + inherit (builtins) attrNames map; + inherit (lib.attrsets) mapAttrs' nameValuePair; + generate_custom_keybindings = binds: + { + "org/gnome/settings-daemon/plugins/media-keys" = { + custom-keybindings = map (name: + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/${name}/") + (attrNames binds); + }; + } // mapAttrs' (name: + nameValuePair + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/${name}") + binds; in { options.modules.desktop.gnome = with lib; { enable = lib.mkEnableOption "gnome"; - #privateKeyFile = lib.mkOption { type = with types; str; }; - #address = lib.mkOption { type = with types; listOf str; }; - #publicKey = lib.mkOption { type = with types; str; }; - #endpoint = lib.mkOption { type = with types; str; }; - #autostart = lib.mkOption { - # type = with types; bool; - # default = false; - #}; + wallpaper = lib.mkOption { + type = with types; str; + default = "file://${../../../resources/img/wallpapers/blank.png}"; + }; }; config = lib.mkIf cfg.enable { @@ -43,15 +53,15 @@ in { dconf.settings = { "org/gnome/desktop/background" = { picture-options = "centered"; - picture-uri = "file://${../../../resources/img/wallpapers/gruvbox/kestrel.png}"; - picture-uri-dark = "file://${../../../resources/img/wallpapers/gruvbox/kestrel.png}"; + picture-uri = "${cfg.wallpaper}"; + picture-uri-dark = "${cfg.wallpaper}"; }; "org/gnome/shell" = { favorite-apps = [ + "google-chrome.desktop" + "org.gnome.Console.desktop" "steam.desktop" "discord.desktop" - "org.gnome.Console.desktop" - "google-chrome.desktop" ]; disable-user-extensions = false; enabled-extensions = [ @@ -100,6 +110,9 @@ in { switch-windows-backward = ["Tab"]; #  minimize = []; }; + } // generate_custom_keybindings { + "terminal" = { binding = "Return"; command = "kgx"; name = "Open Terminal"; }; + "browser" = { binding = "b"; command = "google-chrome-stable"; name = "Open Browser"; }; }; }; }; diff --git a/resources/img/wallpapers/blank.png b/resources/img/wallpapers/blank.png new file mode 100644 index 00000000..be503381 Binary files /dev/null and b/resources/img/wallpapers/blank.png differ diff --git a/resources/img/wallpapers/gruvbox/bulwark.png b/resources/img/wallpapers/gruvbox/bulwark.png deleted file mode 100644 index 2ebc7c51..00000000 Binary files a/resources/img/wallpapers/gruvbox/bulwark.png and /dev/null differ