Screenshot : Use "unknown" dir when no window is in focus.
This commit is contained in:
parent
de7cbef664
commit
6ca438ed37
|
@ -21,8 +21,16 @@ in {
|
||||||
vidStop = ''pkill -SIGINT wf-recorder'';
|
vidStop = ''pkill -SIGINT wf-recorder'';
|
||||||
|
|
||||||
prepFile = path: ext: ''
|
prepFile = path: ext: ''
|
||||||
|
# Focused app id by default.
|
||||||
curWindow=$(parse_snake $(swaymsg -t get_tree | jq '.. | select(.type?) | select(.focused==true) | .app_id'))
|
curWindow=$(parse_snake $(swaymsg -t get_tree | jq '.. | select(.type?) | select(.focused==true) | .app_id'))
|
||||||
|
|
||||||
|
# If no id (i.e. xwayland), then use a name (title).
|
||||||
[[ "''${curWindow}" = "null" ]] && curWindow=$(parse_snake $(swaymsg -t get_tree | jq '.. | select(.type?) | select(.focused==true) | .name'))
|
[[ "''${curWindow}" = "null" ]] && curWindow=$(parse_snake $(swaymsg -t get_tree | jq '.. | select(.type?) | select(.focused==true) | .name'))
|
||||||
|
|
||||||
|
# If no app in focus, use "unknown" dir.
|
||||||
|
[[ "''${curWindow}" -eq "''${curWindow}" ]] && curWindow="unknown"
|
||||||
|
|
||||||
|
# Prepare dir and file path.
|
||||||
scrDir="${path}/''${curWindow}"
|
scrDir="${path}/''${curWindow}"
|
||||||
mkdir -p "''${scrDir}"
|
mkdir -p "''${scrDir}"
|
||||||
scrFile="''${scrDir}/$(date +${format}).${ext}"
|
scrFile="''${scrDir}/$(date +${format}).${ext}"
|
||||||
|
|
Loading…
Reference in a new issue