This is a fork of the original Hyprshot tool by Gustash with minor adjustments to run on FreeBSD. Changes are quite hard-coded but it works on my machine... (FreeBSD 15)
It basically addresses this issue: Gustash#74 regarding getopt and the mentioned checkRunning function.
Hyprshot is an utility to easily take screenshot in Hyprland using your mouse.
It allows taking screenshots of windows, regions and monitors which are saved to a folder of your choosing and copied to your clipboard.
- hyprland (this one should be obvious)
- jq (to parse and manipulate json)
- grim (to take the screenshot)
- slurp (to select what to screenshot)
- wl-clipboard (to copy screenshot to clipboard)
- libnotify (to get notified when a screenshot is saved)
- getopt (GNU version installed to /usr/local/bin/getopt via pkg install misc/getopt)
- hyprpicker (to freeze the screen contents with the
--freezeflag)
To install manually, simply clone this repo and copy/symlink the hyprshot script to a folder in your PATH:
$ git clone https://github.com/sven-junga/HyprshotBSD.git Hyprshot
$ ln -s $(pwd)/Hyprshot/hyprshot $HOME/.local/bin
$ chmod +x Hyprshot/hyprshotYou can get help on how to use hyprshot by executing:
$ hyprshot -hThe simplest usage of Hyprshot is executing it with one of the available modes.
For example, to screenshot an open window:
$ hyprshot -m windowYou can also skip saving the screenshot to a file, copying it only to the clipboard:
$ hyprshot -m output --clipboard-onlyYou can add the various modes as keybindings in your Hyprland config like so:
# ~/.config/hypr/hyprland.conf
...
# Screenshot a window
bind = $mainMod, PRINT, exec, hyprshot -m window
# Screenshot a monitor
bind = , PRINT, exec, hyprshot -m output
# Screenshot a region
bind = $shiftMod, PRINT, exec, hyprshot -m region
This would allow you to:
Take a screenshot of a window by using MOD + PrintScr
Take a screenshot of a monitor by using PrintScr
Take a screenshot of a region by using MOD + Shift + PrintScr
You can choose which directory Hyprshot will save screenshots in by setting an HYPRSHOT_DIR environment variable to your preferred location.
If HYPRSHOT_DIR is not set, Hyprshot will attempt to save to XDG_PICTURES_DIR and will further fallback to your home directory if this is also not available.