From 5ba38cdec87fe2cd9b98349ba8a47bf5e052ada9 Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Sun, 2 Jun 2024 14:35:06 +0200 Subject: [PATCH] configuring gnome doesnt work --- modules/graphical/default.nix | 1 + modules/graphical/gnome-settings.nix | 114 +++++++++++++++++++++++++++ modules/graphical/gnome.nix | 34 ++++---- modules/graphical/plasma.nix | 5 -- modules/graphical/shared.nix | 1 - systems/pc/configuration.nix | 1 + 6 files changed, 132 insertions(+), 24 deletions(-) create mode 100644 modules/graphical/gnome-settings.nix diff --git a/modules/graphical/default.nix b/modules/graphical/default.nix index 5ceddec..383dacd 100644 --- a/modules/graphical/default.nix +++ b/modules/graphical/default.nix @@ -8,6 +8,7 @@ ./gamemode.nix ./games.nix ./gnome.nix + ./gnome-settings.nix ./hyprland.nix ./ime.nix ./lxqt.nix diff --git a/modules/graphical/gnome-settings.nix b/modules/graphical/gnome-settings.nix new file mode 100644 index 0000000..3e13a2a --- /dev/null +++ b/modules/graphical/gnome-settings.nix @@ -0,0 +1,114 @@ +{ config, lib, ... }: +let cfg = config.custom.graphical.gnome; +in { + # doesnt work for me.. nothing changes + config = lib.mkIf cfg.enable { + programs.dconf.profiles.user.databases = [{ + lockAll = true; + settings = with lib.gvariant; { + "org/gnome/settings-daemon/plugins/media-keys" = { + custom-keybindings = [ + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/" + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/" + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/" + ]; + }; + "org/gnome/desktop/wm/preferences" = { + resize-with-right-button = true; + }; + "org/gnome/desktop/sound" = { event-sounds = false; }; + "org/gnome/desktop/peripherals/mouse" = { accel-profile = "flat"; }; + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = + { + name = "nautilus"; + command = "nautilus"; + binding = "e"; + }; + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = + { + name = "kitty super"; + command = "kitty"; + binding = "q"; + }; + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2" = + { + binding = "space"; + command = "rofi -show combi"; + name = "Open Rofi"; + }; + "org/gnome/shell" = { + disable-user-extensions = false; + enabled-extensions = [ + "blur-my-shell@aunetx" + "trayIconsReloaded@selfmade.pl" + "Vitals@CoreCoding.com" + "workspace-indicator@gnome-shell-extensions.gcampax.github.com" + "dash-to-dock@micxgx.gmail.com" + "just-perfection-desktop@just-perfection" + "user-theme@gnome-shell-extensions.gcampax.github.com" + "apps-menu@gnome-shell-extensions.gcampax.github.com" + ]; + }; + "org/gnome/mutter" = { + edge-tiling = true; + workspaces-only-on-primary = true; + dynamic-workspaces = false; + }; + #"org/gnome/desktop/wm/preferences" = { + # num-workspaces = 9; + # focus-mode = "sloppy"; + #}; + "org/gnome/desktop/wm/keybindings" = { + #minimize = [ "comma" ]; + maximize = [ "f" ]; + #switch-to-workspace-left = [ "e" ]; + #switch-to-workspace-right = [ "r" ]; + unmaximize = mkEmptyArray type.string; + activate-window-menu = mkEmptyArray type.string; + move-to-monitor-up = mkEmptyArray type.string; + move-to-monitor-down = mkEmptyArray type.string; + #move-to-monitor-left = [ "e" ]; + #move-to-monitor-right = [ "r" ]; + move-to-workspace-down = mkEmptyArray type.string; + move-to-workspace-up = mkEmptyArray type.string; + switch-to-workspace-down = + [ "Down" "j" ]; + switch-to-workspace-up = [ "Up" "k" ]; + toggle-maximized = [ "f" ]; + close = [ "F4" ]; + switch-to-workspace-1 = [ "1" ]; + switch-to-workspace-2 = [ "2" ]; + switch-to-workspace-3 = [ "3" ]; + switch-to-workspace-4 = [ "4" ]; + switch-to-workspace-5 = [ "5" ]; + switch-to-workspace-6 = [ "6" ]; + switch-to-workspace-7 = [ "7" ]; + switch-to-workspace-8 = [ "8" ]; + switch-to-workspace-9 = [ "9" ]; + move-to-workspace-1 = [ "1" ]; + move-to-workspace-2 = [ "2" ]; + move-to-workspace-3 = [ "3" ]; + move-to-workspace-4 = [ "4" ]; + move-to-workspace-5 = [ "5" ]; + move-to-workspace-6 = [ "6" ]; + move-to-workspace-7 = [ "7" ]; + move-to-workspace-8 = [ "8" ]; + move-to-workspace-9 = [ "9" ]; + }; + "org/gnome/shell/keybindings" = { + # Following binds need to be disabled, as their defaults are used for + # the binds above, and will run into conflicts. + switch-to-application-1 = mkEmptyArray type.string; + switch-to-application-2 = mkEmptyArray type.string; + switch-to-application-3 = mkEmptyArray type.string; + switch-to-application-4 = mkEmptyArray type.string; + switch-to-application-5 = mkEmptyArray type.string; + switch-to-application-6 = mkEmptyArray type.string; + switch-to-application-7 = mkEmptyArray type.string; + switch-to-application-8 = mkEmptyArray type.string; + switch-to-application-9 = mkEmptyArray type.string; + }; + }; + }]; + }; +} diff --git a/modules/graphical/gnome.nix b/modules/graphical/gnome.nix index f6cdb49..ca49677 100644 --- a/modules/graphical/gnome.nix +++ b/modules/graphical/gnome.nix @@ -1,13 +1,9 @@ -{lib, config, pkgs, ... }: +{ lib, config, pkgs, ... }: with lib; -let - cfg = config.custom.graphical.gnome; -in -{ - options.custom.graphical.gnome = { - enable = mkEnableOption "Enables gnome"; - }; - +let cfg = config.custom.graphical.gnome; +in { + options.custom.graphical.gnome = { enable = mkEnableOption "Enables gnome"; }; + config = mkIf cfg.enable { services.xserver = { xkb.layout = config.mainUser.layout; @@ -16,17 +12,18 @@ in displayManager.gdm.enable = true; desktopManager.gnome.enable = true; }; - + # Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229 systemd.services."getty@tty1".enable = false; systemd.services."autovt@tty1".enable = false; services.gnome.gnome-keyring.enable = true; - + + boot.kernelParams = [ "nvidia_drm.fbdev=1" ]; environment.sessionVariables.NIXOS_OZONE_WL = "1"; - + environment.gnome.excludePackages = (with pkgs; [ - gnome-photos - gnome-tour + gnome-photos + gnome-tour gedit # text editor ]) ++ (with pkgs.gnome; [ cheese # webcam tool @@ -42,15 +39,16 @@ in hitori # sudoku game atomix # puzzle game ]); - + environment.systemPackages = with pkgs; [ wmctrl + rofi-wayland gnome.mutter gnome.adwaita-icon-theme gnome.gnome-settings-daemon gnome.gnome-tweaks gnome.dconf-editor - gruvbox-gtk-theme + #gruvbox-gtk-theme colloid-icon-theme gnomeExtensions.appindicator gnomeExtensions.just-perfection @@ -61,10 +59,10 @@ in gnomeExtensions.rounded-window-corners gnomeExtensions.wallpaper-switcher gnomeExtensions.backslide - gnomeExtensions.nextcloud-folder gnomeExtensions.tray-icons-reloaded gnomeExtensions.blur-my-shell + gnomeExtensions.material-shell + gnomeExtensions.paperwm ]; }; } - diff --git a/modules/graphical/plasma.nix b/modules/graphical/plasma.nix index 3b00fef..96effdd 100644 --- a/modules/graphical/plasma.nix +++ b/modules/graphical/plasma.nix @@ -11,11 +11,6 @@ in { enable = true; xkb.layout = config.mainUser.layout; xkb.variant = config.mainUser.variant; - windowManager.i3 = { - package = pkgs.i3-gaps; - enable = true; - configFile = ../../.config/i3/kde-config; - }; displayManager = { sddm.enable = true; }; diff --git a/modules/graphical/shared.nix b/modules/graphical/shared.nix index 7a6c829..06a7155 100644 --- a/modules/graphical/shared.nix +++ b/modules/graphical/shared.nix @@ -48,7 +48,6 @@ in xfce.thunar remmina thunderbird - rofi localsend #element-desktop krita diff --git a/systems/pc/configuration.nix b/systems/pc/configuration.nix index 4923a58..da7060e 100644 --- a/systems/pc/configuration.nix +++ b/systems/pc/configuration.nix @@ -67,6 +67,7 @@ obs.enable = true; openrgb.enable = true; plasma.enable = true; + #gnome.enable = true; #cosmic.enable = true; shared.enable = true; stylix.enable = true;