Fixed screenshot save location

Screenshots should have been saved to a screenshots directory in my home
directory instead of to a literal `~/screenshots` file.
This commit is contained in:
Alejandro Angulo 2023-09-09 14:02:35 -07:00
parent 1928c36431
commit 1f44933617
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6

View file

@ -19,6 +19,8 @@ with lib; let
# generic.
menu = "rofi -show run";
terminal = "alacritty";
generate_grimshot_command = target: ''exec mkdir -p ~/screenshots && ${pkgs.sway-contrib.grimshot}/bin/grimshot --notify save ${target} ~/screenshots/"$(date -u --iso-8601=seconds)".png'';
in {
options.aa.desktop.sway = with types; {
enable = mkEnableOption "sway";
@ -279,16 +281,16 @@ in {
# Screenshots
## Current window
"${modifier}+period" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot --notify save active ~/screenshots";
"${modifier}+period" = generate_grimshot_command "active";
## Area selection
"${modifier}+Shift+period" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot --notify save area ~/screenshots";
"${modifier}+Shift+period" = generate_grimshot_command "area";
## Current output
"${modifier}+Alt+period" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot --notify save output ~/screenshots";
"${modifier}+Alt+period" = generate_grimshot_command "output";
## Window selection
"${modifier}+Ctrl+period" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot --notify save window ~/screenshots";
"${modifier}+Ctrl+period" = generate_grimshot_command "window";
# Scratchpad
# Move the currently focused window to the scratchpad