Files
infra/dotfiles/desktop/.config/sway/scripts/screenshot
Fabio Scotto di Santolo d535c9ffd2 sway: screenshots, polkit floating, flatpak dark theme
Screenshots
- Swap xfce4-screenshooter for flameshot + grim/slurp/jq; xfce4 used
  the X11 selection so clipboard didn't round-trip to Wayland clients.
  Print invokes flameshot's editor; Shift/Alt+Print are quick
  grim-based captures via a small wrapper script. Flameshot is now
  autostarted so the first capture isn't slow.

Polkit
- Add for_window rules so the xfce-polkit dialog (and any other polkit
  agent) always opens floating.

Flatpak dark theme
- Write /etc/flatpak/overrides/global with GTK_THEME=Yaru-Blue-dark for
  legacy GTK apps, plus a sway-portals.conf so the Settings portal is
  served by xdg-desktop-portal-gtk (wlr doesn't implement it). That
  lets libadwaita apps see color-scheme=prefer-dark.

cleanup-sway: track the new package set.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 23:26:45 +02:00

41 lines
990 B
Bash
Executable File

#!/bin/sh
# Quick screenshot helpers for sway. Captures via grim, saves to disk and
# also copies to the Wayland clipboard. Use the flameshot binding for
# annotations / fancy capture.
#
# Usage: screenshot {full|region|output|window}
set -eu
mode="${1:-full}"
dir="$HOME/Pictures/Screenshots"
mkdir -p "$dir"
file="$dir/$(date +%Y%m%d_%H%M%S).png"
case "$mode" in
full)
grim "$file"
;;
region)
grim -g "$(slurp)" "$file"
;;
output)
out=$(swaymsg -t get_outputs --raw \
| jq -r '.[] | select(.focused) | .name')
grim -o "$out" "$file"
;;
window)
geom=$(swaymsg -t get_tree \
| jq -r '.. | select(.focused? == true)
| "\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)"')
grim -g "$geom" "$file"
;;
*)
printf 'Usage: %s {full|region|output|window}\n' "$0" >&2
exit 1
;;
esac
wl-copy < "$file"
notify-send "Screenshot saved" "$file" -i image-x-generic >/dev/null 2>&1 || true