[niri] Add custom screenshot setup
This commit is contained in:
1 parent
fb64d3314e
commit
d3007484fa
4 files changed
+46
-5
No files matched your search
@@ -16,6 +16,7 @@ packages:
|
|||||||
- ffmpeg
|
- ffmpeg
|
||||||
- fzf
|
- fzf
|
||||||
- git
|
- git
|
||||||
|
- grim
|
||||||
- imagemagick
|
- imagemagick
|
||||||
- jq
|
- jq
|
||||||
- kvantum
|
- kvantum
|
||||||
@@ -30,6 +31,8 @@ packages:
|
|||||||
- resvg
|
- resvg
|
||||||
- ripgrep
|
- ripgrep
|
||||||
- rofi
|
- rofi
|
||||||
|
- satty
|
||||||
|
- slurp
|
||||||
- tmux
|
- tmux
|
||||||
- unzip
|
- unzip
|
||||||
- wget
|
- wget
|
||||||
|
|||||||
@@ -91,11 +91,6 @@ binds {
|
|||||||
Mod+Shift+F { fullscreen-window; }
|
Mod+Shift+F { fullscreen-window; }
|
||||||
Mod+W { toggle-column-tabbed-display; }
|
Mod+W { toggle-column-tabbed-display; }
|
||||||
|
|
||||||
// ─── Screenshots ───
|
|
||||||
CTRL+Shift+1 { screenshot; }
|
|
||||||
CTRL+Shift+2 { screenshot-screen; }
|
|
||||||
CTRL+Shift+3 { screenshot-window; }
|
|
||||||
|
|
||||||
// ─── Emergency Escape Key ───
|
// ─── Emergency Escape Key ───
|
||||||
Mod+ESCAPE allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
|
Mod+ESCAPE allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
|
||||||
|
|
||||||
@@ -107,4 +102,9 @@ binds {
|
|||||||
// --- Discord keybinds dirty trick ---
|
// --- Discord keybinds dirty trick ---
|
||||||
CTRL+BracketLeft { spawn "~/.local/scripts/discord/focus-discord-toggle-mute.sh"; }
|
CTRL+BracketLeft { spawn "~/.local/scripts/discord/focus-discord-toggle-mute.sh"; }
|
||||||
CTRL+BracketRight { spawn "~/.local/scripts/discord/focus-discord-toggle-deafen.sh"; }
|
CTRL+BracketRight { spawn "~/.local/scripts/discord/focus-discord-toggle-deafen.sh"; }
|
||||||
|
|
||||||
|
// --- Screnshot with grim+slurp+satty ---
|
||||||
|
Mod+S hotkey-overlay-title="Screenshot (region)" { spawn "~/.local/scripts/gss-screenshot.sh" "region"; }
|
||||||
|
Mod+Shift+S hotkey-overlay-title="Screenshot (monitor-focused)" { spawn "~/.local/scripts/gss-screenshot.sh" "monitor-focused"; }
|
||||||
|
Mod+Ctrl+Shift+S hotkey-overlay-title="Screenshot (monitor-all)" { spawn "~/.local/scripts/gss-screenshot.sh" "monitor-all"; }
|
||||||
}
|
}
|
||||||
@@ -44,6 +44,13 @@ window-rule {
|
|||||||
open-maximized true
|
open-maximized true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window-rule {
|
||||||
|
match app-id=r#"^com\.gabm\.satty$"#
|
||||||
|
open-floating true
|
||||||
|
min-width 800
|
||||||
|
min-height 600
|
||||||
|
}
|
||||||
|
|
||||||
layer-rule {
|
layer-rule {
|
||||||
match namespace="^noctalia-wallpaper"
|
match namespace="^noctalia-wallpaper"
|
||||||
place-within-backdrop true
|
place-within-backdrop true
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -o errexit
|
||||||
|
set -o pipefail
|
||||||
|
set -o nounset
|
||||||
|
|
||||||
|
SCREENSHOTS_DIR="${XDG_PICTURES_DIR:-$(xdg-user-dir PICTURES)}/Screenshots"
|
||||||
|
mkdir -p "${SCREENSHOTS_DIR}"
|
||||||
|
|
||||||
|
MODE="${1:-region}"
|
||||||
|
|
||||||
|
case "${MODE}" in
|
||||||
|
region)
|
||||||
|
grim -g "$(slurp -d)" -t ppm -
|
||||||
|
;;
|
||||||
|
window)
|
||||||
|
niri msg action screenshot-window
|
||||||
|
sleep 0.5
|
||||||
|
wl-paste --type image/png
|
||||||
|
;;
|
||||||
|
monitor-focused)
|
||||||
|
grim -t ppm -o "$(niri msg --json focused-output | jq --raw-output .name)" -
|
||||||
|
;;
|
||||||
|
monitor-all)
|
||||||
|
grim -t ppm -
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "'${MODE}' is not a supported, aborting!" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac | satty --filename - --output-filename "${SCREENSHOTS_DIR}/screenshot-%+.png"
|
||||||
Reference in new issue
Block a user