mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-12 02:28:37 +02:00
added cliphist script
This commit is contained in:
@@ -140,6 +140,8 @@ services.upower.enable = true;
|
||||
wl-clipboard # cli copy/past utilities for Wayland
|
||||
jp # lightweight and flexible cli JSON parser
|
||||
notepad-next
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,7 +1,7 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.swaync = {
|
||||
services.swaync = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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."
|
||||
|
||||
@@ -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
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user