[bugfix] record desktop

This commit is contained in:
Klesh Wong 2020-11-19 00:59:04 +08:00
parent 75d72ceb0e
commit 0ce11f5bd4
2 changed files with 16 additions and 22 deletions

32
bin/sc
View File

@ -81,7 +81,7 @@ end
set --append subcmds window set --append subcmds window
set window_help '[fps=5]' 'record clicked window' set window_help '[fps=5]' 'record clicked window'
function window -a fps function window -a fps
not set -q fps || set fps 5 test -z $fps && set fps 5
set wininfo (xwininfo) set wininfo (xwininfo)
for line in $wininfo for line in $wininfo
set -l kv (string split ":" $line) set -l kv (string split ":" $line)
@ -107,29 +107,15 @@ end
set --append subcmds desktop set --append subcmds desktop
set desktop_help 'record desktop' set desktop_help 'record desktop'
function window -a fps function desktop -a fps
not set -q fps || set fps 5 test -z $fps && set fps 30
set wininfo (xwininfo) set monsinfo (xrandr --listmonitors)
for line in $wininfo #0: virtmon-1 1920/445x1080/250+0+0 DP-2
set -l kv (string split ":" $line) if not set m (string match -r ' ([0-9]+)/[0-9]+x([0-9]+)/\d+\+([0-9]+)\+([0-9]+) ' $monsinfo[2])
set -l k (string trim $kv[1]) echo 'unable to find geometry of the first monitor'
set -l v (string trim $kv[2])
switch $k
case 'Absolute upper-left X'
set x $v
case 'Absolute upper-left Y'
set y $v
case 'Width'
set w $v
case 'Height'
set h $v
end
end
if not set -q x
echo 'unable to find geometry of the window'
exit 1 exit 1
end end
_start $x $y $w $h $fps _start $m[4] $m[5] $m[2] $m[3] $fps
end end
set --append subcmds theend set --append subcmds theend
@ -178,6 +164,8 @@ end
if contains $argv[1] $subcmds if contains $argv[1] $subcmds
$argv $argv
else if test (count $argv ) -eq 0
desktop
else else
help help
end end

6
optim/pulse-echo-cacnel.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
grep -qv '^\sload-module module-echo-cancel' /etc/pulse/default.pa ||
echo 'load-module module-echo-cancel source_name=noechosource sink_name=noechosink' > /etc/pulse/default.pa
pactl