Refresh captured preferences from the live system
fiw-shot now uses Spectacle under KDE and grim + slurp on TideWM and other Wayland sessions. KDE picks up the 6.5 compositing and shade defaults, Kitty loads Fish explicitly, Prism hides its console on errors and Vesktop follows the upstream GIF plugin rename. Local cursor, panel and pane-layout state stays out of the published tree.
This commit is contained in:
parent
0a2590256e
commit
393f58bdcd
6 changed files with 67 additions and 19 deletions
|
|
@ -1,10 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
# fiw-shot: Spectacle in background mode (never opens the app window).
|
||||
# The shot goes straight to the clipboard, then a notification shows the
|
||||
# thumbnail (drag it into any app) with Save / Edit buttons.
|
||||
# fiw-shot: screenshot straight to the clipboard, then a notification with
|
||||
# Save (and Edit under KWin). Never opens a picker window of its own.
|
||||
#
|
||||
# fiw-shot region Alt+S select area (adjust with handles, Enter = take)
|
||||
# fiw-shot screen Alt+D monitor under the cursor
|
||||
# fiw-shot region Alt+S select area (Enter = take)
|
||||
# fiw-shot screen Alt+D full screen of the focused window's monitor
|
||||
#
|
||||
# KDE/KWin uses Spectacle (its region UI is KWin-only). Every other Wayland
|
||||
# session, TideWM included, uses grim + slurp.
|
||||
set -u
|
||||
|
||||
mode=${1:-region}
|
||||
|
|
@ -12,11 +14,26 @@ tmp_dir="${XDG_RUNTIME_DIR:-/tmp}/fiw-shot" # tmpfs, gone at logout
|
|||
save_dir="$HOME/Pictures/Screenshots"
|
||||
|
||||
case $mode in
|
||||
region) flag=-r ;;
|
||||
screen) flag=-m ;;
|
||||
region|screen) ;;
|
||||
*) echo "usage: fiw-shot region|screen" >&2; exit 2 ;;
|
||||
esac
|
||||
|
||||
case ${XDG_CURRENT_DESKTOP:-} in
|
||||
*KDE*|*Plasma*) backend=spectacle ;;
|
||||
*) backend=grim ;;
|
||||
esac
|
||||
|
||||
if [[ $backend == grim ]]; then
|
||||
need="grim wl-copy"
|
||||
[[ $mode == region ]] && need="grim slurp wl-copy"
|
||||
for bin in $need; do
|
||||
command -v "$bin" >/dev/null 2>&1 || {
|
||||
echo "fiw-shot: $bin is missing (emerge gui-apps/slurp)" >&2
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
fi
|
||||
|
||||
mkdir -p "$tmp_dir"
|
||||
# keep the last 20 unsaved shots, drop older ones
|
||||
ls -1t "$tmp_dir"/*.png 2>/dev/null | tail -n +21 | xargs -r rm -f --
|
||||
|
|
@ -24,15 +41,41 @@ ls -1t "$tmp_dir"/*.png 2>/dev/null | tail -n +21 | xargs -r rm -f --
|
|||
name="Screenshot_$(date +%Y%m%d_%H%M%S).png"
|
||||
shot="$tmp_dir/$name"
|
||||
|
||||
spectacle --background --nonotify $flag --output "$shot" 2>/dev/null
|
||||
if [[ $backend == spectacle ]]; then
|
||||
[[ $mode == region ]] && flag=-r || flag=-m
|
||||
spectacle --background --nonotify "$flag" --output "$shot" 2>/dev/null
|
||||
else
|
||||
if [[ $mode == region ]]; then
|
||||
geometry=$(slurp) || exit 0
|
||||
[[ -n $geometry ]] || exit 0
|
||||
grim -g "$geometry" "$shot"
|
||||
else
|
||||
# Monitor of the focused window; whole layout if nothing is focused.
|
||||
output=$(tidectl focused-window 2>/dev/null |
|
||||
sed -n 's/.*output=\([^ ]*\).*/\1/p' | head -n1)
|
||||
if [[ -n ${output:-} ]]; then
|
||||
grim -o "$output" "$shot"
|
||||
else
|
||||
grim "$shot"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ -s $shot ]] || exit 0 # Esc during selection: nothing to do
|
||||
|
||||
wl-copy --type image/png < "$shot"
|
||||
|
||||
action=$(notify-send --app-name=Screenshot --icon="$shot" \
|
||||
--hint="variant:x-kde-urls:@as ['file://$shot']" \
|
||||
--action=save=Save --action=edit=Edit \
|
||||
"Copied to clipboard" "$name")
|
||||
if [[ $backend == spectacle ]]; then
|
||||
action=$(notify-send --app-name=Screenshot --icon="$shot" \
|
||||
--hint="variant:x-kde-urls:@as ['file://$shot']" \
|
||||
--action=save=Save --action=edit=Edit \
|
||||
"Copied to clipboard" "$name")
|
||||
else
|
||||
action=$(notify-send --app-name=Screenshot --icon="$shot" \
|
||||
--hint="variant:x-kde-urls:@as ['file://$shot']" \
|
||||
--action=save=Save \
|
||||
"Copied to clipboard" "$name")
|
||||
fi
|
||||
|
||||
case $action in
|
||||
save)
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ MoveZoomUp=none,none,Move Zoomed Area Upwards
|
|||
Overview=Meta+W,Meta+W,Toggle Overview
|
||||
Setup Window Shortcut=none,none,Setup Window Shortcut
|
||||
Show Desktop=none,Meta+D,Peek at Desktop
|
||||
Suspend Compositing=Alt+Shift+F12,Alt+Shift+F12,Suspend Compositing
|
||||
Switch One Desktop Down=Meta+Ctrl+Down,Meta+Ctrl+Down,Switch One Desktop Down
|
||||
Switch One Desktop Up=Meta+Ctrl+Up,Meta+Ctrl+Up,Switch One Desktop Up
|
||||
Switch One Desktop to the Left=Meta+Ctrl+Left,Meta+Ctrl+Left,Switch One Desktop to the Left
|
||||
|
|
@ -168,6 +169,7 @@ Window Quick Tile Top Right=none,none,Quick Tile Window to the Top Right
|
|||
Window Raise=none,none,Raise Window
|
||||
Window Resize=none,none,Resize Window
|
||||
Window Restore=none,Meta+Backspace,Restore Window
|
||||
Window Shade=none,none,Shade Window
|
||||
Window Shrink Horizontal=none,none,Shrink Window Horizontally
|
||||
Window Shrink Vertical=none,none,Shrink Window Vertically
|
||||
Window to Desktop 1=Meta+!,none,Window to Desktop 1
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ italic_font auto
|
|||
bold_italic_font auto
|
||||
font_size 11.0
|
||||
|
||||
shell fish
|
||||
linux_display_server auto
|
||||
background_blur 32
|
||||
dynamic_background_opacity yes
|
||||
|
|
@ -38,3 +37,5 @@ color12 #B9AEE6
|
|||
color13 #DDDAEC
|
||||
color14 #B2B2CB
|
||||
color15 #F7F1F6
|
||||
|
||||
shell fish
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ MenuBarInsteadOfToolBar=false
|
|||
QuitAfterGameStop=false
|
||||
RecordGameTime=true
|
||||
ShowConsole=false
|
||||
ShowConsoleOnError=true
|
||||
ShowConsoleOnError=false
|
||||
ShowGameTime=true
|
||||
ShowGameTimeWithoutDays=false
|
||||
ShowGlobalGameTime=true
|
||||
|
|
|
|||
|
|
@ -447,9 +447,6 @@
|
|||
"SuperReactionTweaks": {
|
||||
"enabled": false
|
||||
},
|
||||
"TenorGifSearch": {
|
||||
"enabled": false
|
||||
},
|
||||
"TextReplace": {
|
||||
"enabled": false
|
||||
},
|
||||
|
|
@ -566,6 +563,9 @@
|
|||
},
|
||||
"FixDiscordCss": {
|
||||
"enabled": true
|
||||
},
|
||||
"GifProviderSwitcher": {
|
||||
"enabled": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ Generated from the repo’s captured `kglobalshortcutsrc`. This describes
|
|||
Fiw’s bindings as configured; applying them is a separate installer action.
|
||||
It covers KDE global shortcuts, not every shortcut inside individual applications.
|
||||
|
||||
**67 assigned actions · 193 unassigned actions · 260 total**
|
||||
**68 assigned actions · 194 unassigned actions · 262 total**
|
||||
|
||||
`Meta` is the Super/Windows key. In the full tables, multiple keys for
|
||||
one action are alternatives. Grouped summary keys match the named actions
|
||||
|
|
@ -105,6 +105,7 @@ Bindings for desktops 1–3 are retained exactly as configured.
|
|||
| Toggle Grid View | <code>Meta+G</code> | <code>Meta+G</code> |
|
||||
| Kill Window | <code>Meta+Ctrl+Esc</code> | <code>Meta+Ctrl+Esc</code> |
|
||||
| Toggle Overview | <code>Meta+W</code> | <code>Meta+W</code> |
|
||||
| Suspend Compositing | <code>Alt+Shift+F12</code> | <code>Alt+Shift+F12</code> |
|
||||
| Switch One Desktop Down | <code>Meta+Ctrl+Down</code> | <code>Meta+Ctrl+Down</code> |
|
||||
| Switch One Desktop Up | <code>Meta+Ctrl+Up</code> | <code>Meta+Ctrl+Up</code> |
|
||||
| Switch One Desktop to the Left | <code>Meta+Ctrl+Left</code> | <code>Meta+Ctrl+Left</code> |
|
||||
|
|
@ -242,7 +243,7 @@ stored KDE default. Expand each section to review the full capture.
|
|||
</details>
|
||||
|
||||
<details>
|
||||
<summary>KWin (138)</summary>
|
||||
<summary>KWin (139)</summary>
|
||||
|
||||
| Action | Stored KDE default |
|
||||
|---|---|
|
||||
|
|
@ -349,6 +350,7 @@ stored KDE default. Expand each section to review the full capture.
|
|||
| Raise Window | Unassigned |
|
||||
| Resize Window | Unassigned |
|
||||
| Restore Window | <code>Meta+Backspace</code> |
|
||||
| Shade Window | Unassigned |
|
||||
| Shrink Window Horizontally | Unassigned |
|
||||
| Shrink Window Vertically | Unassigned |
|
||||
| Window to Desktop 10 | Unassigned |
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue