From 09379e898b0ae67888563841ec4661601f570ead Mon Sep 17 00:00:00 2001 From: Tomas Rivera <137088692+Totorile1@users.noreply.github.com> Date: Thu, 26 Feb 2026 18:53:36 +0100 Subject: [PATCH] added weather script --- hosts/laptop/configuration.nix | 1 + hosts/laptop/home.nix | 2 +- modules/home-manager/hyprland.nix | 2 ++ modules/scripts/cliphist.nix | 50 ------------------------------- modules/scripts/weather.nix | 11 +++++++ 5 files changed, 15 insertions(+), 51 deletions(-) delete mode 100644 modules/scripts/cliphist.nix create mode 100644 modules/scripts/weather.nix diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 587303d..a335129 100755 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -142,6 +142,7 @@ services.upower.enable = true; notepad-next libnotify # Library that sends desktop notifications to a notification daemon ripgrep #better grepp + hyprkeys # keybind helper #we need to install gnome and kde utils individually as we dont use gnome gnome-calculator snapshot diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index 4c08e6f..a5a7655 100755 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -38,7 +38,7 @@ home.packages = [ #scritps (pkgs.callPackage ../../modules/scripts/dontkillsteam.nix {}) (pkgs.callPackage ../../modules/scripts/batterynotify.nix {}) -(pkgs.callPackage ../../modules/scripts/cliphist.nix {}) +(pkgs.callPackage ../../modules/scripts/weather.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 a607e98..130eabc 100644 --- a/modules/home-manager/hyprland.nix +++ b/modules/home-manager/hyprland.nix @@ -89,6 +89,8 @@ "$mod+Shift+Ctrl, Down, movewindow, d" "$mod, mouse_down, workspace, e+1" "$mod, mouse_up, workspace, e-1" + "$mod, V, exec, cliphist list | rofi -dmenu| cliphist decode | wl-copy" # copy paste + "$mod, B, exec, hyprkeys -bkr | rofi -dmenu" #apps keybindings "$mod, T, exec, $term" "$mod, E, exec, $file" diff --git a/modules/scripts/cliphist.nix b/modules/scripts/cliphist.nix deleted file mode 100644 index 8e2154c..0000000 --- a/modules/scripts/cliphist.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ writeShellApplication -, cliphist -, rofi -, wl-clipboard -}: - -writeShellApplication { - name = "custom-cliphist"; - - runtimeInputs = [ - cliphist # clipboard manager - rofi # launcher menu - wl-clipboard # wl-copy - ]; - - text = '' - set -euo pipefail - - action="${1:-}" - - case "$action" in - c|-c|--copy) - cliphist list | - rofi -dmenu" | - cliphist decode | - wl-copy - ;; - - d|-d|--delete) - cliphist list | - rofi -dmenu" | - cliphist delete - ;; - - w|-w|--wipe) - if [[ "$(printf "Yes\nNo" | rofi -dmenu")" == "Yes" ]]; then - cliphist wipe - fi - ;; - - *) - echo "custom-cliphist [action]" - echo "c -c --copy : list and copy selected" - echo "d -d --delete : list and delete selected" - echo "w -w --wipe : wipe clipboard database" - exit 1 - ;; - esac - ''; -} diff --git a/modules/scripts/weather.nix b/modules/scripts/weather.nix new file mode 100644 index 0000000..41edbce --- /dev/null +++ b/modules/scripts/weather.nix @@ -0,0 +1,11 @@ +{ writeShellApplication, curl, ... }: + +writeShellApplication { + name = "custom-weather"; + runtimeInputs = [ + curl + ]; + text = '' + while true; do curl "https://wttr.in/Prangins?0&d&q&F&lang=fr"; sleep 7200; done + ''; +}