The big variable overhaul

This commit is contained in:
Jimbo 2024-09-23 16:22:01 -04:00
parent 3f0a235dc8
commit 6dab8fc029
36 changed files with 269 additions and 326 deletions

View file

@ -1,10 +1,7 @@
{pkgs, ...}: {
{pkgs, outputs, ...}: {
home.packages = let
# Use grim and slurp to take screenshots in multiple ways
swayShot = let
border = import ../common/border.nix;
colors = import ../common/colors.nix;
in pkgs.writeScriptBin "swayshot" ''
swayShot = pkgs.writeScriptBin "swayshot" ''
# Swappy
handle_swappy() {
# Create an imv window to act as a static screen
@ -12,7 +9,7 @@
# Capture the screenshot of the selected area and save to a temporary file
selected_area=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"'\
| XCURSOR_SIZE=40 slurp -w ${border.weight} -c ${colors.prime} -B 00000066 -b 00000099)
| XCURSOR_SIZE=40 slurp -w ${outputs.look.border.string} -c ${outputs.look.colors.prime} -B 00000066 -b 00000099)
temp_file=$(mktemp -u).png
grim -g "$selected_area" "$temp_file"