From 22b55e455c26635a2dc1703ea7211fb6f540631e Mon Sep 17 00:00:00 2001 From: Cookiez Date: Wed, 3 Sep 2025 14:27:29 +0200 Subject: [PATCH] Reworked KDE Theme reminder to be a popup. Fixed Trayscale not working by default. --- configuration.nix | 9 ++++--- firefox.nix | 0 flake.lock | 0 flake.nix | 0 hardware-configuration.nix | 9 ++++--- home.nix | 0 hyprland/hyprland-home.nix | 0 hyprland/hyprland.conf | 0 hyprland/hyprland.nix | 0 neovim-home.nix | 0 neovim.nix | 0 other/aliases | 4 +++- other/colors.sh | 0 other/pfp.png | Bin other/pfp.sh | 0 other/wallpaper.png | Bin packages.nix | 1 + plasma/autostart.nix | 47 +++++++++++++++++++++++++++---------- plasma/kde-plasma.nix | 9 ++----- plasma/konsave.sh | 0 plasma/theme-popup.sh | 11 +++++++++ plasma/theme-reminder.sh | 9 ------- plasma/theme.knsv | Bin zsh.nix | 1 - 24 files changed, 62 insertions(+), 38 deletions(-) mode change 100644 => 100755 configuration.nix mode change 100644 => 100755 firefox.nix mode change 100644 => 100755 flake.lock mode change 100644 => 100755 flake.nix mode change 100644 => 100755 home.nix mode change 100644 => 100755 hyprland/hyprland-home.nix mode change 100644 => 100755 hyprland/hyprland.conf mode change 100644 => 100755 hyprland/hyprland.nix mode change 100644 => 100755 neovim-home.nix mode change 100644 => 100755 neovim.nix mode change 100644 => 100755 other/aliases mode change 100644 => 100755 other/colors.sh mode change 100644 => 100755 other/pfp.png mode change 100644 => 100755 other/pfp.sh mode change 100644 => 100755 other/wallpaper.png mode change 100644 => 100755 packages.nix mode change 100644 => 100755 plasma/autostart.nix mode change 100644 => 100755 plasma/kde-plasma.nix mode change 100644 => 100755 plasma/konsave.sh create mode 100755 plasma/theme-popup.sh delete mode 100644 plasma/theme-reminder.sh mode change 100644 => 100755 plasma/theme.knsv mode change 100644 => 100755 zsh.nix diff --git a/configuration.nix b/configuration.nix old mode 100644 new mode 100755 index 02ef215..0379b3b --- a/configuration.nix +++ b/configuration.nix @@ -10,7 +10,7 @@ #Nix flake file limit: ulimit -n 500000 -{ config, pkgs, ... }: +{ config, pkgs, username, ... }: { #Assign Swap to the PC @@ -100,8 +100,9 @@ tailscale = { enable = true; - extraUpFlags = [ - "--operator=${builtins.getEnv "USER"}" + useRoutingFeatures = "client"; + extraSetFlags = [ + "--operator=${username}" "--accept-routes" ]; }; @@ -139,6 +140,8 @@ #In order for dynamically linked executables to work programs.nix-ld.enable = true; + programs.steam.enable = true; + # Configure console keymap console.keyMap = "de"; diff --git a/firefox.nix b/firefox.nix old mode 100644 new mode 100755 diff --git a/flake.lock b/flake.lock old mode 100644 new mode 100755 diff --git a/flake.nix b/flake.nix old mode 100644 new mode 100755 diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 468e8b9..2a4e324 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -8,24 +8,24 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "sd_mod" ]; + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "uas" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/e50e3c90-8486-46a2-aa7f-ec3ace52344e"; + { device = "/dev/disk/by-uuid/908d7dfb-fb97-4b78-80b5-dc8d810522e0"; fsType = "ext4"; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/D876-ED20"; + { device = "/dev/disk/by-uuid/F4AB-9E6A"; fsType = "vfat"; options = [ "fmask=0077" "dmask=0077" ]; }; swapDevices = - [ { device = "/dev/disk/by-uuid/a80421d5-1b37-4fd2-b308-fd5bbd81fe10"; } + [ { device = "/dev/disk/by-uuid/d969d107-c7b5-4d5e-8c47-310cacbd38d1"; } ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking @@ -34,7 +34,6 @@ # with explicit per-interface declarations with `networking.interfaces..useDHCP`. networking.useDHCP = lib.mkDefault true; # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - # networking.interfaces.tailscale0.useDHCP = lib.mkDefault true; # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; diff --git a/home.nix b/home.nix old mode 100644 new mode 100755 diff --git a/hyprland/hyprland-home.nix b/hyprland/hyprland-home.nix old mode 100644 new mode 100755 diff --git a/hyprland/hyprland.conf b/hyprland/hyprland.conf old mode 100644 new mode 100755 diff --git a/hyprland/hyprland.nix b/hyprland/hyprland.nix old mode 100644 new mode 100755 diff --git a/neovim-home.nix b/neovim-home.nix old mode 100644 new mode 100755 diff --git a/neovim.nix b/neovim.nix old mode 100644 new mode 100755 diff --git a/other/aliases b/other/aliases old mode 100644 new mode 100755 index b6113e8..dafda35 --- a/other/aliases +++ b/other/aliases @@ -38,7 +38,9 @@ alias home-edit="sudoedit /etc/nixos/home.nix" alias cd-nix="cd /etc/nixos/" - +#KDE Plasma Specific +#----- +alias kde-theme-apply="source /etc/nixos/plasma/konsave.sh" #Hyprland Specific #----- diff --git a/other/colors.sh b/other/colors.sh old mode 100644 new mode 100755 diff --git a/other/pfp.png b/other/pfp.png old mode 100644 new mode 100755 diff --git a/other/pfp.sh b/other/pfp.sh old mode 100644 new mode 100755 diff --git a/other/wallpaper.png b/other/wallpaper.png old mode 100644 new mode 100755 diff --git a/packages.nix b/packages.nix old mode 100644 new mode 100755 index 5b99929..789a1b3 --- a/packages.nix +++ b/packages.nix @@ -24,6 +24,7 @@ konsave #A package to transfer the look and feel of KDE Plasma to other machines ocs-url kdePackages.plasma-workspace + kdePackages.kdialog openssh #SSH zoxide #Alternatice to cd, browse files fzf-zsh #Search for file names diff --git a/plasma/autostart.nix b/plasma/autostart.nix old mode 100644 new mode 100755 index 1fc5cdb..a298dc1 --- a/plasma/autostart.nix +++ b/plasma/autostart.nix @@ -1,12 +1,16 @@ { config, pkgs, ... }: { + +#To show logs of services run: journalctl --user-unit={service-name} --user + systemd.user.services.set-wallpaper = { enable = true; description = "Set KDE Plasma wallpaper"; #after = [ "plasma-desktop.service" ]; - serviceConfig.ExecStart = [ "/run/current-system/sw/bin/plasma-apply-wallpaperimage /etc/nixos/other/wallpaper.png" ]; wantedBy = [ "graphical-session.target" ]; serviceConfig = { + ExecStart = [ "/run/current-system/sw/bin/plasma-apply-wallpaperimage /etc/nixos/other/wallpaper.png" ]; + Type = "oneshot"; Restart = "on-failure"; RestartSec = "5s"; @@ -17,9 +21,10 @@ enable = true; description = "Automatically start Yakuake"; after = [ "graphical-session.target" ]; - serviceConfig.ExecStart = [ "${pkgs.kdePackages.yakuake}/bin/yakuake" ]; wantedBy = [ "graphical-session.target" ]; serviceConfig = { + ExecStart = [ "${pkgs.kdePackages.yakuake}/bin/yakuake" ]; + Type = "oneshot"; Restart = "on-failure"; RestartSec = "5s"; @@ -27,16 +32,34 @@ }; }; + systemd.user.services.theme-set-reminder = { + enable = true; + description = "Remind the user to apply the custom Plasma Theme shipped with this NixOS"; + after = [ "graphical-session.target" ]; + wantedBy = [ "graphical-session.target" ]; + serviceConfig = { +# ExecStart = [ "${pkgs.kdePackages.kdialog}/bin/kdialog --passivepopup \"Dont forget to apply custom system theme! (run kde-theme-apply in terminal)\"" ]; + ExecStart = [ "/etc/nixos/plasma/theme-popup.sh" ]; + + Type = "oneshot"; + Restart = "on-failure"; + RestartSec = "5s"; +# Environment = "PATH=/run/current-system/sw/bin:/etc/profiles/per-user/$USER/bin"; +# Environment = "DISPLAY=:0"; + }; + }; + systemd.user.services.autostart-trayscale = { - enable = true; - description = "Automatically start Trayscale"; - #after = [ "plasma-desktop.service" ]; - serviceConfig.ExecStart = [ "${pkgs.trayscale}/bin/trayscale --hide-window" ]; - wantedBy = [ "default.target" ]; - serviceConfig = { - Type = "oneshot"; - Restart = "on-failure"; - RestartSec = "5s"; - }; + enable = true; + description = "Automatically start Trayscale"; + #after = [ "plasma-desktop.service" ]; + wantedBy = [ "default.target" ]; + serviceConfig = { + ExecStart = [ "${pkgs.trayscale}/bin/trayscale --hide-window" ]; + + Type = "oneshot"; + Restart = "on-failure"; + RestartSec = "5s"; + }; }; } diff --git a/plasma/kde-plasma.nix b/plasma/kde-plasma.nix old mode 100644 new mode 100755 index d7b755d..1e512c6 --- a/plasma/kde-plasma.nix +++ b/plasma/kde-plasma.nix @@ -32,13 +32,11 @@ in # variant = ""; #}; - #theme-reminder uses a definitive /home/cookiez path!!! system.activationScripts.script.text = '' source /etc/nixos/other/colors.sh - source /etc/nixos/other/pfp.sh + source /etc/nixos/other/pfp.sh - source /etc/nixos/plasma/theme-reminder.sh - ''; + ''; #services.displayManager.sddm = { # enable = true; @@ -55,7 +53,4 @@ in # background = "${background-package}" # '') ]; - - - programs.steam.enable = true; } diff --git a/plasma/konsave.sh b/plasma/konsave.sh old mode 100644 new mode 100755 diff --git a/plasma/theme-popup.sh b/plasma/theme-popup.sh new file mode 100755 index 0000000..05f04f3 --- /dev/null +++ b/plasma/theme-popup.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +sleep 15 +FLAG_FILE="/home/cookiez/.flags/theme-flag" + + +if [ ! -f "$FLAG_FILE" ]; then + /run/current-system/sw/bin/kdialog --passivepopup "Dont forget to apply custom system theme! (run kde-theme-apply in terminal)" 60 +fi + +echo "Finished Popup Script!" diff --git a/plasma/theme-reminder.sh b/plasma/theme-reminder.sh deleted file mode 100644 index 3d61550..0000000 --- a/plasma/theme-reminder.sh +++ /dev/null @@ -1,9 +0,0 @@ -source /etc/nixos/other/colors.sh -FLAG_FILE="/home/cookiez/.flags/theme-flag" - -if [ ! -f "$FLAG_FILE" ]; then - echo -e "${RED}Warning: Make sure to apply the custom system theme!${NOCOLOR} (source '/etc/nixos/plasma/konsave.sh')" -fi -#else -# echo "Flag file exists - Theme should be applied already!" -#fi diff --git a/plasma/theme.knsv b/plasma/theme.knsv old mode 100644 new mode 100755 diff --git a/zsh.nix b/zsh.nix old mode 100644 new mode 100755 index ea23fb9..e6c0dd2 --- a/zsh.nix +++ b/zsh.nix @@ -9,7 +9,6 @@ shellInit = '' source /etc/nixos/other/aliases - source /etc/nixos/plasma/theme-reminder.sh '';