Skip to content

Commit

Permalink
[hypr] define screenshots script as a shell app
Browse files Browse the repository at this point in the history
  • Loading branch information
ejiek committed Oct 23, 2023
1 parent 39d4566 commit b3b4de0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
28 changes: 12 additions & 16 deletions modules/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,24 @@ in {
home-manager.users.ejiek = {
home.packages = with pkgs; [
brightnessctl
grim # take screenshots
hyprland-per-window-layout
hyprpaper
hyprpicker
notify-desktop
pulsemixer
slurp # Select a region in a Wayland compositor | used for screenshots
swaylock
swaynotificationcenter
wireplumber
wl-clipboard
xdg-utils
(writeShellApplication {
name = "hypr-screenshot";
runtimeInputs = [
slurp # Select a region in a Wayland compositor | used for screenshots
grim # take screenshots
];
text = (builtins.readFile ./screenshot.sh);
})
];

home.sessionVariables = {
Expand Down Expand Up @@ -280,10 +286,10 @@ in {
"$mainMod ALT, P, exec, hyprpicker --autocopy --no-fancy"

# Screenshots
"$mainMod, S, exec, TO_FILE=false FULL_SCREEN=true ~/.config/hypr/screenshot.sh"
"$mainMod ALT, S, exec, TO_FILE=true FULL_SCREEN=true ~/.config/hypr/screenshot.sh"
"$mainMod SHIFT, S, exec, TO_FILE=false FULL_SCREEN=false ~/.config/hypr/screenshot.sh"
"$mainMod SHIFT ALT, S, exec, TO_FILE=true FULL_SCREEN=false ~/.config/hypr/screenshot.sh"
"$mainMod, S, exec, TO_FILE=false FULL_SCREEN=true hypr-screenshot"
"$mainMod ALT, S, exec, TO_FILE=true FULL_SCREEN=true hypr-screenshot"
"$mainMod SHIFT, S, exec, TO_FILE=false FULL_SCREEN=false hypr-screenshot"
"$mainMod SHIFT ALT, S, exec, TO_FILE=true FULL_SCREEN=false hypr-screenshot"

# Notifications
"$mainMod, N, exec, swaync-client --toggle-panel"
Expand Down Expand Up @@ -319,16 +325,6 @@ in {
'';
};

#home.activation.screenshotActication = home-manager.dag.entryAfter ["WriteBoundary"] ''
# chmod +x ~/.config/hypr/screenshot.sh
#'';

home.file = {
"wl-screenshot" = {
target = ".config/hypr/screenshot.sh";
source = ./screenshot.sh;
};
};
};
};
}
2 changes: 0 additions & 2 deletions modules/hyprland/screenshot.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env bash

# Takes a screenshot in four different ways
# Behavior is determined by defining the following environmental variables
#
Expand Down

0 comments on commit b3b4de0

Please sign in to comment.