From 45e2fb72024dc4f4d349e213a585acc91c38b710 Mon Sep 17 00:00:00 2001 From: KoenDR06 Date: Fri, 25 Apr 2025 14:02:28 +0200 Subject: [PATCH] changes idk --- flake.lock | 21 +++++++------ flake.nix | 4 +-- modules/apps/visual.nix | 2 +- modules/network/syncthing.nix | 2 +- .../wm/hyprland/config/eww/eww_variables.yuck | 11 +++++-- .../wm/hyprland/config/eww/eww_widgets.yuck | 10 +++---- .../hyprland/config/eww/images/wifi-off.svg | 4 +-- .../wm/hyprland/config/eww/scripts/volume.sh | 2 +- .../wm/hyprland/config/eww/scripts/wifi.sh | 30 +++++++++++++++++++ modules/wm/hyprland/config/hypr/hyprland.conf | 1 - modules/wm/hyprland/config/hypr/keybinds.conf | 1 + modules/wm/hyprland/default.nix | 19 ++++++------ 12 files changed, 70 insertions(+), 37 deletions(-) create mode 100755 modules/wm/hyprland/config/eww/scripts/wifi.sh diff --git a/flake.lock b/flake.lock index 0b85281..047ace7 100644 --- a/flake.lock +++ b/flake.lock @@ -7,32 +7,31 @@ ] }, "locked": { - "lastModified": 1744117652, - "narHash": "sha256-t7dFCDl4vIOOUMhEZnJF15aAzkpaup9x4ZRGToDFYWI=", + "lastModified": 1745555634, + "narHash": "sha256-lhVyVn1utb2UVTbyKJ6mfKB7wLTjrj14OlebvO0WU2s=", "owner": "nix-community", "repo": "home-manager", - "rev": "b4e98224ad1336751a2ac7493967a4c9f6d9cb3f", + "rev": "98f4fef7fd7b4a77245db12e33616023162bc6d9", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-24.11", "repo": "home-manager", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1744440957, - "narHash": "sha256-FHlSkNqFmPxPJvy+6fNLaNeWnF1lZSgqVCl/eWaJRc4=", + "lastModified": 1745391562, + "narHash": "sha256-sPwcCYuiEopaafePqlG826tBhctuJsLx/mhKKM5Fmjo=", "owner": "nixos", "repo": "nixpkgs", - "rev": "26d499fc9f1d567283d5d56fcf367edd815dba1d", + "rev": "8a2f738d9d1f1d986b5a4cd2fd2061a7127237d7", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-24.11", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -75,11 +74,11 @@ ] }, "locked": { - "lastModified": 1744669848, - "narHash": "sha256-pXyanHLUzLNd3MX9vsWG+6Z2hTU8niyphWstYEP3/GU=", + "lastModified": 1745310711, + "narHash": "sha256-ePyTpKEJTgX0gvgNQWd7tQYQ3glIkbqcW778RpHlqgA=", "owner": "Mic92", "repo": "sops-nix", - "rev": "61154300d945f0b147b30d24ddcafa159148026a", + "rev": "5e3e92b16d6fdf9923425a8d4df7496b2434f39c", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 7c008a4..0aa00f2 100644 --- a/flake.nix +++ b/flake.nix @@ -1,9 +1,9 @@ { inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; home-manager = { - url = "github:nix-community/home-manager/release-24.11"; + url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; diff --git a/modules/apps/visual.nix b/modules/apps/visual.nix index ba29f38..f3b94c4 100644 --- a/modules/apps/visual.nix +++ b/modules/apps/visual.nix @@ -31,7 +31,7 @@ in { krita libreoffice mullvad-vpn - okular + zathura parsec-bin qbittorrent reaper diff --git a/modules/network/syncthing.nix b/modules/network/syncthing.nix index 27184b3..d8300fc 100644 --- a/modules/network/syncthing.nix +++ b/modules/network/syncthing.nix @@ -22,7 +22,7 @@ in { dataDir = "/home/horseman"; configDir = "/home/horseman/.config/syncthing"; overrideDevices = true; - overrideFolders = true; + # overrideFolders = true; settings = { options = { urAccepted = -1; diff --git a/modules/wm/hyprland/config/eww/eww_variables.yuck b/modules/wm/hyprland/config/eww/eww_variables.yuck index bfb8fc0..1e73737 100644 --- a/modules/wm/hyprland/config/eww/eww_variables.yuck +++ b/modules/wm/hyprland/config/eww/eww_variables.yuck @@ -1,6 +1,6 @@ (defvar hostname "") -(defpoll quote_text :interval "3600s" `fortune -n 90 -s`) +(defpoll quote_text :interval "3600s" `hyprctl splash`) (defpoll gpu_load :interval "1s" `gpustat --json | jq '.gpus[]."utilization.gpu"'`) @@ -36,8 +36,15 @@ (defpoll distro :interval "12h" `nixos-version | sed -r 's/^(.....).*?\\((.*?)\\)/NixOS \\1/'`) (defpoll sound - :interval "1s" + :interval ".25s" :initial-value "images/sound-lo.svg" `./scripts/volume.sh` ) + +(defpoll wifi + :interval "1s" + :initial-value "images/ethernet.svg" + + `./scripts/wifi.sh` +) diff --git a/modules/wm/hyprland/config/eww/eww_widgets.yuck b/modules/wm/hyprland/config/eww/eww_widgets.yuck index fb10b50..383b81f 100644 --- a/modules/wm/hyprland/config/eww/eww_widgets.yuck +++ b/modules/wm/hyprland/config/eww/eww_widgets.yuck @@ -9,21 +9,19 @@ (box :class "label" label) (scale :min 0 :max 101 :active {onchange != ""} :value value :onchange onchange))) -;;;; Background Black Holder Widget - (defwidget power [] (centerbox :class "bg-box" (box :orientation "h" :space-evenly false :valign "center" :halign "start" :spacing 5 - (button :onclick "kitty -T 'confirm-script' ~/.config/eww/scripts/confirm.sh 'shutdown now' &" (image :path "images/shutdown.svg")) - (button :onclick "kitty -T 'confirm-script' ~/.config/eww/scripts/confirm.sh 'reboot' &" (image :path "images/reboot.svg")) - (button :onclick "hyprlock" (image :path "images/lock.svg")) + (button :onclick "shutdown now &" (image :path "images/shutdown.svg")) + (button :onclick "reboot &" (image :path "images/reboot.svg")) + (button :onclick "hyprlock &" (image :path "images/lock.svg")) ) "" (box :orientation "h" :space-evenly false :valign "center" :halign "end" :spacing 5 (button :onclick "kitty pulsemixer &" (image :path {sound} )) - (button :onclick "" (image :path "images/ethernet.svg")) + (button :onclick "" (image :path {wifi})) ) ) ) diff --git a/modules/wm/hyprland/config/eww/images/wifi-off.svg b/modules/wm/hyprland/config/eww/images/wifi-off.svg index 0b6b816..f604ddf 100644 --- a/modules/wm/hyprland/config/eww/images/wifi-off.svg +++ b/modules/wm/hyprland/config/eww/images/wifi-off.svg @@ -1,7 +1,7 @@ - + - \ No newline at end of file + diff --git a/modules/wm/hyprland/config/eww/scripts/volume.sh b/modules/wm/hyprland/config/eww/scripts/volume.sh index 3f018e1..6c1c7ff 100755 --- a/modules/wm/hyprland/config/eww/scripts/volume.sh +++ b/modules/wm/hyprland/config/eww/scripts/volume.sh @@ -7,7 +7,7 @@ if (( $volume == 0 )); then exit 0 fi -if (( $volume < 20 )); then +if (( $volume < 50 )); then echo 'images/sound-lo.svg' exit 0 fi diff --git a/modules/wm/hyprland/config/eww/scripts/wifi.sh b/modules/wm/hyprland/config/eww/scripts/wifi.sh new file mode 100755 index 0000000..91e1aa7 --- /dev/null +++ b/modules/wm/hyprland/config/eww/scripts/wifi.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +strength=$(($(iwconfig wlo1 | grep 'Link Quality' | sed -r 's/.*?Link Quality=(.*?)\/.*$/\1/'))) +lines=$(($(iwconfig wlo1 | grep 'Link Quality' | sed -r 's/.*?Link Quality=(.*?)\/.*$/\1/' | wc -l))) + +if (( $lines == 0 )); then + echo 'images/wifi-off.svg' + exit 0 +fi + +if (( $strength < 18 )); then + echo 'images/wifi-1.svg' + exit 0 +fi + +if (( $strength < 35 )); then + echo 'images/wifi-2.svg' + exit 0 +fi + +if (( $strength < 53 )); then + echo 'images/wifi-3.svg' + exit 0 +fi + +if (( $strength < 70 )); then + echo 'images/wifi-4.svg' + exit 0 +fi + diff --git a/modules/wm/hyprland/config/hypr/hyprland.conf b/modules/wm/hyprland/config/hypr/hyprland.conf index 1918f95..5d56fc3 100644 --- a/modules/wm/hyprland/config/hypr/hyprland.conf +++ b/modules/wm/hyprland/config/hypr/hyprland.conf @@ -195,4 +195,3 @@ windowrulev2 = suppressevent maximize, class:.* # Fix some dragging issues with XWayland windowrulev2 = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0 -windowrule = fullscreen, title:confirm-script diff --git a/modules/wm/hyprland/config/hypr/keybinds.conf b/modules/wm/hyprland/config/hypr/keybinds.conf index c7f3de7..efe6190 100644 --- a/modules/wm/hyprland/config/hypr/keybinds.conf +++ b/modules/wm/hyprland/config/hypr/keybinds.conf @@ -49,6 +49,7 @@ bind = CONTROL&$mainMod, right, workspace, e+1 bind = CONTROL&$mainMod, left, workspace, e-1 bindm = $mainMod,mouse:272, movewindow +bindm = $mainMod SHIFT,mouse:272, resizewindow bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+ bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%- diff --git a/modules/wm/hyprland/default.nix b/modules/wm/hyprland/default.nix index ce50780..b6fb7ed 100644 --- a/modules/wm/hyprland/default.nix +++ b/modules/wm/hyprland/default.nix @@ -23,20 +23,19 @@ in { security.polkit.enable = true; environment.systemPackages = with pkgs; [ + brightnessctl eww - nerdfonts + fortune + hyprlock + hyprshot + jq networkmanagerapplet + playerctl + pulsemixer + python312Packages.gpustat + swaybg wofi xdg-desktop-portal-hyprland - playerctl - hyprlock - brightnessctl - swaybg - jq - fortune - python312Packages.gpustat - hyprshot - pulsemixer ]; services.logind.extraConfig = ''