[screenshot] add full screenshot functionality

This commit is contained in:
Simon Cornet 2024-03-24 19:03:04 +01:00
parent b2986a0027
commit 48d89c1846
5 changed files with 46 additions and 18 deletions

View File

@ -34,13 +34,14 @@ 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 |
| mM + S | take area screenshot |
| ALT SHIFT + S | take full screenshot |
| focus | |

View File

@ -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

View File

@ -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

View File

@ -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

35
screenshot/screenshot.sh Executable file
View File

@ -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