{ lib, config, pkgs, modulesPath, inputs, ... }:

let
  cfg = config.cspark-desktop-exwm-config-1;
in
{
#  imports =
#    [
#      inputs.niri.homeModules.niri
#    ];
  
  options.cspark-desktop-exwm-config-1 = {
    enable 
      = lib.mkEnableOption "Enable Custom EXWM Desktop Setup 1";
  };

  config = lib.mkIf cfg.enable {
    services.gpg-agent = {
      pinentryPackage = pkgs.pinentry-qt;
    };

    # Config Files (typically $HOME/.config)
    xdg.configFile = {
      "vesktop/themes".source = ./resources/home-manager/.config/vesktop/themes;
      "networkmanager-dmenu/config.ini".source = ./resources/home-manager/.config/networkmanager-dmenu/config.ini;
    };

    services.udiskie.enable = true;
    services.udiskie.tray = "never";

    # Automatically executed on exwm startup
    home.packages = with pkgs; [
      gcr

      (writeShellScriptBin "exwm-autostart"
        ''
		kdeconnect-indicator &
        '')
	];

    home.sessionVariables = {
      QT_QPA_PLATFORMTHEME = "qt6ct";
      SDL_VIDEODRIVER = "x11,windows";
      _JAVA_AWT_WM_NONREPARENTING = "1";
      SSH_ASKPASS_REQUIRE = "force";
      SSH_ASKPASS = "/run/current-system/sw/bin/lxqt-openssh-askpass";
    };
  #programs.bash = {
  #  initExtra = ''
  #    export DISPLAY=":0"
  #  '';
  #};

    # Start sway after login if on TTY1 (Default Linux TTY upon boot/login)
    #programs.bash.profileExtra = ''
    #                 if [[ $(tty) == "/dev/tty1" ]]; then
    #                                   niri-session
		#		                               exit
    #                 fi
    #                 '';
  };
}
