Ver 1.1.2 - Screenshot tool
This commit is contained in:
parent
f1c92fff74
commit
372dd84f8b
5 changed files with 88 additions and 1 deletions
|
|
@ -9,6 +9,7 @@
|
||||||
./hyprland
|
./hyprland
|
||||||
./waybar
|
./waybar
|
||||||
./wofi
|
./wofi
|
||||||
|
./grim
|
||||||
./hyprpaper
|
./hyprpaper
|
||||||
./eww
|
./eww
|
||||||
./hyprlock
|
./hyprlock
|
||||||
|
|
|
||||||
6
nixosVista/homeManager/grim/default.nix
Normal file
6
nixosVista/homeManager/grim/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./option.nix
|
||||||
|
./main.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
71
nixosVista/homeManager/grim/main.nix
Normal file
71
nixosVista/homeManager/grim/main.nix
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
nixosVista,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
config = lib.mkIf nixosVista.enable {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
grim
|
||||||
|
slurp
|
||||||
|
wl-clipboard
|
||||||
|
swappy
|
||||||
|
jq
|
||||||
|
];
|
||||||
|
|
||||||
|
############################################################
|
||||||
|
# Screenshot Script
|
||||||
|
############################################################
|
||||||
|
|
||||||
|
home.file.".local/bin/hyprshot" = {
|
||||||
|
executable = true;
|
||||||
|
text = ''
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
DIR="$HOME/Pictures/Screenshots/$(date +%Y_%m_%b)"
|
||||||
|
FILE="$(date +%d_%a__%H-%M-%S)-$(tr -dc a-z0-9 </dev/urandom | head -c6).png"
|
||||||
|
|
||||||
|
mkdir -p "$DIR"
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
monitor)
|
||||||
|
MON=$(hyprctl monitors -j | jq -r ".[] | select(.focused==true).name")
|
||||||
|
grim -o "$MON" "$DIR/$FILE"
|
||||||
|
;;
|
||||||
|
region)
|
||||||
|
grim -g "$(slurp)" "$DIR/$FILE"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
grim "$DIR/$FILE"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
wl-copy < "$DIR/$FILE"
|
||||||
|
|
||||||
|
if [ "$2" = "edit" ]; then
|
||||||
|
swappy -f "$DIR/$FILE"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
############################################################
|
||||||
|
# Hyprland Binds
|
||||||
|
############################################################
|
||||||
|
|
||||||
|
nixosVista.hyprland.fragments.internalScreenshot = ''
|
||||||
|
############################################################
|
||||||
|
# Screenshot
|
||||||
|
############################################################
|
||||||
|
|
||||||
|
# $mainMod+S → current monitor → copy
|
||||||
|
bind = $mainMod, S, exec, ~/.local/bin/hyprshot monitor
|
||||||
|
|
||||||
|
# $mainMod+SHIFT+S → region → copy
|
||||||
|
bind = $mainMod SHIFT, S, exec, ~/.local/bin/hyprshot region
|
||||||
|
|
||||||
|
# $mainMod+PRINT → monitor → edit in swappy
|
||||||
|
bind = $mainMod, Print, exec, ~/.local/bin/hyprshot monitor edit
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
9
nixosVista/homeManager/grim/option.nix
Normal file
9
nixosVista/homeManager/grim/option.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
nixosVista,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = nixosVista.hyprland;
|
||||||
|
in {
|
||||||
|
}
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
(get "animation")
|
(get "animation")
|
||||||
(get "keybinds")
|
(get "keybinds")
|
||||||
(get "windowRules")
|
(get "windowRules")
|
||||||
(get "internalClipboard")
|
(get "internalScreenshot")
|
||||||
(get "customBottom")
|
(get "customBottom")
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue