dotfiles

My PC Dotfiles & Website
commit 3acfcae18fe99f5355891ad2df6ac6ea2116b0d1
parent 898526ef6e15ba88bc16843438b32dbf5d06da60
Author: maydayv7 <maydayv7@gmail.com>
Date:   Wed, 24 Jan 2024 17:05:30 +0530

feat: Picom Shadows

Also add `gui.compositor.exclude` and fix some syntax errors

Diffstat:

Mchecks/flake.nix | 1-
Mfiles/flake.nix | 5+++++
Mfiles/images/desktop/xfce.png | 0
Mfiles/xfce/gtk.css | 17++++-------------
Mmodules/README.md | 7++++---
Mmodules/apps/git/hosting.nix | 4++--
Mmodules/apps/git/user.nix | 2+-
Mmodules/gui/compositor.nix | 25+++++++++++++++++++++----
Mmodules/gui/desktop/xfce.nix | 30+++++++++++++++++++++---------
Mmodules/gui/launcher.nix | 6+++++-
10 files changed, 63 insertions(+), 34 deletions(-)

diff --git a/checks/flake.nix b/checks/flake.nix @@ -35,7 +35,6 @@ prettier = { enable = true; settings.bracketSameLine = true; - excludes = ["*.css"]; }; }; }; diff --git a/files/flake.nix b/files/flake.nix @@ -136,4 +136,9 @@ # Z Shell zsh.prompt = readFile ./zsh/p10k.zsh; }; + + perSystem = _: { + # Formatting Errors + treefmt.config.programs.prettier.excludes = ["files/xfce/gtk.css"]; + }; } diff --git a/files/images/desktop/xfce.png b/files/images/desktop/xfce.png Binary files differ. diff --git a/files/xfce/gtk.css b/files/xfce/gtk.css @@ -1,15 +1,6 @@ -.xfce4-panel#XfcePanelWindow { - border-top-left-radius: 15px; - border-top-right-radius: 15px; - border-bottom-left-radius: 15px; - border-bottom-right-radius: 15px; - -XfcePanelWindow-autohide-size: 0; -} - -wnck-pager:selected { - background-color: #5294e2; -} +.xfce4-panel#XfcePanelWindow { -XfcePanelWindow-autohide-size: 0; } -wnck-pager:hover { - background-color: #7c818c; +wnck-pager { + :hover { background-color: #7c818c; } + :selected { background-color: #5294e2; } } diff --git a/modules/README.md b/modules/README.md @@ -10,7 +10,7 @@ Configuration [Builder](./configuration.nix) - `git` - - `hosting` - - `enable`: Enable Gitea Code Hosting - `true / false` - - `domain`: Website Domain Name - Ex. `maydayv7.io` + - `domain`: Website Domain Name - Ex. `maydayv7.tk` - `secret`: Path to Cloudfare Authentication Credentials - `runner` - - `support`: Enable Support for `git` Runners - `"github" / "gitlab"` @@ -34,10 +34,11 @@ Configuration [Builder](./configuration.nix) - `enable`: Enable GTK Configuration - `true / false` - `compositor` - - `enable`: Enable Window Compositor - `true / false` + - `exclude`: Exclude focus state for specified windows - Ex. `[ "fullscreen" ]` - `launcher` - - `enable`: Enable Application Launcher - `true / false` - - `terminal`: Terminal to be used by Launcher - - `theme`: Theme to be used by Launcher + - `terminal`: Terminal to be used by Launcher - Ex. `[ "xterm" ]` + - `theme`: Theme to be used by Launcher (Taken from `files.ulauncher.themes`) - `wayland` - - `enable`: Enable Wayland Configuration - `true / false` diff --git a/modules/apps/git/hosting.nix b/modules/apps/git/hosting.nix @@ -8,12 +8,12 @@ opt = config.apps.git.hosting; in { options.apps.git.hosting = { - enable = lib.mkEnableOption "Enable Gitea Code Hosting"; + enable = mkEnableOption "Enable Gitea Code Hosting"; domain = mkOption { description = "Website Domain Name"; type = types.str; default = ""; - example = "maydayv7.io"; + example = "maydayv7.tk"; }; secret = mkOption { description = "Path to Cloudfare Authentication Credentials"; diff --git a/modules/apps/git/user.nix b/modules/apps/git/user.nix @@ -7,7 +7,7 @@ cfg = config.credentials; opt = options.credentials.mail.description; in { - ## User Credentials @@ + ## User Credentials ## # Warnings assertions = [ { diff --git a/modules/gui/compositor.nix b/modules/gui/compositor.nix @@ -3,11 +3,21 @@ lib, pkgs, ... -}: { - options.gui.compositor.enable = lib.mkEnableOption "Enable Window Compositor"; +}: let + inherit (lib) mkBefore mkEnableOption mkIf mkOption types; + cfg = config.gui.compositor; +in { + options.gui.compositor = { + enable = mkEnableOption "Enable Window Compositor"; + exclude = mkOption { + description = "Exclude focus state for specified windows"; + type = with types; listOf str; + example = ["fullscreen"]; + }; + }; ## Picom Configuration ## - config = lib.mkIf config.gui.compositor.enable { + config = mkIf cfg.enable { services.picom = { enable = true; @@ -17,12 +27,13 @@ # Behaviour fade = true; + shadow = true; settings = { inactive-dim = 0.2; corner-radius = 10.0; - focus-exclude = ["fullscreen"]; detect-client-opacity = true; + focus-exclude = ["fullscreen"] ++ cfg.exclude; } // # Animations @@ -52,5 +63,11 @@ }; }); }; + + # Theme Fixes + user.homeConfig = { + gtk.gtk3.extraCss = mkBefore "decoration { box-shadow: none; }"; + programs.firefox.profiles.default.settings."browser.tabs.inTitlebar" = 0; + }; }; } diff --git a/modules/gui/desktop/xfce.nix b/modules/gui/desktop/xfce.nix @@ -53,16 +53,28 @@ in { ## Full-Fledged XFCE Desktop Configuration (mkIf (desktop == "xfce") { # Desktop Integration - gui = { - fonts.enable = true; - gtk.enable = true; - compositor.enable = compositor; - launcher = { - enable = true; - theme = theme.name; - terminal = "xfce4-terminal"; + gui = + { + fonts.enable = true; + gtk.enable = true; + } + // + # Desktop Components + { + compositor = { + enable = compositor; + exclude = [ + "class_g='Xfwm4'" + "class_g='Xfce4-panel'" + ]; + }; + + launcher = { + enable = true; + theme = theme.name; + terminal = "xfce4-terminal"; + }; }; - }; # Essential Utilities xdg.portal.extraPortals = [pkgs.xdg-desktop-portal-gtk]; diff --git a/modules/gui/launcher.nix b/modules/gui/launcher.nix @@ -7,6 +7,10 @@ }: let inherit (lib) mkEnableOption mkIf mkOption replaceStrings types; cfg = config.gui.launcher; + shadow = + if config.gui.compositor.enable + then "--no-window-shadow" + else ""; in { options.gui.launcher = { enable = mkEnableOption "Enable Application Launcher"; @@ -68,7 +72,7 @@ in { ExecStart = pkgs.writeShellScript "ulauncher-env-wrapper.sh" '' export PATH="''${XDG_BIN_HOME}:$HOME/.nix-profile/bin:/etc/profiles/per-user/$USER/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin" export GDK_BACKEND=x11 - exec ${pkgs.ulauncher}/bin/ulauncher --hide-window + exec ${pkgs.ulauncher}/bin/ulauncher --hide-window ${shadow} ''; }; };