Added screenshots module
This commit is contained in:
31
modules/desktop/tools/screenshot.nix
Normal file
31
modules/desktop/tools/screenshot.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.samfelag.modules.desktop.tools.screenshot;
|
||||
hyprCfg = config.samfelag.modules.desktop.wm.hyprland;
|
||||
in
|
||||
{
|
||||
options.samfelag.modules.desktop.tools.screenshot = {
|
||||
enable = mkEnableOption "Screenshot utilities";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
# - Screenshot utilities ---------------------
|
||||
environment.systemPackages = [
|
||||
pkgs.slurp # to select the region
|
||||
pkgs.grim # actual screenshot program
|
||||
];
|
||||
|
||||
# - Hyprland keybindings ---------------------
|
||||
hm.wayland.windowManager.hyprland.settings = lib.mkIf hyprCfg.enable {
|
||||
bind = [
|
||||
# Screenshots
|
||||
"${hyprCfg.mod}, s, exec, $HOME/.config/grapheio/scripts/screenshot.sh region"
|
||||
"${hyprCfg.mod}, SHIFT s, exec, $HOME/.config/grapheio/scripts/screenshot.sh screen"
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user