trim some options and make tiling optional in de2

This commit is contained in:
notgne2 2022-01-29 19:40:54 -07:00
parent 487a076825
commit e1bcc9e797
No known key found for this signature in database
GPG Key ID: BB661E172B42A7F8
2 changed files with 51 additions and 58 deletions

View File

@ -6,6 +6,12 @@ in
{
options.de2u = {
enable = mkEnableOption "Enable de2 user stuff";
tiling = mkOption {
type = types.bool;
default = true;
description = "Enable tiling stuff";
};
};
config = mkIf cfg.enable {
@ -51,7 +57,7 @@ in
systemd.user.sessionVariables = {
QT_QPA_PLATFORM = "wayland-egl;xcb";
MOZ_ENABLE_WAYLAND = "1";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
QT_WAYLAND_DISABLE_WINDOWDECORATION = lib.mkIf cfg.tiling "1";
};
xdg.mimeApps = {
@ -73,12 +79,12 @@ in
dconf.settings = with lib.hm.gvariant; {
"org/gnome/desktop/interface" = {
enable-hot-corners = false;
enable-hot-corners = !cfg.tiling;
show-battery-percentage = true;
};
"org/gnome/shell/extensions/pop-shell" = {
tile-by-default = true;
show-title = false;
tile-by-default = cfg.tiling;
show-title = !cfg.tiling;
active-hint = false;
};
"org/gnome/shell/extensions/improved-workspace-indicator" = {
@ -87,7 +93,7 @@ in
"org/gnome/shell/extensions/vitals" = {
hide-zeros = true;
show-battery = true;
update-time = 8;
update-time = 10;
};
"org/gnome/shell/extensions/appindicator" = {
icon-opacity = 255;
@ -97,26 +103,17 @@ in
name = if config.colors.enable then "Generated" else "Default";
};
"org/gnome/shell/extensions/just-perfection" = {
activities-button = false;
activities-button = !cfg.tiling;
startup-status = 0;
workspace-popup = false;
window-picker-icon = false;
animation = 3;
app-menu = true;
app-menu-icon = true;
background-menu = true;
dash = false;
double-super-to-appgrid = true;
gesture = true;
hot-corner = false;
show-apps-button = false;
startup-status = 0;
window-picker-icon = false;
window-preview-caption = true;
workspace = true;
workspace-popup = false;
workspace-switcher-should-show = false;
workspaces-in-app-grid = true;
};
"org/gnome/shell" = {
disable-user-extensions = false;
disabled-extensions = [ "" ];
enabled-extensions = [
"pop-shell@system76.com"
"rrc@ogarcia.me"
@ -127,20 +124,21 @@ in
"clipboard-indicator@tudmotu.com"
"just-perfection-desktop@just-perfection"
"appindicatorsupport@rgcjonas.gmail.com"
"launch-new-instance@gnome-shell-extensions.gcampax.github.com"
];
};
"org/gnome/desktop/peripherals/touchpad" = {
natural-scroll = false;
};
"org/gnome/mutter" = {
edge-tiling = false;
dynamic-workspaces = false;
edge-tiling = !cfg.tiling;
dynamic-workspaces = !cfg.tiling;
};
"org/gnome/shell/extensions/blur-me" = {
toggle-app-blur = false;
};
"org/gnome/desktop/wm/preferences" = {
focus-mode = "sloppy";
focus-mode = if cfg.tiling then "sloppy" else "click";
resize-with-right-button = true;
num-workspaces = 9;
};
@ -152,43 +150,33 @@ in
enabled = true;
};
"org/gnome/desktop/wm/keybindings" = {
move-to-workspace-1 = [ "<Shift><Super>exclam" ];
move-to-workspace-2 = [ "<Shift><Super>at" ];
move-to-workspace-3 = [ "<Shift><Super>numbersign" ];
move-to-workspace-4 = [ "<Shift><Super>dollar" ];
move-to-workspace-5 = [ "<Shift><Super>percent" ];
move-to-workspace-6 = [ "<Shift><Super>asciicircum" ];
move-to-workspace-7 = [ "<Shift><Super>ampersand" ];
move-to-workspace-8 = [ "<Shift><Super>asterisk" ];
move-to-workspace-9 = [ "<Shift><Super>parenleft" ];
switch-to-workspace-1 = [ "<Super>1" ];
switch-to-workspace-2 = [ "<Super>2" ];
switch-to-workspace-3 = [ "<Super>3" ];
switch-to-workspace-4 = [ "<Super>4" ];
switch-to-workspace-5 = [ "<Super>5" ];
switch-to-workspace-6 = [ "<Super>6" ];
switch-to-workspace-7 = [ "<Super>7" ];
switch-to-workspace-8 = [ "<Super>8" ];
switch-to-workspace-9 = [ "<Super>9" ];
"org/gnome/desktop/wm/keybindings" =
let
workspaceAttrsList = lib.flatten (map
(n: [
(lib.nameValuePair "move-to-workspace-${n}" [ "<Shift><Super>${n}" ])
(lib.nameValuePair "switch-to-workspace-${n}" [ "<Super>${n}" ])
])
(map (n: toString n) (lib.range 0 9)));
in
lib.listToAttrs workspaceAttrsList // {
minimize = [ "<Super>comma" ];
switch-to-workspace-left = [ "" ];
switch-to-workspace-right = [ "" ];
maximize = [ "" ];
unmaximize = [ "" ];
move-to-monitor-up = [ "" ];
move-to-monitor-down = [ "" ];
move-to-monitor-left = [ "" ];
move-to-monitor-right = [ "" ];
move-to-workspace-down = [ "" ];
move-to-workspace-up = [ "" ];
switch-to-workspace-down = [ "<Primary><Super>Down" "<Primary><Super>j" ];
switch-to-workspace-up = [ "<Primary><Super>Up" "<Primary><Super>k" ];
toggle-maximized = [ "<Super>m" ];
close = [ "<Super>q" "<Alt>F4" ];
minimize = [ "<Super>comma" ];
switch-to-workspace-left = [ "" ];
switch-to-workspace-right = [ "" ];
maximize = [ "" ];
unmaximize = [ "" ];
move-to-monitor-up = [ "" ];
move-to-monitor-down = [ "" ];
move-to-monitor-left = [ "" ];
move-to-monitor-right = [ "" ];
move-to-workspace-down = [ "" ];
move-to-workspace-up = [ "" ];
switch-to-workspace-down = [ "<Primary><Super>Down" "<Primary><Super>j" ];
switch-to-workspace-up = [ "<Primary><Super>Up" "<Primary><Super>k" ];
toggle-maximized = [ "<Super>m" ];
close = [ "<Super>q" "<Alt>F4" ];
};
};
"org/gnome/mutter/keybindings" = {
toggle-tiled-left = [ "" ];
toggle-tiled-right = [ "" ];

View File

@ -7,6 +7,11 @@ in
options.de2.enable = mkEnableOption "Enable de2 system stuff";
config = mkIf cfg.enable {
environment.gnome.excludePackages = with pkgs; [
gnome.epiphany
gnome.gnome-software
];
services.xserver = {
enable = lib.mkDefault true;
displayManager.gdm.enable = lib.mkDefault true;