My personal dotfiles
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: added screenshot keys to hyprland

+48
+4
hypr/.config/hypr/hyprland/keybinds.conf
··· 29 29 bindel = ,XF86MonBrightnessUp, exec, .config/hypr/scripts/overlay.sh brightness up 30 30 bindel = ,XF86MonBrightnessDown, exec, .config/hypr/scripts/overlay.sh brightness down 31 31 32 + # Screenshot keys 33 + bindel = ,Print, exec, .config/hypr/scripts/screenshot.sh -f 34 + bind = $mainMod SHIFT, S, .config/hypr/scripts/screenshot.sh -s 35 + 32 36 # Application binds 33 37 bind = $mainMod, return, exec, $terminal 34 38 bind = $mainMod, space, exec, $menu
+44
hypr/.config/hypr/scripts/screenshot.sh
··· 1 + #!/bin/bash 2 + 3 + Help() { 4 + echo "This script is a simple frontend to use grim and slurp in a more simplistic way." 5 + echo 6 + echo "Syntax: screenshot [-s|f|h]" 7 + echo "options:" 8 + echo "s Select a portion of the screen and take a screenshot." 9 + echo "f Screenshot the full screen." 10 + echo "h Display this help message." 11 + echo 12 + } 13 + 14 + if [ $# -eq 0 ]; then 15 + Help 16 + exit 17 + 18 + fi 19 + 20 + if [ ! -d $HOME/Pictures/screenshots ]; then 21 + mkdir -p $HOME/Pictures/screenshots 22 + fi 23 + 24 + SCREENSHOT_DATE=$(date +'%Y-%m-%d_%H.%M.%S') 25 + SCREENSHOT_PATH="$HOME/Pictures/screenshots/$SCREENSHOT_DATE.png" 26 + 27 + while getopts ":hfs" option; do 28 + case $option in 29 + h) # displays help 30 + Help 31 + exit;; 32 + f) # screenshot full screen 33 + grim $SCREENSHOT_PATH 34 + notify-send -i $SCREENSHOT_PATH "Screenshot" "New screenshot saved as $SCREENSHOT_DATE.png" 35 + exit;; 36 + s) # select a portion and screenshot 37 + grim -g "$(slurp)" $SCREENSHOT_PATH 38 + notify-send -i $SCREENSHOT_PATH "Screenshot" "New screenshot saved as $SCREENSHOT_DATE" 39 + exit;; 40 + \?) # catchall 41 + Help 42 + exit;; 43 + esac 44 + done