move theme settings to global vars
This commit is contained in:
		
							parent
							
								
									e07ec45d45
								
							
						
					
					
						commit
						32d2e07e84
					
				
					 5 changed files with 15 additions and 40 deletions
				
			
		| 
						 | 
					@ -15,23 +15,4 @@
 | 
				
			||||||
      systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
 | 
					      systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
 | 
				
			||||||
    '';
 | 
					    '';
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
  # currently, there is some friction between sway and gtk:
 | 
					 | 
				
			||||||
  # https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
 | 
					 | 
				
			||||||
  # the suggested way to set gtk settings is with gsettings
 | 
					 | 
				
			||||||
  # for gsettings to work, we need to tell it where the schemas are
 | 
					 | 
				
			||||||
  # using the XDG_DATA_DIR environment variable
 | 
					 | 
				
			||||||
  # run at the end of sway config
 | 
					 | 
				
			||||||
  configure-gtk = pkgs.writeTextFile {
 | 
					 | 
				
			||||||
    name = "configure-gtk";
 | 
					 | 
				
			||||||
    destination = "/bin/configure-gtk";
 | 
					 | 
				
			||||||
    executable = true;
 | 
					 | 
				
			||||||
    text = let
 | 
					 | 
				
			||||||
      schema = pkgs.gsettings-desktop-schemas;
 | 
					 | 
				
			||||||
      datadir = "${schema}/share/gsettings-schemas/${schema.name}";
 | 
					 | 
				
			||||||
    in ''
 | 
					 | 
				
			||||||
      export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS
 | 
					 | 
				
			||||||
      gnome_schema=org.gnome.desktop.interface
 | 
					 | 
				
			||||||
      # gsettings set $gnome_schema gtk-theme 'Dracula'
 | 
					 | 
				
			||||||
    '';
 | 
					 | 
				
			||||||
  };
 | 
					 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,14 +9,13 @@
 | 
				
			||||||
    enable = true;
 | 
					    enable = true;
 | 
				
			||||||
    wlr.enable = true;
 | 
					    wlr.enable = true;
 | 
				
			||||||
    # gtk portal needed to make gtk apps happy
 | 
					    # gtk portal needed to make gtk apps happy
 | 
				
			||||||
    # extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
 | 
					    extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
 | 
				
			||||||
    # gtkUsePortal = false;
 | 
					    gtkUsePortal = true;
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
  services.greetd = let
 | 
					  services.greetd = let
 | 
				
			||||||
    greetd_main_script = pkgs.writeShellScriptBin "main" ''
 | 
					    greetd_main_script = pkgs.writeShellScriptBin "main" ''
 | 
				
			||||||
      ${pkgs.dbus-sway-environment}/bin/dbus-sway-environment
 | 
					      ${pkgs.dbus-sway-environment}/bin/dbus-sway-environment
 | 
				
			||||||
      ${pkgs.configure-gtk}/bin/configure-gtk
 | 
					      export XDG_CURRENT_DESKTOP=sway GTK_THEME="${pkgs.uservars.gtk_theme}" XCURSOR_THEME="${pkgs.uservars.cursor_theme}"
 | 
				
			||||||
      export XDG_CURRENT_DESKTOP=sway GTK_THEME=Orchis-Red-Dark-Compact
 | 
					 | 
				
			||||||
      ${pkgs.greetd.gtkgreet}/bin/gtkgreet -l -c sway
 | 
					      ${pkgs.greetd.gtkgreet}/bin/gtkgreet -l -c sway
 | 
				
			||||||
      swaymsg exit
 | 
					      swaymsg exit
 | 
				
			||||||
    '';
 | 
					    '';
 | 
				
			||||||
| 
						 | 
					@ -56,5 +55,10 @@
 | 
				
			||||||
    wayland
 | 
					    wayland
 | 
				
			||||||
    pkgs.xdg-desktop-portal
 | 
					    pkgs.xdg-desktop-portal
 | 
				
			||||||
    pkgs.xdg-desktop-portal-wlr
 | 
					    pkgs.xdg-desktop-portal-wlr
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ## Theme
 | 
				
			||||||
 | 
					    capitaine-cursors
 | 
				
			||||||
 | 
					    orchis_theme_compact
 | 
				
			||||||
 | 
					    papirus_red
 | 
				
			||||||
  ];
 | 
					  ];
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,16 +24,6 @@ let
 | 
				
			||||||
        systemctl --user start swayidle.service
 | 
					        systemctl --user start swayidle.service
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
  '';
 | 
					  '';
 | 
				
			||||||
  dbus-sway-environment = pkgs.writeTextFile {
 | 
					 | 
				
			||||||
    name = "dbus-sway-environment";
 | 
					 | 
				
			||||||
    destination = "/bin/dbus-sway-environment";
 | 
					 | 
				
			||||||
    executable = true;
 | 
					 | 
				
			||||||
    text = ''
 | 
					 | 
				
			||||||
      dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
 | 
					 | 
				
			||||||
      systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
 | 
					 | 
				
			||||||
      systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
 | 
					 | 
				
			||||||
    '';
 | 
					 | 
				
			||||||
  };
 | 
					 | 
				
			||||||
in {
 | 
					in {
 | 
				
			||||||
  config = {
 | 
					  config = {
 | 
				
			||||||
    wayland.windowManager.sway = let
 | 
					    wayland.windowManager.sway = let
 | 
				
			||||||
| 
						 | 
					@ -297,7 +287,7 @@ in {
 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
      extraConfig = ''
 | 
					      extraConfig = ''
 | 
				
			||||||
        for_window [title=.*] inhibit_idle fullscreen
 | 
					        for_window [title=.*] inhibit_idle fullscreen
 | 
				
			||||||
        exec ${dbus-sway-environment}/bin/dbus-sway-environment
 | 
					        exec ${pkgs.dbus-sway-environment}/bin/dbus-sway-environment
 | 
				
			||||||
      '';
 | 
					      '';
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    services.swayidle = {
 | 
					    services.swayidle = {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,9 +1,5 @@
 | 
				
			||||||
{ config, pkgs, lib, inputs, ... }: let
 | 
					{ config, pkgs, lib, inputs, ... }:
 | 
				
			||||||
  font = pkgs.uservars.font;
 | 
					with pkgs.uservars; {
 | 
				
			||||||
  gtk_theme = "Orchis-Red-Dark-Compact";
 | 
					 | 
				
			||||||
  icon_theme = "Papirus-Dark";
 | 
					 | 
				
			||||||
  cursor_theme = "capitaine-cursors";
 | 
					 | 
				
			||||||
in {
 | 
					 | 
				
			||||||
  home.pointerCursor = {
 | 
					  home.pointerCursor = {
 | 
				
			||||||
    name = cursor_theme;
 | 
					    name = cursor_theme;
 | 
				
			||||||
    size = 32;
 | 
					    size = 32;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -57,6 +57,10 @@ in rec {
 | 
				
			||||||
  color = theme.color;
 | 
					  color = theme.color;
 | 
				
			||||||
  accent = accents.red;
 | 
					  accent = accents.red;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  gtk_theme = "Orchis-Red-Dark-Compact";
 | 
				
			||||||
 | 
					  icon_theme = "Papirus-Dark";
 | 
				
			||||||
 | 
					  cursor_theme = "capitaine-cursors";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  font = {
 | 
					  font = {
 | 
				
			||||||
    mono = "Hack Nerd Font";
 | 
					    mono = "Hack Nerd Font";
 | 
				
			||||||
    interface = "Liberation Sans";
 | 
					    interface = "Liberation Sans";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue