diff --git a/scripts/screen_record.sh b/scripts/screen_record.sh index 3854db9..af09575 100755 --- a/scripts/screen_record.sh +++ b/scripts/screen_record.sh @@ -68,19 +68,37 @@ 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 disown "$(jobs -p | tail -n 1)" echo "Recording started. Saving to $outputPath" - echo "$outputPath" > /tmp/last_recording_path + echo "$outputPath" >/tmp/last_recording_path } # Function to stop screen recording @@ -91,7 +109,7 @@ stopRecording() { fi pkill -SIGINT -f wf-recorder - sleep 1 # Allow wf-recorder time to terminate before proceeding + sleep 1 # Allow wf-recorder time to terminate before proceeding outputPath=$(cat /tmp/last_recording_path 2>/dev/null) @@ -113,21 +131,21 @@ stopRecording() { # Handle script arguments case "$1" in - start) - startRecording "$@" - ;; - stop) - stopRecording - ;; - status) - if checkRecording; then - echo "recording" - else - echo "not recording" - fi - ;; - *) - echo "Usage: $0 {start [screen | region] | stop | status}" - exit 1 - ;; -esac \ No newline at end of file +start) + startRecording "$@" + ;; +stop) + stopRecording + ;; +status) + if checkRecording; then + echo "recording" + else + echo "not recording" + fi + ;; +*) + echo "Usage: $0 {start [screen | region] | stop | status}" + exit 1 + ;; +esac diff --git a/src/lib/types/options.d.ts b/src/lib/types/options.d.ts index f54f45d..fec1677 100644 --- a/src/lib/types/options.d.ts +++ b/src/lib/types/options.d.ts @@ -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 { subtitleLink?: string; dependencies?: string[]; increment?: number; - fontStyle?: Opt; + fontStyle?: Opt; fontLabel?: Opt; }