restore flake.lock nixvim issue

This commit is contained in:
Sam 2024-06-19 22:25:25 +01:00
parent 01d348c310
commit f630a57b43
6 changed files with 85 additions and 46 deletions

View File

@ -237,11 +237,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1718788307, "lastModified": 1718526747,
"narHash": "sha256-SqiOz0sljM0GjyQEVinPXQxaGcbOXw5OgpCWGPgh/vo=", "narHash": "sha256-sKrD/utGvmtQALvuDj4j0CT3AJXP1idOAq2p+27TpeE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "d7830d05421d0ced83a0f007900898bdcaf2a2ca", "rev": "0a7ffb28e5df5844d0e8039c9833d7075cdee792",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -258,11 +258,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1718526747, "lastModified": 1718141734,
"narHash": "sha256-sKrD/utGvmtQALvuDj4j0CT3AJXP1idOAq2p+27TpeE=", "narHash": "sha256-cA+6l8ZCZ7MXGijVuY/1f55+wF/RT4PlTR9+g4bx86w=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "0a7ffb28e5df5844d0e8039c9833d7075cdee792", "rev": "892f76bd0aa09a0f7f73eb41834b8a904b6d0fad",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -313,11 +313,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1718662658, "lastModified": 1717976995,
"narHash": "sha256-AKG7BsqtVWDlefgzyKz7vjaKTLi4+bmTSBhowbQoZtM=", "narHash": "sha256-u3HBinyIyUvL1+N816bODpJmSQdgn0Mbb8BprFw7kqo=",
"owner": "lnl7", "owner": "lnl7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "29b3096a6e283d7e6779187244cb2a3942239fdf", "rev": "315aa649ba307704db0b16c92f097a08a65ec955",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -430,11 +430,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1718530797, "lastModified": 1718318537,
"narHash": "sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU=", "narHash": "sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b60ebf54c15553b393d144357375ea956f89e9a9", "rev": "e9ee548d90ff586a6471b4ae80ae9cfcbceb3420",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -446,11 +446,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1718632497, "lastModified": 1718541509,
"narHash": "sha256-YtlyfqOdYMuu7gumZtK0Kg7jr4OKfHUhJkZfNUryw68=", "narHash": "sha256-TmC5TxW5WPAfmovDzi1hLe1i4qqND79s9SH9UOKcSvo=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c58b4a9118498c1055c5908a5bbe666e56abe949", "rev": "ba06293cdba1c94af9710024abf3b94cf8d76349",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -462,11 +462,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1718770573, "lastModified": 1718632497,
"narHash": "sha256-tnNrZhmle3RE6DtLFADO+nRy0QuzQp4ztVK0R4tUHSA=", "narHash": "sha256-YtlyfqOdYMuu7gumZtK0Kg7jr4OKfHUhJkZfNUryw68=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "31a131649c0bcd9d7d9b87786b3fbb54b4dbe6e0", "rev": "c58b4a9118498c1055c5908a5bbe666e56abe949",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -490,11 +490,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1718739916, "lastModified": 1718614971,
"narHash": "sha256-VgRcAEeS8/ZSZgcwg1hYltavagEo47ZsmR7cRZ6VbRY=", "narHash": "sha256-ID/Fvvd9Bz01gpm36mIfjoqXIknb2WkacSukW75cRNw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "0e93a59567d0850e54cea26b1b5c541a7182c7cf", "rev": "b822078ec1b2bbf666af767061e29575edc5ec05",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -505,11 +505,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1718789152, "lastModified": 1718649005,
"narHash": "sha256-ttxaX71LiQyTrrFzTPff/ku7E/V2kA3/GwQ/G8G/X7E=", "narHash": "sha256-1Aw+JgGQK6e9MZdV4cbO1d3GRvYRKbwOvmet5gSFwvE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "0b21cf66670516802886950379a292a34a797cbd", "rev": "d4bfad4cd8a5c44bb469f95f20e6eb4799145046",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -527,11 +527,11 @@
"treefmt-nix": "treefmt-nix_2" "treefmt-nix": "treefmt-nix_2"
}, },
"locked": { "locked": {
"lastModified": 1718745582, "lastModified": 1718647444,
"narHash": "sha256-TFlVP4YXg6n+MbP/Iv/RIwqvRKuV9KA1JAPihoFmPfo=", "narHash": "sha256-RzTDK86nI7yzSrOCYy+jPW+7LZigJm1WnFULNdOXblU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "poetry2nix", "repo": "poetry2nix",
"rev": "48e7ed4ef7832efa5a5558e573986c4128fc478f", "rev": "d3e889d71b028f61ff6a587cfe437bde16cf8ac1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -552,11 +552,11 @@
"treefmt-nix": "treefmt-nix_3" "treefmt-nix": "treefmt-nix_3"
}, },
"locked": { "locked": {
"lastModified": 1718745582, "lastModified": 1718647444,
"narHash": "sha256-TFlVP4YXg6n+MbP/Iv/RIwqvRKuV9KA1JAPihoFmPfo=", "narHash": "sha256-RzTDK86nI7yzSrOCYy+jPW+7LZigJm1WnFULNdOXblU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "poetry2nix", "repo": "poetry2nix",
"rev": "48e7ed4ef7832efa5a5558e573986c4128fc478f", "rev": "d3e889d71b028f61ff6a587cfe437bde16cf8ac1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -720,11 +720,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1718522839, "lastModified": 1718139168,
"narHash": "sha256-ULzoKzEaBOiLRtjeY3YoGFJMwWSKRYOic6VNw2UyTls=", "narHash": "sha256-1TZQcdETNdJMcfwwoshVeCjwWfrPtkSQ8y8wFX3it7k=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "68eb1dc333ce82d0ab0c0357363ea17c31ea1f81", "rev": "1cb529bffa880746a1d0ec4e0f5076876af931f1",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -24,6 +24,7 @@
./scripts/emoji-picker.nix ./scripts/emoji-picker.nix
./scripts/clipboard-save.nix ./scripts/clipboard-save.nix
./scripts/clipboard-recall.nix ./scripts/clipboard-recall.nix
./scripts/get-focused-monitor.nix
]; ];
home.packages = [ home.packages = [
@ -32,5 +33,6 @@
pkgs.dunst pkgs.dunst
pkgs.picom pkgs.picom
pkgs.sxhkd pkgs.sxhkd
pkgs.nsxiv
]; ];
} }

