added cliphist script

This commit is contained in:
Tomas Rivera
2026-02-26 18:30:55 +01:00
parent 0fb41b8041
commit 321fe30583
6 changed files with 56 additions and 3 deletions
+3 -1
View File
@@ -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
+1
View File
@@ -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
+1
View File
@@ -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"
];
# █░░ ▄▀█ █▄█ █▀█ █░█ ▀█▀ █▀
# █▄▄ █▀█ ░█░ █▄█ █▄█ ░█░ ▄█
+1 -1
View File
@@ -1,7 +1,7 @@
{ config, pkgs, ... }:
{
programs.swaync = {
services.swaync = {
enable = true;
};
}
-1
View File
@@ -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."
+50
View File
@@ -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
'';
}