{
  config,
  pkgs-unstable,
  pkgs,
  ...
}:
{
  # We run most extensions from unstable because they are more up-to-date
  home.packages =
    with pkgs.gnomeExtensions;
    [
      user-themes
      weather-oclock
      native-window-placement
      kimpanel
    ]
    ++ (with pkgs-unstable.gnomeExtensions; [
      dash-to-panel
      fedora-linux-update-indicator
      arcmenu
      lilypad
      tailscale-qs
      blur-my-shell
      gtk4-desktop-icons-ng-ding
      media-controls
      burn-my-windows
      coverflow-alt-tab
      appindicator
      autohide-battery
      battery-health-charging
      just-perfection
      smile-complementary-extension
      clipboard-indicator
      bubblemail
    ]);

  # Copy burn-my-windows profile to user config
  home.file.".config/burn-my-windows/profiles/default.conf".text = ''
    [burn-my-windows-profile]
    fire-enable-effect=false
    tv-glitch-enable-effect=true
    tv-glitch-animation-time=250
  '';

  dconf = {
    settings = {
      # dash-to-panel
      "org/gnome/shell/extensions/dash-to-panel" = {
        appicon-padding = 8;
        appicon-margin = 4;
        trans-panel-opacity = 0.40;
        appicon-style = "SYMBOLIC";
        trans-use-custom-opacity = true;
        animate-appicon-hover = false;
        dot-style-unfocused = "DOTS";
        tray-size = 16;
        hoy-keys = true;
        panel-element-positions = "{\"0\":[{\"element\":\"showAppsButton\",\"visible\":false,\"position\":\"stackedTL\"},{\"element\":\"activitiesButton\",\"visible\":false,\"position\":\"stackedTL\"},{\"element\":\"leftBox\",\"visible\":true,\"position\":\"stackedTL\"},{\"element\":\"taskbar\",\"visible\":true,\"position\":\"stackedTL\"},{\"element\":\"centerBox\",\"visible\":true,\"position\":\"stackedBR\"},{\"element\":\"rightBox\",\"visible\":true,\"position\":\"stackedBR\"},{\"element\":\"dateMenu\",\"visible\":true,\"position\":\"stackedBR\"},{\"element\":\"systemMenu\",\"visible\":true,\"position\":\"stackedBR\"},{\"element\":\"desktopButton\",\"visible\":true,\"position\":\"stackedBR\"}],\"1\":[{\"element\":\"showAppsButton\",\"visible\":false,\"position\":\"stackedTL\"},{\"element\":\"activitiesButton\",\"visible\":false,\"position\":\"stackedTL\"},{\"element\":\"leftBox\",\"visible\":true,\"position\":\"stackedTL\"},{\"element\":\"taskbar\",\"visible\":true,\"position\":\"stackedTL\"},{\"element\":\"centerBox\",\"visible\":true,\"position\":\"stackedBR\"},{\"element\":\"rightBox\",\"visible\":true,\"position\":\"stackedBR\"},{\"element\":\"dateMenu\",\"visible\":true,\"position\":\"stackedBR\"},{\"element\":\"systemMenu\",\"visible\":true,\"position\":\"stackedBR\"},{\"element\":\"desktopButton\",\"visible\":true,\"position\":\"stackedBR\"}]}";
      };

      # arcmenu
      "org/gnome/shell/extensions/arcmenu" = {
        custom-menu-button-icon-size = 32;
        menu-layout = "Runner";
        runner-show-frequent-apps = true;
        search-provider-open-windows = true;
        search-provider-recent-files = true;
        highlight-search-terms = true;
        max-search-results = 8;
        menu-button-icon = "Distro_Icon";
        distro-icon = 2;
        arc-menu-icon = 64;
      };

      "org/gnome/shell/extensions/pano" = {
        history-length = 500;
        global-shortcut = [ "<Shift><Alt>V" ];
        item-date-font-family = "Hack Nerd Font Mono";
        item-date-font-size = 10;
        search-bar-font-family = "Hack Nerd Font Mono";
        search-bar-font-size = 14;
        item-title-font-family = "Hack Nerd Font Mono";
        item-title-font-size = 20;
      };

      # To get an ID of an extension, run `gnome-extensions list`
      "org/gnome/shell" = {
        disable-user-extensions = false;
        # To get an array like below of currently enabled extensionsm run `gnome-extensions list --enabled | sed 's/.*/"&"/'`
        enabled-extensions = [
          "bubblemail@razer.framagit.org"
          "pano@elhan.io"
          "tilingshell@ferrarodomenico.com"
          "background-logo@fedorahosted.org"
          "launch-new-instance@gnome-shell-extensions.gcampax.github.com"
          "appindicatorsupport@rgcjonas.gmail.com"
          "Battery-Health-Charging@maniacx.github.com"
          "autohide-battery@sitnik.ru"
          "blur-my-shell@aunetx"
          "burn-my-windows@schneegans.github.com"
          "gsconnect@andyholmes.github.io"
          "gtk4-ding@smedius.gitlab.com"
          "just-perfection-desktop@just-perfection"
          "kimpanel@kde.org"
          "lilypad@shendrew.github.io"
          "native-window-placement@gnome-shell-extensions.gcampax.github.com"
          "smile-extension@mijorus.it"
          "tailscale@joaophi.github.com"
          "user-theme@gnome-shell-extensions.gcampax.github.com"
          "weatheroclock@CleoMenezesJr.github.io"
          "dash-to-panel@jderose9.github.com"
          "arcmenu@arcmenu.com"
          "update-extension@purejava.org"
        ];
      };

      # Perfection settings
      "org/gnome/shell/extensions/just-perfection" = {
        theme = false;
        notification-banner-position = 2;
        startup-status = 0;
      };

      # Autohide battery
      "org/gnome/shell/extensions/autohide-battery" = {
        hide-on = 95;
      };

      # Configure logo-menu
      "org/gnome/shell/extensions/Logo-menu" = {
        hide-icon-shadow = false;
        menu-button-extensions-app = "org.gnome.Extensions.desktop";
        menu-button-icon-image = 23;
        menu-button-icon-size = 24;
        menu-button-system-monitor = "missioncenter";
        show-power-options = false;
        symbolic-icon = true;
        use-custom-icon = false;
      };

      # Configure covereflow-alt-tab
      "org/gnome/shell/extensions/coverflowalttab" = {
        animation-time = 0.2;
        easing-function = "ease-out-quart";
        icon-has-shadow = true;
        icon-style = "Overlay";
        invert-swipes = false;
        position = "Top";
        switcher-looping-method = "Flip Stack";
        switcher-style = "Coverflow";
      };

      # Configure burn-my-windows
      "org/gnome/shell/extensions/burn-my-windows" = {
        active-profile = "${config.home.homeDirectory}/.config/burn-my-windows/profiles/default.conf";
      };

      # Configure blur-my-shell
      "org/gnome/shell/extensions/blur-my-shell" = {
        brightness = 0.75;
        noise-amount = 0;
      };

      # Configure tiling shell
      "org/gnome/shell/extensions/tilingshell" = {
        enable-autotiling = false;
        restore-window-original-size = false;
        enable-tiling-system-windows-suggestions = true;
        layouts-json = ''
          [
            {
              "id": "Landscape Ultrawide",
              "tiles": [
                { "x": 0, "y": 0, "width": 0.22, "height": 0.5, "groups": [1, 2] },
                { "x": 0, "y": 0.5, "width": 0.22, "height": 0.5, "groups": [1, 2] },
                { "x": 0.22, "y": 0, "width": 0.56, "height": 1, "groups": [2, 3] },
                { "x": 0.78, "y": 0, "width": 0.22, "height": 0.5, "groups": [3, 4] },
                { "x": 0.78, "y": 0.5, "width": 0.22, "height": 0.5, "groups": [3, 4] }
              ]
            },
            {
              "id": "Portrait Ultrawide",
              "tiles": [
                { "x": 0, "y": 0, "width": 1, "height": 0.25, "groups": [1] },
                { "x": 0, "y": 0.25, "width": 1, "height": 0.5, "groups": [1, 2] },
                { "x": 0, "y": 0.75, "width": 0.5, "height": 0.25, "groups": [2, 3] },
                { "x": 0.5, "y": 0.75, "width": 0.5, "height": 0.25, "groups": [2, 3] }
              ]
            },
            {
              "id": "Landscape Laptop",
              "tiles": [
                { "x": 0, "y": 0, "width": 0.5, "height": 0.5, "groups": [1, 2] },
                {
                  "x": 0.5,
                  "y": 0,
                  "width": 0.5,
                  "height": 1,
                  "groups": [1]
                },
                {
                  "x": 0,
                  "y": 0.5,
                  "width": 0.5,
                  "height": 0.5,
                  "groups": [2, 1]
                }
              ]
            },
            {
              "id": "Landscape Ultrawide Power-User",
              "tiles": [
                {
                  "x": 0,
                  "y": 0,
                  "width": 0.1984375,
                  "height": 0.5028409090909091,
                  "groups": [1, 2]
                },
                {
                  "x": 0.1984375,
                  "y": 0,
                  "width": 0.3015625,
                  "height": 1,
                  "groups": [4, 1]
                },
                {
                  "x": 0,
                  "y": 0.5028409090909091,
                  "width": 0.1984375,
                  "height": 0.49715909090909094,
                  "groups": [2, 1]
                },
                {
                  "x": 0.8015625,
                  "y": 0,
                  "width": 0.1984375,
                  "height": 1,
                  "groups": [3]
                },
                {
                  "x": 0.5,
                  "y": 0,
                  "width": 0.30156249999999996,
                  "height": 1,
                  "groups": [3, 4]
                }
              ]
            }
          ]
        '';
        overridden-settings = "{\"org.gnome.mutter.keybindings\":{\"toggle-tiled-right\":\"['<Super>Right']\",\"toggle-tiled-left\":\"['<Super>Left']\"},\"org.gnome.desktop.wm.keybindings\":{\"maximize\":\"['<Super>Up']\",\"unmaximize\":\"['<Super>Down', '<Alt>F5']\"},\"org.gnome.mutter\":{\"edge-tiling\":\"false\"}}";
      };

      # Configure forge
      "org/gnome/shell/extensions/forge" = {
        move-pointer-focus-enabled = false;
        stacked-tiling-mode-enabled = true;
        tabbed-tiling-mode-enabled = true;
        tiling-mode-enabled = true;
      };

      "org/gnome/shell/extensions/forge/keybindings" = {
        con-split-horizontal = [ "<Super>z" ];
        con-split-layout-toggle = [ "<Super>g" ];
        con-split-vertical = [ "<Super>v" ];
        con-stacked-layout-toggle = [ "<Shift><Super>s" ];
        con-tabbed-layout-toggle = [ "<Shift><Super>t" ];
        con-tabbed-showtab-decoration-toggle = [ "<Control><Alt>y" ];
        focus-border-toggle = [ "<Super>x" ];
        prefs-tiling-toggle = [ "<Super>w" ];
        window-focus-down = [ "<Super>j" ];
        window-focus-left = [ "<Super>h" ];
        window-focus-right = [ "<Super>l" ];
        window-focus-up = [ "<Super>k" ];
        window-gap-size-decrease = [ "<Control><Super>minus" ];
        window-gap-size-increase = [ "<Control><Super>plus" ];
        window-move-down = [ "<Shift><Super>j" ];
        window-move-left = [ "<Shift><Super>h" ];
        window-move-right = [ "<Shift><Super>l" ];
        window-move-up = [ "<Shift><Super>k" ];
        window-resize-bottom-decrease = [ "<Shift><Control><Super>i" ];
        window-resize-bottom-increase = [ "<Control><Super>u" ];
        window-resize-left-decrease = [ "<Shift><Control><Super>o" ];
        window-resize-left-increase = [ "<Control><Super>y" ];
        window-resize-right-decrease = [ "<Shift><Control><Super>y" ];
        window-resize-right-increase = [ "<Control><Super>o" ];
        window-resize-top-decrease = [ "<Shift><Control><Super>u" ];
        window-resize-top-increase = [ "<Control><Super>i" ];
        window-snap-center = [ "<Control><Alt>c" ];
        window-snap-one-third-left = [ "<Control><Alt>d" ];
        window-snap-one-third-right = [ "<Control><Alt>g" ];
        window-snap-two-third-left = [ "<Control><Alt>e" ];
        window-snap-two-third-right = [ ];
        window-swap-down = [ "<Control><Super>j" ];
        window-swap-last-active = [ "<Super>Return" ];
        window-swap-left = [ "<Control><Super>h" ];
        window-swap-right = [ "<Control><Super>l" ];
        window-swap-up = [ "<Control><Super>k" ];
        window-toggle-always-float = [ "<Shift><Super>c" ];
        window-toggle-float = [ "<Super>c" ];
        workspace-active-tile-toggle = [ "<Shift><Super>w" ];
      };

      # User theme
      "org/gnome/shell/extensions/user-theme" = {
        name = "Yaru-purple-dark";
      };

      # Lilypad settings
      "org/gnome/shell/extensions/lilypad/rightbox-order" = {

        # In case this is updated, run: `dconf read /org/gnome/shell/extensions/lilypad/rightbox-order  | tsed "s/,//g; s/'/\"/g ` then copy pasting the output here
        rightbox-order = [
          "lilypad"
          "system_monitor"
          "appindicator_legacy_TelegramDesktop"
          "appindicator_legacy_1password"
          "spotify_client"
          "appindicator_legacy_Electron"
          "steam"
          "appindicator_legacy_steam"
          "workspace_indicator"
          "StatusNotifierItem"
          "clipboardIndicator"
          "screenSharing"
        ];
        show-icons = false;
      };
    };
  };
}
