From 8c45417cac1f60a8530296840268953bf35aab7a Mon Sep 17 00:00:00 2001 From: Tomas Rivera <137088692+Totorile1@users.noreply.github.com> Date: Thu, 26 Feb 2026 15:08:56 +0100 Subject: [PATCH] First shell script --- hosts/laptop/configuration.nix | 3 ++- hosts/laptop/home.nix | 4 ++++ modules/home-manager/hyprland.nix | 19 ++++++++++++++++--- modules/scripts/dontkillsteam.nix | 17 +++++++++++++++++ 4 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 modules/scripts/dontkillsteam.nix diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 1dfdeec..f61a998 100755 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -39,7 +39,7 @@ # Enable the GNOME Desktop Environment. # services.displayManager.gdm.enable = true; - services.desktopManager.gnome.enable = true; +# services.desktopManager.gnome.enable = true; # enable hyprland WM programs.hyprland = { enable = true; @@ -135,6 +135,7 @@ services.upower.enable = true; networkmanagerapplet # NetworkManager control applet cliphist # Wayland clipboard manager wl-clipboard # cli copy/past utilities for Wayland + jp # lightweight and flexible cli JSON parser ]; # fonts diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index 5128c00..b4cd0c1 100755 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -4,6 +4,7 @@ # every import imports a specific module for an app. This module contains the enabling of this app and its settings. # So if you want to add an home-manager app create a module which enables it and configures it and import it. imports = [ +# app modules ../../modules/home-manager/kitty.nix # terminal # use absolute path with --impure flag or go back to /etc/nixos and use relative ../../modules/home-manager/zoxide.nix # better cd ../../modules/home-manager/zsh.nix # better bash @@ -33,6 +34,9 @@ home.stateVersion = "25.11"; # Please read the comment before changing. # The home.packages option allows you to install Nix packages into your # environment. home.packages = [ +#scritps +(pkgs.callPackage ./modules/scripts/dontkillsteam.nix {}) + # # Adds the 'hello' command to your environment. It prints a friendly # # "Hello, world!" when run. # pkgs.hello diff --git a/modules/home-manager/hyprland.nix b/modules/home-manager/hyprland.nix index dbc0286..1ab6db7 100644 --- a/modules/home-manager/hyprland.nix +++ b/modules/home-manager/hyprland.nix @@ -14,7 +14,7 @@ "$term" = "kitty"; "$editor" = "nvim"; "$file" = "nautilius"; - "$browser" = "firefox" # change to librewolf later + "$browser" = "firefox"; # change to librewolf later # ▄▀█ █▄░█ █ █▀▄▀█ ▄▀█ ▀█▀ █ █▀█ █▄░█ # █▀█ █░▀█ █ █░▀░█ █▀█ ░█░ █ █▄█ █░▀█ @@ -37,7 +37,12 @@ # █ █▄░█ █▀█ █░█ ▀█▀ # █ █░▀█ █▀▀ █▄█ ░█░ -# is it needed? Doesnt nixos already handles that? + input = { + kb_layout = [ "ch" ]; + follow_mouse = 1; + sensitivity = 0; + force_no_accel = 1; + }; # █▄▀ █▀▀ █▄█ █▄▄ █ █▄░█ █▀▄ █ █▄░█ █▀▀ █▀ # █░█ ██▄ ░█░ █▄█ █ █░▀█ █▄▀ █ █░▀█ █▄█ ▄█ @@ -76,7 +81,7 @@ "$mod+Shift, 9, movetoworkspace, 9" "$mod+Shift, 0, movetoworkspace, 10" "$mod+Ctrl+Alt, Right, movetoworkspace, r+1" - "$mod+Ctrl+Alt, Left, movetoworkspacem r-1" + "$mod+Ctrl+Alt, Left, movetoworkspace, r-1" "$mod, Backspace, exec, wlogout -b 5 -T 600 -B 600" "$mod+Shift+Ctrl, Left, movewindow, l" "$mod+Shift+Ctrl, Right, movewindow, r" @@ -136,6 +141,14 @@ # █▀▄▀█ █ █▀ █▀▀ # █░▀░█ █ ▄█ █▄▄ + misc = { + vrr = 0; + force_default_wallpaper = 0; + }; + xwayland = { + force_zero_scaling = true; + }; + # █▀▄▀█ █▀█ █▄░█ █ ▀█▀ █▀█ █▀█ # █░▀░█ █▄█ █░▀█ █ ░█░ █▄█ █▀▄ monitor = [ diff --git a/modules/scripts/dontkillsteam.nix b/modules/scripts/dontkillsteam.nix new file mode 100644 index 0000000..1df0f54 --- /dev/null +++ b/modules/scripts/dontkillsteam.nix @@ -0,0 +1,17 @@ +{ writeShellApplication, hyprland, jq, ... }: + +writeShellApplication { + name = "custom-dontkillsteam"; + runtimeInputs = [ + hyprland + jq + ]; + text = '' + if [[ $(hyprctl activewindow -j | jq -r ".class") == "Steam" ]]; then + hyprctl dispatch minimize + else + hyprctl dispatch killactive "" + fi + + ''; +}