diff --git a/bin/omarchy-cmd-screenrecord b/bin/omarchy-cmd-screenrecord index 3ee3d877..93e143a9 100755 --- a/bin/omarchy-cmd-screenrecord +++ b/bin/omarchy-cmd-screenrecord @@ -135,7 +135,17 @@ stop_screenrecording() { notify-send "Screen recording error" "Recording process had to be force-killed. Video may be corrupted." -u critical -t 5000 else trim_first_frame - notify-send "Screen recording saved to $OUTPUT_DIR" -t 2000 + local filename=$(cat "$RECORDING_FILE" 2>/dev/null) + local preview="${filename%.mp4}-preview.png" + + # Generate a preview thumbnail from the first frame + ffmpeg -y -i "$filename" -ss 00:00:00.1 -vframes 1 -q:v 2 "$preview" -loglevel quiet 2>/dev/null + + ( + ACTION=$(notify-send "Screen recording saved" "Open with Super + Alt + , (or click this)" -t 10000 -i "${preview:-$filename}" -A "default=open") + [[ $ACTION == "default" ]] && mpv "$filename" + rm -f "$preview" + ) & fi rm -f "$RECORDING_FILE" diff --git a/bin/omarchy-cmd-screenshot b/bin/omarchy-cmd-screenshot index 90555a23..16060e91 100755 --- a/bin/omarchy-cmd-screenshot +++ b/bin/omarchy-cmd-screenshot @@ -65,27 +65,30 @@ get_rectangles() { # Select based on mode case "$MODE" in - region) - hyprpicker -r -z >/dev/null 2>&1 & PID=$! - sleep .1 - SELECTION=$(slurp 2>/dev/null) - kill $PID 2>/dev/null - ;; - windows) - hyprpicker -r -z >/dev/null 2>&1 & PID=$! - sleep .1 - SELECTION=$(get_rectangles | slurp -r 2>/dev/null) - kill $PID 2>/dev/null - ;; - fullscreen) - SELECTION=$(hyprctl monitors -j | jq -r "${JQ_MONITOR_GEO} .[] | select(.focused == true) | format_geo") - ;; - smart|*) - RECTS=$(get_rectangles) - hyprpicker -r -z >/dev/null 2>&1 & PID=$! - sleep .1 - SELECTION=$(echo "$RECTS" | slurp 2>/dev/null) - kill $PID 2>/dev/null +region) + hyprpicker -r -z >/dev/null 2>&1 & + PID=$! + sleep .1 + SELECTION=$(slurp 2>/dev/null) + kill $PID 2>/dev/null + ;; +windows) + hyprpicker -r -z >/dev/null 2>&1 & + PID=$! + sleep .1 + SELECTION=$(get_rectangles | slurp -r 2>/dev/null) + kill $PID 2>/dev/null + ;; +fullscreen) + SELECTION=$(hyprctl monitors -j | jq -r "${JQ_MONITOR_GEO} .[] | select(.focused == true) | format_geo") + ;; +smart | *) + RECTS=$(get_rectangles) + hyprpicker -r -z >/dev/null 2>&1 & + PID=$! + sleep .1 + SELECTION=$(echo "$RECTS" | slurp 2>/dev/null) + kill $PID 2>/dev/null # If the selection area is L * W < 20, we'll assume you were trying to select whichever # window or output it was inside of to prevent accidental 2px snapshots diff --git a/config/hyprland-preview-share-picker/config.yaml b/config/hyprland-preview-share-picker/config.yaml index 6b939570..740fc7ae 100644 --- a/config/hyprland-preview-share-picker/config.yaml +++ b/config/hyprland-preview-share-picker/config.yaml @@ -3,7 +3,7 @@ # relative paths are resolved relative to the location of the config file stylesheets: ["../omarchy/current/theme/hyprland-preview-share-picker.css"] # default page selected when the picker is opened -default_page: windows +default_page: outputs window: # height of the application window diff --git a/migrations/1772981555.sh b/migrations/1772981555.sh new file mode 100644 index 00000000..d843150f --- /dev/null +++ b/migrations/1772981555.sh @@ -0,0 +1,7 @@ +echo "Update hyprland-preview-share-picker config to default to outputs page" + +CONFIG_FILE=~/.config/hyprland-preview-share-picker/config.yaml + +if [[ -f $CONFIG_FILE ]]; then + sed -i 's/^default_page: windows$/default_page: outputs/' "$CONFIG_FILE" +fi