about summary refs log tree commit diff stats
path: root/pkgs/by-name/sw/swallow/swallow.sh
blob: 922a21b3558a0256cd05fcbc4efa556b820281fb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env dash
# Based on: https://codeberg.org/nirodhvana/reservoir/src/commit/2fa8c14877799a03bb927f048c2907dbb418fd68/dot-local/bin/gobble

# Inspired by https://github.com/swindlesmccoop/not-just-dotfiles/blob/master/.local/bin/swallow

swallow_tag=$((1 << 9))
eat() {
    riverctl set-view-tags $swallow_tag
}

throwup() {
    riverctl set-focused-tags $swallow_tag &&
        riverctl send-to-previous-tags &&
        riverctl focus-previous-tags
}

if [ -z "$*" ]; then
    printf "ERROR: No Arguments Supplied\n"
else
    eat && "$@"

    throwup
fi