feat(screenshots): add swappy, add screenshot scripts and keybindings
* Add [swappy](https://github.com/jtheoof/swappy) for handling screenshots. It's a nice Flameshot-like tool that allows adding simple annotations (drawing circles, arrows, text, etc) to screenshots and can save to file or pass to the clipboard. * Add keybindings for "snip", screenshot window, and screenshot current display. * Add scripts for the screenshot window and screenshot current display functions. * `packages-repository.txt` has also been alphabetically sorted to make it easier to work with.
This commit is contained in:
@@ -219,8 +219,12 @@ bindsym $mod+r mode "resize"
|
||||
#
|
||||
# Screenshots
|
||||
#
|
||||
bindsym print exec /usr/share/sway-contrib/grimshot --notify save output
|
||||
bindsym Shift+print exec ~/.config/sway/scripts/screenshot.sh
|
||||
# Snip a selection and pipe to swappy
|
||||
bindsym print exec grim -g "$(slurp)" - | swappy -f -
|
||||
# Screenshot a window and pipe to swappy
|
||||
bindsym Ctrl+Print exec ~/.config/sway/scripts/screenshot_window.sh
|
||||
# Screenshot the current display and pipe to swappy
|
||||
bindsym Shift+Print exec ~/.config/sway/scripts/screenshot_display.sh
|
||||
#
|
||||
# Keybindings List
|
||||
#
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
entries="Active Screen Output Area Window"
|
||||
|
||||
selected=$(printf '%s\n' $entries | wofi --style=$HOME/.config/wofi/style.widgets.css --conf=$HOME/.config/wofi/config.screenshot | awk '{print tolower($1)}')
|
||||
|
||||
case $selected in
|
||||
active)
|
||||
/usr/share/sway-contrib/grimshot --notify save active;;
|
||||
screen)
|
||||
/usr/share/sway-contrib/grimshot --notify save screen;;
|
||||
output)
|
||||
/usr/share/sway-contrib/grimshot --notify save output;;
|
||||
area)
|
||||
/usr/share/sway-contrib/grimshot --notify save area;;
|
||||
window)
|
||||
/usr/share/sway-contrib/grimshot --notify save window;;
|
||||
esac
|
||||
4
.config/sway/scripts/screenshot_display.sh
Executable file
4
.config/sway/scripts/screenshot_display.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
output_id=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused).name')
|
||||
grim -o $output_id - | swappy -f -
|
||||
3
.config/sway/scripts/screenshot_window.sh
Executable file
3
.config/sway/scripts/screenshot_window.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
grim -g "$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp)" - | swappy -f -
|
||||
@@ -38,3 +38,4 @@ xed
|
||||
ttf-jetbrains-mono
|
||||
ttf-ubuntu-font-family
|
||||
xfce4-terminal
|
||||
swappy
|
||||
|
||||
Reference in New Issue
Block a user