diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 0a7b5c7..587303d 100755 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -140,7 +140,9 @@ services.upower.enable = true; wl-clipboard # cli copy/past utilities for Wayland jp # lightweight and flexible cli JSON parser notepad-next - #we need to install gnome and kde utils individually as we dont use gnome + libnotify # Library that sends desktop notifications to a notification daemon + ripgrep #better grepp +#we need to install gnome and kde utils individually as we dont use gnome gnome-calculator snapshot gnome-characters diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index b73a29e..4c08e6f 100755 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -38,6 +38,7 @@ home.packages = [ #scritps (pkgs.callPackage ../../modules/scripts/dontkillsteam.nix {}) (pkgs.callPackage ../../modules/scripts/batterynotify.nix {}) +(pkgs.callPackage ../../modules/scripts/cliphist.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 967fbd9..a607e98 100644 --- a/modules/home-manager/hyprland.nix +++ b/modules/home-manager/hyprland.nix @@ -134,6 +134,7 @@ "nm-applet --indicator" # systray app for Network/wifi "wl-paste --type text --watch cliphist store" # clipboard store text data "wl-paste --type image --watch cliphist store" # clipboard store image data + "custom-batterynotify" ]; # █░░ ▄▀█ █▄█ █▀█ █░█ ▀█▀ █▀ # █▄▄ █▀█ ░█░ █▄█ █▄█ ░█░ ▄█ diff --git a/modules/home-manager/swaync.nix b/modules/home-manager/swaync.nix index 39d7af7..83ae19b 100644 --- a/modules/home-manager/swaync.nix +++ b/modules/home-manager/swaync.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: { - programs.swaync = { + services.swaync = { enable = true; }; } diff --git a/modules/scripts/batterynotify.nix b/modules/scripts/batterynotify.nix index ef14f48..3ebab02 100644 --- a/modules/scripts/batterynotify.nix +++ b/modules/scripts/batterynotify.nix @@ -44,7 +44,6 @@ writeShellApplication { while true; do get_info - state="$status-$percentage" if [[ "$status" == "Discharging" && "$percentage" -le "$CRITICAL" ]]; then notify critical "Battery Critically Low" "$percentage% — suspending." diff --git a/modules/scripts/cliphist.nix b/modules/scripts/cliphist.nix new file mode 100644 index 0000000..8e2154c --- /dev/null +++ b/modules/scripts/cliphist.nix @@ -0,0 +1,50 @@ +{ 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 + ''; +}