Skip to content

Commit f03a16c

Browse files
authored
Configuring/Uncommon Tips & Tricks: alttab: use grim instead of grim-hyprland (#1398)
1 parent be0679b commit f03a16c

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

content/Configuring/Uncommon-tips-&-tricks.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,14 @@ bind = $mod SHIFT, 0, exec, hyprctl -q keyword cursor:zoom_factor 1
280280
```
281281

282282
## Alt tab behaviour
283-
To mimic DE's alt-tab behaviour. Here is an example that uses foot, fzf, [grim-hyprland](https://github.com/eriedaberrie/grim-hyprland) and chafa to the screenshot in the terminal.
283+
To mimic DE's alt-tab behaviour. Here is an example that uses foot, fzf, grim and chafa to the screenshot in the terminal.
284284

285285
![alttab](https://github.com/user-attachments/assets/2a260809-b1b0-4f72-8644-46cc9d8b8971)
286286

287287
Dependencies :
288288
- foot
289289
- fzf
290-
- [grim-hyprland](https://github.com/eriedaberrie/grim-hyprland)
290+
- grim
291291
- chafa
292292
- jq
293293

@@ -323,12 +323,12 @@ windowrule = match:class alttab, border_size 0
323323
```bash {filename="alttab.sh"}
324324
#!/usr/bin/env bash
325325
hyprctl -q dispatch submap alttab
326-
start=$1
327-
address=$(hyprctl -j clients | jq -r 'sort_by(.focusHistoryID) | .[] | select(.workspace.id >= 0) | "\(.address)\t\(.title)"' |
326+
327+
address=$(hyprctl -j clients | jq -r 'sort_by(.focusHistoryID) | .[] | select(.workspace.id >= 0) | "\(.stableId)\t\(.title)"' |
328328
fzf --color prompt:green,pointer:green,current-bg:-1,current-fg:green,gutter:-1,border:bright-black,current-hl:red,hl:red \
329329
--cycle \
330330
--sync \
331-
--bind tab:down,shift-tab:up,start:$start,double-click:ignore \
331+
--bind tab:down,shift-tab:up,start:"$1",double-click:ignore \
332332
--wrap \
333333
--delimiter=$'\t' \
334334
--with-nth=2 \
@@ -352,10 +352,10 @@ I chose to exclude windows that are in special workspaces but it can be modified
352352
#!/usr/bin/env bash
353353
line="$1"
354354

355-
IFS=$'\t' read -r addr _ <<< "$line"
355+
IFS=$'\t' read -r stableId _ <<< "$line"
356356
dim=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}
357357

358-
grim -t png -l 0 -w "$addr" $XDG_RUNTIME_DIR/hypr/alttab/preview.png
358+
grim -t png -l 0 -T "$stableId" $XDG_RUNTIME_DIR/hypr/alttab/preview.png
359359
chafa --animate false --dither=none -s "$dim" "$XDG_RUNTIME_DIR/hypr/alttab/preview.png"
360360
```
361361

0 commit comments

Comments
 (0)