From 9398ad6f661725e67e7d3c2089215ad37f4fdf51 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Wed, 3 Jul 2024 00:40:04 -0400 Subject: [PATCH] home: code cleanup --- homeManagerModules/desktop/default.nix | 1 + homeManagerModules/desktop/hyprland/default.nix | 14 ++++++-------- homeManagerModules/desktop/waylandComp.nix | 8 +++----- homeManagerModules/theme.nix | 6 +++--- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/homeManagerModules/desktop/default.nix b/homeManagerModules/desktop/default.nix index 4acde686..6a134e2d 100644 --- a/homeManagerModules/desktop/default.nix +++ b/homeManagerModules/desktop/default.nix @@ -26,6 +26,7 @@ settings = { "org/gtk/gtk4/settings/file-chooser".sort-directories-first = true; "org/gtk/settings/file-chooser".sort-directories-first = true; + "org/virt-manager/virt-manager/connections" = { autoconnect = ["qemu:///system"]; uris = ["qemu:///system"]; diff --git a/homeManagerModules/desktop/hyprland/default.nix b/homeManagerModules/desktop/hyprland/default.nix index 47f1b378..177a6c0e 100644 --- a/homeManagerModules/desktop/hyprland/default.nix +++ b/homeManagerModules/desktop/hyprland/default.nix @@ -80,10 +80,8 @@ (lib.getExe pkgs.mako) "${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1" ] - ++ lib.lists.optionals (config.ar.home.desktop.hyprland.redShift) [ - # "${pkgs.geoclue2}/libexec/geoclue-2.0/demos/agent" - "${lib.getExe pkgs.gammastep} -l 33.74:-84.38" - ]; + ++ lib.lists.optional (config.ar.home.desktop.hyprland.redShift) + "${lib.getExe pkgs.gammastep} -l 33.74:-84.38"; screenshot = rec { bin = lib.getExe pkgs.hyprshot; @@ -130,7 +128,7 @@ fi elif [ "$1" == "off" ]; then ${ - lib.strings.concatStringsSep "\n" + lib.strings.concatLines ( lib.attrsets.mapAttrsToList (name: monitor: ''${hyprctl} keyword monitor "${monitor}"'') laptopMonitors @@ -192,7 +190,7 @@ ''; in '' ${ - lib.strings.concatStringsSep "\n" + lib.strings.concatLines ( lib.attrsets.mapAttrsToList (name: value: "monitor = ${value}") (laptopMonitors // externalMonitors) @@ -368,7 +366,7 @@ # Move window with mainMod SHIFT + keys ++ # Move workspace to another output with mainMod CONTROL SHIFT + keys. ${ - lib.strings.concatStringsSep "\n" + lib.strings.concatLines ( lib.attrsets.mapAttrsToList (key: direction: '' bind = ${modifier}, ${key}, movefocus, ${direction} @@ -450,7 +448,7 @@ # Move window with keys ++ # Move workspaces across monitors with CONTROL + keys. ${ - lib.strings.concatStringsSep "\n" + lib.strings.concatLines ( lib.attrsets.mapAttrsToList (key: direction: '' bind = , ${key}, movewindow, ${direction} diff --git a/homeManagerModules/desktop/waylandComp.nix b/homeManagerModules/desktop/waylandComp.nix index f9aa77a8..445c7394 100644 --- a/homeManagerModules/desktop/waylandComp.nix +++ b/homeManagerModules/desktop/waylandComp.nix @@ -16,9 +16,7 @@ dconf = { enable = true; settings = { - "org/gnome/desktop/wm/preferences" = { - button-layout = ""; - }; + "org/gnome/desktop/wm/preferences" = {button-layout = "";}; "org/gnome/nm-applet".disable-connected-notifications = true; }; }; @@ -32,9 +30,9 @@ xdg.portal = { enable = true; configPackages = - lib.optionals (config.ar.home.desktop.hyprland.enable) [pkgs.xdg-desktop-portal-hyprland]; + lib.optional (config.ar.home.desktop.hyprland.enable) pkgs.xdg-desktop-portal-hyprland; extraPortals = - lib.optionals (config.ar.home.desktop.hyprland.enable) [pkgs.xdg-desktop-portal-hyprland]; + lib.optional (config.ar.home.desktop.hyprland.enable) pkgs.xdg-desktop-portal-hyprland; }; }; } diff --git a/homeManagerModules/theme.nix b/homeManagerModules/theme.nix index 3bba36d3..0f8487e9 100644 --- a/homeManagerModules/theme.nix +++ b/homeManagerModules/theme.nix @@ -67,8 +67,9 @@ @define-color accent_color @accent_bg_color; ${ - if config.ar.home.theme.gtk.hideTitleBar - then '' + lib.strings.optionalString + config.ar.home.theme.gtk.hideTitleBar + '' /* No (default) title bar on wayland */ headerbar.default-decoration { /* You may need to tweak these values depending on your GTK theme */ @@ -89,7 +90,6 @@ box-shadow: none; } '' - else "/* */" } '';