about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--modules/gnome.nix9
-rwxr-xr-xmodules/switch-theme.sh11
2 files changed, 20 insertions, 0 deletions
diff --git a/modules/gnome.nix b/modules/gnome.nix
index 6d8bb29..219b623 100644
--- a/modules/gnome.nix
+++ b/modules/gnome.nix
@@ -1,4 +1,7 @@
 { pkgs, ... }:
+let
+	switch-theme = pkgs.writeShellScriptBin "switch-theme" (builtins.readFile ./switch-theme.sh);
+in
 {
 # Enable the X11 windowing system.
 	services.xserver.enable = true;
@@ -43,7 +46,12 @@
               					binding = "<Super>Return";
               					command = "kgx";
               					name = "GNOME Console";
+            				};
 
+					"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = {
+              					binding = "<TaskPane>";
+              					command = "switch-theme";
+              					name = "Switch Theme";
             				};
 
 				};
@@ -83,6 +91,7 @@
 	boot.plymouth.enable = true;
 
 	environment.systemPackages = with pkgs; [
+		switch-theme
 		libnotify
 		gnome.gnome-boxes
 		gnome.file-roller
diff --git a/modules/switch-theme.sh b/modules/switch-theme.sh
new file mode 100755
index 0000000..b3fce3b
--- /dev/null
+++ b/modules/switch-theme.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+theme=$(gsettings get org.gnome.desktop.interface color-scheme)
+
+echo $theme
+if [ "$theme" = "'prefer-dark'" ]; then
+	gsettings set org.gnome.desktop.interface color-scheme 'prefer-light'
+else
+	gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
+fi
+