Fix: Allow vertical monitors to be recorded properly instead of erroring. (#861)

This commit is contained in:
Jas Singh
2025-03-24 22:25:15 -07:00
committed by GitHub
parent dba7ac64c6
commit 8068663466
2 changed files with 43 additions and 24 deletions

View File

@@ -68,12 +68,30 @@ startRecording() {
w=$(echo "$monitor_info" | jq -r '.width') w=$(echo "$monitor_info" | jq -r '.width')
h=$(echo "$monitor_info" | jq -r '.height') h=$(echo "$monitor_info" | jq -r '.height')
scale=$(echo "$monitor_info" | jq -r '.scale') scale=$(echo "$monitor_info" | jq -r '.scale')
scaled_width=$(awk "BEGIN { print $w / $scale }")
scaled_height=$(awk "BEGIN { print $h / $scale }")
x=$(echo "$monitor_info" | jq -r '.x') x=$(echo "$monitor_info" | jq -r '.x')
y=$(echo "$monitor_info" | jq -r '.y') y=$(echo "$monitor_info" | jq -r '.y')
wf-recorder $WF_RECORDER_OPTS --geometry "${x},${y} ${scaled_width}x${scaled_height}" --file "$outputPath" & transform=$(echo "$monitor_info" | jq -r '.transform')
rotation_filter=""
if [ "$transform" -eq 1 ] || [ "$transform" -eq 3 ]; then
scaled_width=$(awk "BEGIN { print $h / $scale }")
scaled_height=$(awk "BEGIN { print $w / $scale }")
else
scaled_width=$(awk "BEGIN { print $w / $scale }")
scaled_height=$(awk "BEGIN { print $h / $scale }")
fi
case "$transform" in
1)
rotation_filter="-F transpose=1"
;;
3)
rotation_filter="-F transpose=2"
;;
esac
wf-recorder $WF_RECORDER_OPTS $rotation_filter --geometry "${x},${y} ${scaled_width}x${scaled_height}" --file "$outputPath" &
elif [ "$target" == "region" ]; then elif [ "$target" == "region" ]; then
wf-recorder $WF_RECORDER_OPTS --geometry "$(slurp)" --file "$outputPath" & wf-recorder $WF_RECORDER_OPTS --geometry "$(slurp)" --file "$outputPath" &
fi fi

View File

@@ -3,6 +3,7 @@ import { Variable } from 'types/variable';
import { defaultColorMap } from './defaults/options'; import { defaultColorMap } from './defaults/options';
import { Astal } from 'astal/gtk3'; import { Astal } from 'astal/gtk3';
import { dropdownMenuList } from '../constants/options'; import { dropdownMenuList } from '../constants/options';
import { FontStyle } from 'src/components/settings/shared/inputs/font/utils';
export type MkOptionsResult = { export type MkOptionsResult = {
array: () => Opt[]; array: () => Opt[];
@@ -104,7 +105,7 @@ export interface RowProps<T> {
subtitleLink?: string; subtitleLink?: string;
dependencies?: string[]; dependencies?: string[];
increment?: number; increment?: number;
fontStyle?: Opt<string>; fontStyle?: Opt<FontStyle>;
fontLabel?: Opt<string>; fontLabel?: Opt<string>;
} }