View File

@ -52,18 +52,22 @@
(writeShellScriptBin "clipboard-image-recall" '' (writeShellScriptBin "clipboard-image-recall" ''
# Script to view and select and output images in image clipboard dir to clipboard. # Script to view and select and output images in image clipboard dir to clipboard.
#!/bin/bash monitor_name=$(get-focused-monitor)
width=$(${xorg.xwininfo}/bin/xwininfo -root | grep Width | sed "s/^.*:\s//") monitor_info=$(xrandr | grep "$monitor_name")
height=$(${xorg.xwininfo}/bin/xwininfo -root | grep Height | sed "s/^.*:\s//")
width=$(echo $monitor_info | grep -oP '\d+x\d+' | cut -dx -f1)
height=$(echo $monitor_info | grep -oP '\d+x\d+' | cut -dx -f2)
scale_width=$(( $width/4 + $width/2 )) scale_width=$(( $width/4 + $width/2 ))
scale_height=$(( $height/4 + $height/2 )) scale_height=$(( $height/4 + $height/2 ))
if [ "$1" == "" ]; then if [ "$1" == "" ] || [ -f "$1" ]; then
echo "Please provide directory" notify-send -t 1000 "Clipboard Recall" "Directory not specified or missing."
exit 1 exit 1
fi fi
filesdir="$(find $1 -type f -printf '%T@ %p\n' | sort -rn | cut -d ' ' -f 2-)" filesdir="$(find $1 -type f -printf '%T@ %p\n' | sort -rn | cut -d ' ' -f 2-)"
[ "$filesdir" == "" ] && notify-send -t 1000 "Clipboard Recall" "No images in directory" && exit 1
output="$(echo "$filesdir" | ${nsxiv}/bin/nsxiv -tioq -g "$scale_width"x"$scale_height" -N nsxiv-float )" output="$(echo "$filesdir" | ${nsxiv}/bin/nsxiv -tioq -g "$scale_width"x"$scale_height" -N nsxiv-float )"
num_lines=$( echo "$output" | wc -l) num_lines=$( echo "$output" | wc -l)

View File

@ -0,0 +1,25 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writeShellScriptBin "get-focused-monitor" ''
# get the current cursor location into X and Y variables
eval $(xdotool getmouselocation --shell)
# compare mouse location to monitor coordinates
while IFS= read -r line; do
if [[ $line =~ " connected" ]]; then
display=$(echo "$line" | awk '{print $1}')
coords=$(echo "$line" | grep -oP "\d+x\d+" | tr 'x+' ' ')
read width height x_offset y_offset <<< $coords
if (( X >= x_offset && X <= width + x_offset )) && (( Y >= y_offset && Y <= height + y_offset )); then
echo "$display"
break
fi
fi
done < <(xrandr)
'')
];
}

View File

@ -30,6 +30,14 @@
dmenu.selfgcolor: #${config.colorScheme.colors.base00} dmenu.selfgcolor: #${config.colorScheme.colors.base00}
dmenu.selbgcolor: #${config.colorScheme.colors.base0B} dmenu.selbgcolor: #${config.colorScheme.colors.base0B}
Nsxiv.window.background: #${config.colorScheme.colors.base03}
Nsxiv.window.foreground: #${config.colorScheme.colors.base05}
Nsxiv.mark.foreground: #${config.colorScheme.colors.base08}
Nsxiv.bar.background: #${config.colorScheme.colors.base00}
Nsxiv.bar.foreground: #${config.colorScheme.colors.base05}
Nsxiv.bar.font: monospace:size=12
''; '';
}; };