Fix: Allow vertical monitors to be recorded properly instead of erroring. (#861)
This commit is contained in:
@@ -68,12 +68,30 @@ startRecording() {
|
||||
w=$(echo "$monitor_info" | jq -r '.width')
|
||||
h=$(echo "$monitor_info" | jq -r '.height')
|
||||
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')
|
||||
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
|
||||
wf-recorder $WF_RECORDER_OPTS --geometry "$(slurp)" --file "$outputPath" &
|
||||
fi
|
||||
|
||||
3
src/lib/types/options.d.ts
vendored
3
src/lib/types/options.d.ts
vendored
@@ -3,6 +3,7 @@ import { Variable } from 'types/variable';
|
||||
import { defaultColorMap } from './defaults/options';
|
||||
import { Astal } from 'astal/gtk3';
|
||||
import { dropdownMenuList } from '../constants/options';
|
||||
import { FontStyle } from 'src/components/settings/shared/inputs/font/utils';
|
||||
|
||||
export type MkOptionsResult = {
|
||||
array: () => Opt[];
|
||||
@@ -104,7 +105,7 @@ export interface RowProps<T> {
|
||||
subtitleLink?: string;
|
||||
dependencies?: string[];
|
||||
increment?: number;
|
||||
fontStyle?: Opt<string>;
|
||||
fontStyle?: Opt<FontStyle>;
|
||||
fontLabel?: Opt<string>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user