some more optimizations

This commit is contained in:
Emmet
2025-07-04 13:51:29 -05:00
parent c143f3ac30
commit 14cab3e0bb
3 changed files with 18 additions and 5 deletions

View File

@ -6,6 +6,11 @@ in {
options = {
userSettings.emacs = {
enable = lib.mkEnableOption "Enable emacs";
opacity = lib.mkOption {
default = 85;
type = lib.types.number;
description = "Emacs' percentage opacity as a whole number";
};
};
};
@ -70,6 +75,9 @@ in {
template = builtins.readFile ./lib/doom-stylix-theme.el.mustache;
extension = ".el";
};
home.file.".config/emacs/sysvars.el".text = ''
(setq systemOpacity ${builtins.toString config.userSettings.emacs.opacity})
'';
wayland.windowManager.hyprland.settings.exec-once = lib.optionals config.wayland.windowManager.hyprland.enable [ "emacs --daemon" ];
};
}

View File

@ -14,6 +14,7 @@
;; organize everything with use-package
(require 'use-package)
(load (expand-file-name "~/.config/emacs/sysvars.el"))
;; use-package-ception
(use-package use-package
@ -28,9 +29,9 @@
(setq inhibit-startup-message t)
;; Transparent background
(set-frame-parameter nil 'alpha-background 85)
(add-to-list 'default-frame-alist '(alpha-background . 85))
(add-to-list 'default-frame-alist '(inhibit-double-buffering . t))
(set-frame-parameter nil 'alpha-background systemOpacity)
(add-to-list 'default-frame-alist '(alpha-background . systemOpacity))
;;(add-to-list 'default-frame-alist '(inhibit-double-buffering . t))
;; I want declarative config, no custom
(setq custom-file "/dev/null")

View File

@ -5,6 +5,7 @@ let
term = config.userSettings.terminal;
spawnEditor = config.userSettings.spawnEditor;
spawnBrowser = config.userSettings.spawnBrowser;
performance = config.userSettings.hyprland.performanceOptimizations;
in
{
options = {
@ -20,7 +21,10 @@ in
config = lib.mkIf cfg.enable {
userSettings.alacritty.enable = true;
programs.alacritty.settings.window.opacity = lib.mkOverride 40 (if performance then 1.0 else 0.85);
userSettings.kitty.enable = true;
programs.kitty.settings.background_opacity = lib.mkOverride 40 (if performance then "1.0" else "0.85");
userSettings.emacs.opacity = lib.mkOverride 40 (if performance then 100 else 85);
userSettings.dmenuScripts = {
enable = true;
dmenuCmd = "fuzzel -d";
@ -450,8 +454,8 @@ in
then
nwggrid -client
else
GDK_PIXBUF_MODULE_FILE=${pkgs.librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache nwggrid-server -layer-shell-exclusive-zone -1 -g adw-gtk3 -o 0.55 -b ${config.lib.stylix.colors.base00}
sleep 0.5 && nwggrid -client
GDK_PIXBUF_MODULE_FILE=${pkgs.librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache nwggrid-server -layer-shell-exclusive-zone -1 -g adw-gtk3 -o 0.55 -b ${config.lib.stylix.colors.base00} &
sleep 0.6 && nwggrid -client
fi
'')
(pkgs.writeScriptBin "hyprgamemode" ''