-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FMO-55: Add screen recording executor on top panel
- Create screen recording script - Add screen recording script as an executor in nwg-panel and place on top right module Signed-off-by: Anh Huy Bui <[email protected]>
- Loading branch information
1 parent
6acc20a
commit 5143abe
Showing
6 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
(final: _prev: { | ||
screenRecord = final.writeShellScriptBin "screenRecord" '' | ||
RECORDING_STATE=$(${final.ps}/bin/ps cax -o stat,comm | grep '^S.*wf-recorder') | ||
FILE_NAME="/home/ghaf/recordings/$(date '+%Y-%m-%d_%H:%M:%S').mp4" | ||
CURRENT_DISPLAY=$(${final.sway}/bin/swaymsg -t get_outputs --raw | ${final.jq}/bin/jq '. | map(select(.focused == true)) | .[0].name' -r) | ||
if [ $# == 0 ]; then | ||
if [[ -z $RECORDING_STATE ]]; then | ||
echo ${../../desktop/graphics/assets/record.png} | ||
echo "$CURRENT_DISPLAY" | ||
else | ||
echo ${../../desktop/graphics/assets/stop-record.png} | ||
echo Recording | ||
fi | ||
exit | ||
fi | ||
if [[ "$1" != "s" ]] then | ||
exit | ||
fi | ||
if [[ -z $RECORDING_STATE ]]; then | ||
mkdir -p /home/ghaf/recordings | ||
${final.coreutils-full}/bin/nohup ${final.wf-recorder}/bin/wf-recorder -a -f $FILE_NAME -o $CURRENT_DISPLAY </dev/null &>/dev/null & | ||
echo Started | ||
else | ||
${final.killall}/bin/killall -s SIGINT wf-recorder | ||
echo Stopped | ||
fi | ||
''; | ||
}) |