dots-of-war/files/scripts/swallow_app.sh

20 lines
283 B
Bash
Raw Normal View History

2020-10-30 22:02:38 +02:00
#! /bin/sh
2020-06-21 12:41:26 +02:00
file="$HOME/.local/share/unhide"
app="$1"
#target="$2"
2020-10-30 22:02:38 +02:00
tid="$(xdo id)"
2020-06-21 12:41:26 +02:00
hidecurrent() {
2020-10-30 22:02:38 +02:00
echo "$tid+$app" >> "$file" & xdo hide
2020-06-21 12:41:26 +02:00
}
showlast() {
2020-10-30 22:02:38 +02:00
sid="$(cat $file | grep "$app" | awk -F "+" 'END{print $1}')"
xdo show -r "$sid"
2020-06-21 12:41:26 +02:00
}
2020-10-30 22:02:38 +02:00
hidecurrent & "$@" ; showlast