You are not logged in.
Hi folks!
I'm using https://aur.archlinux.org/packages/screencast to take some videos on my desktop. I would like to set some keybindings on openbox to both start and stop recording. I have no problems starting the recording session, but I need to send a "q" to the process in order to stop the recording and save the video file. I have tried some mkfifo/pipes/interrupting magic, but my magic doesn't seem to be that powerful :-/
Any ideas?
Thanks in advance.
Last edited by ExoDoom (2022-09-12 14:06:56)
Offline
It might gracefully respond to sigterm, sigint or sighup? Maybe some sigusr1 or sigusr2?
(kill -l)
If you really have to send a key, "xdotool key --window" might get you there, but you need to know the window ID where to send the key and also the client might ignore synthetic events or input w/o being focused.
Offline
Hi folks!
Thank you very much for your response, seth.
It turned out that screencast doesn't finish recording with any interrupt signal, just with that "q", but recordmydesktop did the trick (it finishes with a SIGTERM). So I just switched to recordmydesktop, though I liked the webcam overlay feature of screencast :-/
Now I'm facing a little bit annoying issue between recordmydesktop and picom. Whenever I activate shadows on picom, the shadow is applied to the whole recorded video. If I configure the shadow-exclude property to include "window_type = 'normal'", the shadow disappears (but it disappears from all "normal" windows, I'd like to exclude it only from recordmydesktop). I have tried to get the window properties so I can exclude a window name, class, etc. but this "window" seems to have no properties:
$ xwininfo -all
xwininfo: Please select the window about which you
would like information by clicking the
mouse in that window.
xwininfo: Window id: 0x3400003 (has no name)
Root window id: 0x7b7 (the root window) (has no name)
Parent window id: 0x7b7 (the root window) (has no name)
0 children.
Absolute upper-left X: 678
Absolute upper-left Y: 308
Relative upper-left X: 678
Relative upper-left Y: 308
Width: 556
Height: 380
Depth: 24
Visual: 0x21
Visual Class: TrueColor
Border width: 0
Class: InputOutput
Colormap: 0x20 (installed)
Bit Gravity State: ForgetGravity
Window Gravity State: NorthWestGravity
Backing Store State: NotUseful
Save Under State: yes
Map State: IsViewable
Override Redirect State: yes
Corners: +678+308 -686+308 -686-392 +678-392
-geometry 556x380+678+308
Bit gravity: ForgetGravity
Window gravity: NorthWestGravity
Backing-store hint: NotUseful
Backing-planes to be preserved: 0xffffffff
Backing pixel: 0
Save-unders: Yes
Someone wants these events:
Exposure
SubstructureNotify
FocusChange
PropertyChange
Do not propagate these events:
Override redirection?: Yes
No window manager hints defined
Window manager hints:
Process id: (unknown)
No normal window size hints defined
No zoom window size hints defined
Window shape extents: 556x380+0+0
No border shape defined
$ xwininfo -id 0x3400003
xwininfo: Window id: 0x3400003 (has no name)
Absolute upper-left X: 678
Absolute upper-left Y: 308
Relative upper-left X: 678
Relative upper-left Y: 308
Width: 556
Height: 380
Depth: 24
Visual: 0x21
Visual Class: TrueColor
Border width: 0
Class: InputOutput
Colormap: 0x20 (installed)
Bit Gravity State: ForgetGravity
Window Gravity State: NorthWestGravity
Backing Store State: NotUseful
Save Under State: yes
Map State: IsViewable
Override Redirect State: yes
Corners: +678+308 -686+308 -686-392 +678-392
-geometry 556x380+678+308
$ xprop -id 0x3400003
(silence)It's not that big issue (I mean, I can just turn off the shadows), but it would be great is someone gave me some clues :-)
BTW, this is my keybound script, in the case someone finds it useful:
#!/bin/bash
pidof recordmydesktop && kill -SIGTERM $(pidof recordmydesktop) && notify-send -i recordmydesktop "recordMyDesktop" "La grabación ha finalizado." && exit 0
_fileName() {
local FOLDER="$(xdg-user-dir VIDEOS)/Capturas"
[ -d "$FOLDER" ] || mkdir -p "$FOLDER"
echo "${FOLDER}/Captura $(date +%Y%m%d%H%M%S).ogv"
}
gxmessage -title "Screencast" -name "SCREENCAST_MANAGER" -center -borderless -ontop -sticky -font "sans 14" -wrap -buttons "La _pantalla:101,Una _ventana:102,El área _seleccionada:103" -default "El área _seleccionada" -geometry 590x118 "¿Qué quiere grabar?"
MODE=$?
[ $MODE -eq 1 ] && exit 1
gxmessage -title "Screencast" -name "SCREENCAST_MANAGER" -center -borderless -ontop -sticky -font "sans 14" -wrap -buttons "_No:100,_Sí:101" -default "_Sí" -geometry 590x118 "¿Quiere inluir audio?"
SOUND=$?
[ $SOUND -eq 1 ] && exit 1
RMD_OPTIONS=""
if [ "$MODE" == "102" ]; then
RMD_OPTIONS=$(slop -t 9999999 -f "--windowid %i")
[ $? -eq 0 ] || exit 1
fi
if [ "$MODE" == "103" ]; then
RMD_OPTIONS=$(slop -c 1,0,0,0.5 -f "-x %x -y %y --width %w --height %h")
[ $? -eq 0 ] || exit 1
fi
[ "$SOUND" == "100" ] && RMD_OPTIONS="$RMD_OPTIONS --no-sound"
FILENAME="$(_fileName)"
recordmydesktop $RMD_OPTIONS -o "$FILENAME"Offline
Override Redirect State: yesMost override_redirect windows will be "dropdown_menu", "popup_menu", "tooltip", "notification", "combo", and "dnd" - not "normal".
So excluding "normal" "override_redirect" windows should do w/o significant side-effects?
Offline
Override Redirect State: yesMost override_redirect windows will be "dropdown_menu", "popup_menu", "tooltip", "notification", "combo", and "dnd" - not "normal".
So excluding "normal" "override_redirect" windows should do w/o significant side-effects?
"window_type = 'normal' && override_redirect = true" did the trick. You are awesome, my good sir.
Offline