diff --git a/docs/usage/readme.md b/docs/usage/readme.md index b3b473f..1c1a30e 100644 --- a/docs/usage/readme.md +++ b/docs/usage/readme.md @@ -33,14 +33,15 @@ Other usefull utilities: `mainMod = SUPER` -| applications | | -| -------------| -------------------- | -| mM + enter | terminal | -| mM + C | clipboard manager | -| mM + D | application launcher | -| mM + E | file manager | -| mM + L | lock screen | -| mM + S | take screenshot | +| applications | | +| --------------| -------------------- | +| mM + enter | terminal | +| mM + C | clipboard manager | +| mM + D | application launcher | +| mM + E | file manager | +| mM + L | lock screen | +| mM + S | take area screenshot | +| ALT SHIFT + S | take full screenshot | | focus | | diff --git a/hyprland/conf.d/bindings.conf b/hyprland/conf.d/bindings.conf index ee1c0f4..b41986a 100644 --- a/hyprland/conf.d/bindings.conf +++ b/hyprland/conf.d/bindings.conf @@ -18,7 +18,8 @@ bind = $mainMod, M, exit, bind = $mainMod, N, exec, alacritty --class nmtui --command ~/.dotfiles/hyprland/nmtui.sh bind = $mainMod, P, pseudo bind = $mainMod, Q, killactive -bind = $mainMod, S, exec, $screenshot +bind = $mainMod, S, exec, ~/.dotfiles/screenshot/screenshot.sh area +bind = ALT SHIFT, S, exec, ~/.dotfiles/screenshot/screenshot.sh screen bind = $mainMod, T, exec, alacritty --class nostt --command nostt bind = $mainMod, V, togglefloating diff --git a/hyprland/conf.d/variables.conf b/hyprland/conf.d/variables.conf deleted file mode 100644 index a7d0f52..0000000 --- a/hyprland/conf.d/variables.conf +++ /dev/null @@ -1,8 +0,0 @@ -# variables - -# screenshot -$screenshot = grimblast --notify save area - | \ - satty \ - --filename - \ - --fullscreen \ - --output-filename ~/Pictures/Screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png diff --git a/hyprland/hyprland.conf b/hyprland/hyprland.conf index 2c9e29e..b53adad 100644 --- a/hyprland/hyprland.conf +++ b/hyprland/hyprland.conf @@ -1,4 +1,3 @@ -source = ~/.dotfiles/hyprland/conf.d/variables.conf # set variables source = ~/.dotfiles/hyprland/conf.d/executions.conf # app executions source = ~/.dotfiles/hyprland/conf.d/general.conf # general hyprland source = ~/.dotfiles/hyprland/conf.d/graphics.conf # graphics section diff --git a/screenshot/screenshot.sh b/screenshot/screenshot.sh new file mode 100755 index 0000000..a1d1fb9 --- /dev/null +++ b/screenshot/screenshot.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env zsh + +# screenshot function for an area +screenshot_area () { + grimblast \ + --notify save area - | \ + satty \ + --filename - \ + --fullscreen \ + --output-filename ~/Pictures/Screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png +} + +# screenshot function for full screen +screenshot_screen () { + grimblast \ + --notify save screen - | \ + satty \ + --filename - \ + --fullscreen \ + --output-filename ~/Pictures/Screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png +} + +# main function +case $1 in + area) + screenshot_area + ;; + screen) + screenshot_screen + ;; + *) + echo "Usage: $0 {area|screen}" + exit 1 + ;; +esac