feat: easy theme switching with stylix, specialisations, and a rofi script; feat: switch to kitty terminal

This commit is contained in:
2025-12-18 20:49:12 -05:00
parent d708b43395
commit f082e5a1d3
8 changed files with 36 additions and 15 deletions
+2
View File
@@ -17,6 +17,8 @@
home.homeDirectory = "/home/autumn"; home.homeDirectory = "/home/autumn";
home.stateVersion = "25.05"; home.stateVersion = "25.05";
programs.kitty.enable = true;
stylix = { stylix = {
targets.waybar.enable = false; targets.waybar.enable = false;
targets.zathura.enable = false; targets.zathura.enable = false;
+4 -2
View File
@@ -9,8 +9,9 @@
$mainMod=SUPER $mainMod=SUPER
$menu=rofi -show drun $menu=rofi -show drun
$powerMenu=rofi -show power-menu -modi "power-menu:rofi-power-menu --choices lockscreen/suspend/reboot/shutdown" $powerMenu=rofi -show power-menu -modi "power-menu:rofi-power-menu --choices lockscreen/suspend/reboot/shutdown"
$switchThemes=rofi -show switch-theme -modes "switch-theme:/etc/nixos/home/pc/common/programs/rofi/scripts/switch-theme.sh"
$screenshot=slurp | grim -g - - | wl-copy $screenshot=slurp | grim -g - - | wl-copy
$terminal=foot $terminal=kitty
animations { animations {
bezier=myBezier, 0.05, 0.9, 0.1, 1.05 bezier=myBezier, 0.05, 0.9, 0.1, 1.05
animation=windows, 1, 7, myBezier animation=windows, 1, 7, myBezier
@@ -88,6 +89,7 @@
bind=$mainMod, M, exit bind=$mainMod, M, exit
bind=$mainMod, V, togglefloating bind=$mainMod, V, togglefloating
bind=$mainMod, D, exec, $menu bind=$mainMod, D, exec, $menu
bind=$mainMod, H, exec, $switchThemes
bind=$mainMod, P, pseudo bind=$mainMod, P, pseudo
bind=$mainMod, T, togglesplit bind=$mainMod, T, togglesplit
bind=$mainMod, S, exec, $screenshot bind=$mainMod, S, exec, $screenshot
@@ -139,7 +141,7 @@
env=HYPRCURSOR_SIZE,24 env=HYPRCURSOR_SIZE,24
exec-once=swww-daemon exec-once=swww-daemon
exec=swww img ${config.stylix.image} exec=swww img ${config.stylix.image} -t none
exec-once=waybar exec-once=waybar
exec=pkill waybar; waybar exec=pkill waybar; waybar
-1
View File
@@ -6,7 +6,6 @@
./btop.nix ./btop.nix
./carapace.nix ./carapace.nix
./fastfetch.nix ./fastfetch.nix
./foot.nix
./git.nix ./git.nix
./hyfetch.nix ./hyfetch.nix
./mako.nix ./mako.nix
+6 -7
View File
@@ -1,13 +1,12 @@
{...}: { { config, lib, ... }:
{
programs.foot = { programs.foot = {
enable = true; enable = true;
settings = { settings = {
cursor = { main.font = lib.mkForce "${config.stylix.fonts.monospace.name}:size=19";
style = "beam"; main.font-size-adjustment = 1;
}; cursor.style = "beam";
key-bindings = { key-bindings.spawn-terminal = "none";
spawn-terminal = "none";
};
}; };
}; };
} }
+3 -1
View File
@@ -1,5 +1,7 @@
{ config, ... }: { config, pkgs, ... }:
{ {
home.packages = [ pkgs.libnotify ];
xdg.configFile."rofi/config.rasi".text = '' xdg.configFile."rofi/config.rasi".text = ''
configuration{ configuration{
modi: "run,drun,window"; modi: "run,drun,window";
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
if [[ -n $1 ]]; then
sudo /nix/var/nix/profiles/system/specialisation/$1/bin/switch-to-configuration test > /dev/null
notify-send "Switched to theme $1"
exit 0
fi
ls /nix/var/nix/profiles/system/specialisation/
+3 -3
View File
@@ -2,6 +2,7 @@
inputs, inputs,
hostName, hostName,
pkgs, pkgs,
userName,
... ...
}: }:
@@ -38,7 +39,7 @@
home-manager = { home-manager = {
extraSpecialArgs = { inherit inputs; }; extraSpecialArgs = { inherit inputs; };
users = { users = {
autumn = import (../../.. + "/home/pc/${hostName}/home.nix"); ${userName} = import (../../.. + "/home/pc/${hostName}/home.nix");
}; };
}; };
@@ -83,9 +84,8 @@
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true; hardware.bluetooth.powerOnBoot = true;
users.users.autumn = { users.users.${userName} = {
isNormalUser = true; isNormalUser = true;
description = "Autumn";
extraGroups = [ extraGroups = [
"networkmanager" "networkmanager"
"wheel" "wheel"
+9 -1
View File
@@ -1,7 +1,8 @@
{ {
inputs, inputs,
pkgs,
lib, lib,
pkgs,
userName,
... ...
}: }:
let let
@@ -71,4 +72,11 @@ in
gruvbox-dark-hard.configuration.stylix = lib.mkForce (makeTheme "gruvbox-dark-hard" "dark"); gruvbox-dark-hard.configuration.stylix = lib.mkForce (makeTheme "gruvbox-dark-hard" "dark");
heetch.configuration.stylix = lib.mkForce (makeTheme "heetch" "dark"); heetch.configuration.stylix = lib.mkForce (makeTheme "heetch" "dark");
}; };
security.sudo.extraConfig = ''
${userName} ALL = (root) NOPASSWD: /nix/var/nix/profiles/system/specialisation/catppuccin-mocha/bin/switch-to-configuration
${userName} ALL = (root) NOPASSWD: /nix/var/nix/profiles/system/specialisation/catppuccin-latte/bin/switch-to-configuration
${userName} ALL = (root) NOPASSWD: /nix/var/nix/profiles/system/specialisation/gruvbox-dark-hard/bin/switch-to-configuration
${userName} ALL = (root) NOPASSWD: /nix/var/nix/profiles/system/specialisation/heetch/bin/switch-to-configuration
'';
} }