mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-22 04:13:55 -05:00
moved color scheme swap scripts to gnome and kde modules respectively
gnome/kde: nixify cs adjustment scripts
This commit is contained in:
parent
fcc8f9980e
commit
3c2ed253ff
|
@ -4,34 +4,7 @@
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
cs-adjuster = pkgs.writeShellScriptBin "cs-adjuster" ''
|
|
||||||
# Get current color scheme
|
|
||||||
color_scheme=$(gsettings get org.gnome.desktop.interface color-scheme)
|
|
||||||
|
|
||||||
# Toggle between light and dark color schemes
|
|
||||||
if [ "$color_scheme" == "'default'" ] || [ "$color_scheme" == "'prefer-light'" ]; then
|
|
||||||
color_scheme="'prefer-dark'"
|
|
||||||
else
|
|
||||||
color_scheme="'prefer-light'"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Apply the updated color scheme
|
|
||||||
gsettings set org.gnome.desktop.interface color-scheme $color_scheme
|
|
||||||
'';
|
|
||||||
|
|
||||||
cs-adjuster-plasma = pkgs.writeShellScriptBin "cs-adjuster-plasma" ''
|
|
||||||
# Query the Desktop Portal Service for the current color scheme
|
|
||||||
color_scheme=$(qdbus org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read org.freedesktop.appearance color-scheme)
|
|
||||||
|
|
||||||
# Check the color scheme and apply the appropriate look and feel
|
|
||||||
if [ "$color_scheme" = "1" ]; then
|
|
||||||
plasma-apply-lookandfeel -a org.kde.breeze.desktop
|
|
||||||
else
|
|
||||||
plasma-apply-lookandfeel -a org.kde.breezedark.desktop
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
in {
|
|
||||||
imports = [
|
imports = [
|
||||||
./disko.nix
|
./disko.nix
|
||||||
./hardware-configuration.nix # Include the results of the hardware scan.
|
./hardware-configuration.nix # Include the results of the hardware scan.
|
||||||
|
@ -49,8 +22,6 @@ in {
|
||||||
|
|
||||||
networking.hostName = "petalburg"; # Define your hostname.
|
networking.hostName = "petalburg"; # Define your hostname.
|
||||||
|
|
||||||
environment.systemPackages = [cs-adjuster cs-adjuster-plasma];
|
|
||||||
|
|
||||||
alyraffauf = {
|
alyraffauf = {
|
||||||
system = {
|
system = {
|
||||||
plymouth.enable = true;
|
plymouth.enable = true;
|
||||||
|
|
|
@ -3,7 +3,22 @@
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}: let
|
||||||
|
gnomeCsAdjuster = pkgs.writeShellScriptBin "gnome-cs-adjuster" ''
|
||||||
|
# Get current color scheme
|
||||||
|
color_scheme=$(${lib.getExe' pkgs.glib "gsettings"} get org.gnome.desktop.interface color-scheme)
|
||||||
|
|
||||||
|
# Toggle between light and dark color schemes
|
||||||
|
if [ "$color_scheme" == "'default'" ] || [ "$color_scheme" == "'prefer-light'" ]; then
|
||||||
|
color_scheme="'prefer-dark'"
|
||||||
|
else
|
||||||
|
color_scheme="'prefer-light'"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Apply the updated color scheme
|
||||||
|
${lib.getExe' pkgs.glib "gsettings"} set org.gnome.desktop.interface color-scheme $color_scheme
|
||||||
|
'';
|
||||||
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
# Include X settings.
|
# Include X settings.
|
||||||
./fprintdFix.nix
|
./fprintdFix.nix
|
||||||
|
@ -16,16 +31,18 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.alyraffauf.desktop.gnome.enable {
|
config = lib.mkIf config.alyraffauf.desktop.gnome.enable {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs;
|
||||||
gnomeExtensions.appindicator
|
[
|
||||||
gnomeExtensions.blur-my-shell
|
gnomeExtensions.appindicator
|
||||||
gnomeExtensions.gsconnect
|
gnomeExtensions.blur-my-shell
|
||||||
gnomeExtensions.light-shell
|
gnomeExtensions.gsconnect
|
||||||
gnomeExtensions.night-theme-switcher
|
gnomeExtensions.light-shell
|
||||||
gnomeExtensions.noannoyance-fork
|
gnomeExtensions.night-theme-switcher
|
||||||
gnomeExtensions.tailscale-status
|
gnomeExtensions.noannoyance-fork
|
||||||
gnomeExtensions.tiling-assistant
|
gnomeExtensions.tailscale-status
|
||||||
];
|
gnomeExtensions.tiling-assistant
|
||||||
|
]
|
||||||
|
++ [gnomeCsAdjuster];
|
||||||
|
|
||||||
# Enable keyring support for KDE apps in GNOME.
|
# Enable keyring support for KDE apps in GNOME.
|
||||||
security.pam.services.gdm.enableKwallet = true;
|
security.pam.services.gdm.enableKwallet = true;
|
||||||
|
|
|
@ -3,7 +3,19 @@
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}: let
|
||||||
|
plasmaCsAdjuster = pkgs.writeShellScriptBin "plasma-cs-adjuster" ''
|
||||||
|
# Query the Desktop Portal Service for the current color scheme
|
||||||
|
color_scheme=$(${lib.getExe' pkgs.kdePackages.qttools "qdbus"} org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read org.freedesktop.appearance color-scheme)
|
||||||
|
|
||||||
|
# Check the color scheme and apply the appropriate look and feel
|
||||||
|
if [ "$color_scheme" = "1" ]; then
|
||||||
|
${lib.getExe' pkgs.kdePackages.plasma-workspace "plasma-apply-lookandfeel"} -a org.kde.breeze.desktop
|
||||||
|
else
|
||||||
|
${lib.getExe' pkgs.kdePackages.plasma-workspace "plasma-apply-lookandfeel"} -a org.kde.breezedark.desktop
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
in {
|
||||||
options = {
|
options = {
|
||||||
alyraffauf.desktop.plasma.enable =
|
alyraffauf.desktop.plasma.enable =
|
||||||
lib.mkEnableOption "Enable plasma desktop session.";
|
lib.mkEnableOption "Enable plasma desktop session.";
|
||||||
|
@ -21,13 +33,15 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs;
|
||||||
kdePackages.kate
|
[
|
||||||
kdePackages.kimageformats
|
kdePackages.kate
|
||||||
kdePackages.kio-gdrive
|
kdePackages.kimageformats
|
||||||
kdePackages.sddm-kcm
|
kdePackages.kio-gdrive
|
||||||
maliit-keyboard
|
kdePackages.sddm-kcm
|
||||||
];
|
maliit-keyboard
|
||||||
|
]
|
||||||
|
++ [plasmaCsAdjuster];
|
||||||
|
|
||||||
programs.kdeconnect.enable = true;
|
programs.kdeconnect.enable = true;
|
||||||
# nixpkgs.config.firefox.enablePlasmaBrowserIntegration = true;
|
# nixpkgs.config.firefox.enablePlasmaBrowserIntegration = true;
|
||||||
|
|
Loading…
Reference in a new issue