summaryrefslogtreecommitdiff
path: root/bin/extra/replay.sh
blob: 2a18352d424cb216c7df2853d38e5f723ebc183a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh

File="$1"
OutputDir="$(dirname "$File")"
OutputFile="$(basename "$File")"
ActiveWindowName="$(xprop -id "$(xdotool getactivewindow)" WM_CLASS | awk -F '"' '{print $(NF-1)}')"

if [ "$ActiveWindowName" ]
then
	OutputFileName="${ActiveWindowName}_${OutputFile#Replay_}"
	mv "$File" "$OutputDir"/"$OutputFileName"
	notify-send '*replay.sh' "saved: $OutputFileName"
fi