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 = { options = {
userSettings.emacs = { userSettings.emacs = {
enable = lib.mkEnableOption "Enable 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; template = builtins.readFile ./lib/doom-stylix-theme.el.mustache;
extension = ".el"; 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" ]; 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 ;; organize everything with use-package
(require 'use-package) (require 'use-package)
(load (expand-file-name "~/.config/emacs/sysvars.el"))
;; use-package-ception ;; use-package-ception
(use-package use-package (use-package use-package
@ -28,9 +29,9 @@
(setq inhibit-startup-message t) (setq inhibit-startup-message t)
;; Transparent background ;; Transparent background
(set-frame-parameter nil 'alpha-background 85) (set-frame-parameter nil 'alpha-background systemOpacity)
(add-to-list 'default-frame-alist '(alpha-background . 85)) (add-to-list 'default-frame-alist '(alpha-background . systemOpacity))
(add-to-list 'default-frame-alist '(inhibit-double-buffering . t)) ;;(add-to-list 'default-frame-alist '(inhibit-double-buffering . t))
;; I want declarative config, no custom ;; I want declarative config, no custom
(setq custom-file "/dev/null") (setq custom-file "/dev/null")

View File

@ -5,6 +5,7 @@ let
term = config.userSettings.terminal; term = config.userSettings.terminal;
spawnEditor = config.userSettings.spawnEditor; spawnEditor = config.userSettings.spawnEditor;
spawnBrowser = config.userSettings.spawnBrowser; spawnBrowser = config.userSettings.spawnBrowser;
performance = config.userSettings.hyprland.performanceOptimizations;
in in
{ {
options = { options = {
@ -20,7 +21,10 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
userSettings.alacritty.enable = true; userSettings.alacritty.enable = true;
programs.alacritty.settings.window.opacity = lib.mkOverride 40 (if performance then 1.0 else 0.85);
userSettings.kitty.enable = true; 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 = { userSettings.dmenuScripts = {
enable = true; enable = true;
dmenuCmd = "fuzzel -d"; dmenuCmd = "fuzzel -d";
@ -450,8 +454,8 @@ in
then then
nwggrid -client nwggrid -client
else 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} 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 sleep 0.6 && nwggrid -client
fi fi
'') '')
(pkgs.writeScriptBin "hyprgamemode" '' (pkgs.writeScriptBin "hyprgamemode" ''