{ lib, pkgs, ... }:
{
  home = {
    file = {
      "bin/xscreensaver-activate".source = ./xscreensaver-activate;
    };

    packages = [
      pkgs.dmenu
      pkgs.picom
    ];
  };

  programs.i3status = {
    enable = true;
    general = {
      interval = 1;
    };
  };

  services = {
    network-manager-applet.enable = true;
  };

  xsession = {
    enable = true;
    initExtra = ''
      # turn off bell and enable keyboard repeat
      xset b off
      xset r on
    '';
  };

  xsession.windowManager.i3 = {
    config = rec {
      defaultWorkspace = "workspace number 1";
      modifier = "Mod4";
      keybindings = lib.mkOptionDefault {
        "${modifier}+Scroll_Lock" = "exec --no-startup-id ${pkgs.xscreensaver}/bin/xscreensaver-command -lock";
        "${modifier}+Shift+e" = "exec ${pkgs.i3}/bin/i3-msg exit";
        "${modifier}+Shift+v" = ''mode "VNC"'';
      };
      startup = [
        {
          command = "~/bin/rotatebg";
          always = true;
          notification = false;
        }
        {
          command = "~/bin/xscreensaver-activate";
          always = true;
          notification = false;
        }
      ];
      terminal = "ghostty";
      window.border = 0;
      window.commands = [
        {
          command = "floating enable";
          criteria = {
            class = "Steam";
            title = "Friends List";
          };
        }
        {
          command = "border none";
          criteria = {
            all = true;
          };
        }
      ];
    };
    enable = true;
    extraConfig = ''
      # VNC mode (disable all local keybindings except the toggle keybinding)
      mode "VNC" {
      	bindsym $mod+Shift+v mode "default"
      }
    '';
  };
}
