Merge branch 'dev' into rc
This commit is contained in:
@@ -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
|
notify-send "Screen recording error" "Recording process had to be force-killed. Video may be corrupted." -u critical -t 5000
|
||||||
else
|
else
|
||||||
trim_first_frame
|
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
|
fi
|
||||||
|
|
||||||
rm -f "$RECORDING_FILE"
|
rm -f "$RECORDING_FILE"
|
||||||
|
|||||||
+24
-21
@@ -65,27 +65,30 @@ get_rectangles() {
|
|||||||
|
|
||||||
# Select based on mode
|
# Select based on mode
|
||||||
case "$MODE" in
|
case "$MODE" in
|
||||||
region)
|
region)
|
||||||
hyprpicker -r -z >/dev/null 2>&1 & PID=$!
|
hyprpicker -r -z >/dev/null 2>&1 &
|
||||||
sleep .1
|
PID=$!
|
||||||
SELECTION=$(slurp 2>/dev/null)
|
sleep .1
|
||||||
kill $PID 2>/dev/null
|
SELECTION=$(slurp 2>/dev/null)
|
||||||
;;
|
kill $PID 2>/dev/null
|
||||||
windows)
|
;;
|
||||||
hyprpicker -r -z >/dev/null 2>&1 & PID=$!
|
windows)
|
||||||
sleep .1
|
hyprpicker -r -z >/dev/null 2>&1 &
|
||||||
SELECTION=$(get_rectangles | slurp -r 2>/dev/null)
|
PID=$!
|
||||||
kill $PID 2>/dev/null
|
sleep .1
|
||||||
;;
|
SELECTION=$(get_rectangles | slurp -r 2>/dev/null)
|
||||||
fullscreen)
|
kill $PID 2>/dev/null
|
||||||
SELECTION=$(hyprctl monitors -j | jq -r "${JQ_MONITOR_GEO} .[] | select(.focused == true) | format_geo")
|
;;
|
||||||
;;
|
fullscreen)
|
||||||
smart|*)
|
SELECTION=$(hyprctl monitors -j | jq -r "${JQ_MONITOR_GEO} .[] | select(.focused == true) | format_geo")
|
||||||
RECTS=$(get_rectangles)
|
;;
|
||||||
hyprpicker -r -z >/dev/null 2>&1 & PID=$!
|
smart | *)
|
||||||
sleep .1
|
RECTS=$(get_rectangles)
|
||||||
SELECTION=$(echo "$RECTS" | slurp 2>/dev/null)
|
hyprpicker -r -z >/dev/null 2>&1 &
|
||||||
kill $PID 2>/dev/null
|
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
|
# 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
|
# window or output it was inside of to prevent accidental 2px snapshots
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# relative paths are resolved relative to the location of the config file
|
# relative paths are resolved relative to the location of the config file
|
||||||
stylesheets: ["../omarchy/current/theme/hyprland-preview-share-picker.css"]
|
stylesheets: ["../omarchy/current/theme/hyprland-preview-share-picker.css"]
|
||||||
# default page selected when the picker is opened
|
# default page selected when the picker is opened
|
||||||
default_page: windows
|
default_page: outputs
|
||||||
|
|
||||||
window:
|
window:
|
||||||
# height of the application window
|
# height of the application window
|
||||||
|
|||||||
@@ -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
|
||||||
Reference in New Issue
Block a user