mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-23 02:08:35 +02:00
i3: move screenshot to an helper script
This commit is contained in:
parent
34946de658
commit
e4a5aa99e8
2 changed files with 19 additions and 2 deletions
17
bin/screenshot
Executable file
17
bin/screenshot
Executable file
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euf -o pipefail
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
desktop)
|
||||||
|
target=~/.config/i3/screenshots/$(date -Iseconds).jpg
|
||||||
|
maim -u -m 8 $target
|
||||||
|
notify-send -i camera-photo "Desktop screenshot" "Saved in ${target##*/}"
|
||||||
|
echo -n $target | xclip -selection clipboard
|
||||||
|
;;
|
||||||
|
window)
|
||||||
|
maim -u -s -b 5 -l -c 0.3,0.4,0.6,0.4 \
|
||||||
|
| xclip -selection clipboard -t image/png
|
||||||
|
notify-send -i camera-photo "Screenshot" "Saved to clipboard"
|
||||||
|
;;
|
||||||
|
esac
|
4
config
4
config
|
@ -138,8 +138,8 @@ bindsym $mod+Shift+r restart
|
||||||
# Lock screen and print screen
|
# Lock screen and print screen
|
||||||
bindsym XF86ScreenSaver exec --no-startup-id exec xset s activate
|
bindsym XF86ScreenSaver exec --no-startup-id exec xset s activate
|
||||||
bindsym $mod+Delete exec --no-startup-id exec xset s activate
|
bindsym $mod+Delete exec --no-startup-id exec xset s activate
|
||||||
bindsym Print exec --no-startup-id "maim -u -s -b 5 -l -c 0.3,0.4,0.6,0.4 | xclip -selection clipboard -t image/png"
|
bindsym Print exec --no-startup-id exec ~/.config/i3/bin/screenshot window
|
||||||
bindsym $mod+Print exec --no-startup-id "maim -u -m 8 ~/.config/i3/screenshots/$(date -Iseconds).jpg"
|
bindsym $mod+Print exec --no-startup-id exec ~/.config/i3/bin/screenshot desktop
|
||||||
|
|
||||||
# Quake window
|
# Quake window
|
||||||
bindsym $mod+grave nop "quake-console:$term:QuakeConsoleNeedsUniqueName:0.3"
|
bindsym $mod+grave nop "quake-console:$term:QuakeConsoleNeedsUniqueName:0.3"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue