mirror of
https://github.com/basecamp/omarchy.git
synced 2025-07-27 04:09:23 +00:00
Merge pull request #342 from michaldziurowski/fix-videos-dir-for-screenrec
take into consideration xdg dirs for screenshot and screen recording
This commit is contained in:
@ -2,7 +2,13 @@
|
|||||||
|
|
||||||
# Set recorder based on GPU
|
# Set recorder based on GPU
|
||||||
|
|
||||||
OUTPUT_DIR="${OMARCHY_SCREENRECORD_DIR:-$HOME/Videos}"
|
[[ -f ~/.config/user-dirs.dirs ]] && source ~/.config/user-dirs.dirs
|
||||||
|
OUTPUT_DIR="${OMARCHY_SCREENRECORD_DIR:-${XDG_VIDEOS_DIR:-$HOME/Videos}}"
|
||||||
|
|
||||||
|
if [[ ! -d "$OUTPUT_DIR" ]]; then
|
||||||
|
notify-send "Screen recording directory does not exist: $OUTPUT_DIR" -u critical -t 3000
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
screenrecording() {
|
screenrecording() {
|
||||||
filename="$OUTPUT_DIR/screenrecording-$(date +'%Y-%m-%d_%H-%M-%S').mp4"
|
filename="$OUTPUT_DIR/screenrecording-$(date +'%Y-%m-%d_%H-%M-%S').mp4"
|
||||||
@ -19,7 +25,7 @@ screenrecording() {
|
|||||||
if pgrep -x wl-screenrec >/dev/null || pgrep -x wf-recorder >/dev/null; then
|
if pgrep -x wl-screenrec >/dev/null || pgrep -x wf-recorder >/dev/null; then
|
||||||
pkill -x wl-screenrec
|
pkill -x wl-screenrec
|
||||||
pkill -x wf-recorder
|
pkill -x wf-recorder
|
||||||
notify-send "Screen recording saved to ~/Videos" -t 2000
|
notify-send "Screen recording saved to $OUTPUT_DIR" -t 2000
|
||||||
elif [[ "$1" == "output" ]]; then
|
elif [[ "$1" == "output" ]]; then
|
||||||
screenrecording
|
screenrecording
|
||||||
else
|
else
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
OUTPUT_DIR="${OMARCHY_SCREENSHOT_DIR:-$HOME/Pictures}"
|
[[ -f ~/.config/user-dirs.dirs ]] && source ~/.config/user-dirs.dirs
|
||||||
|
OUTPUT_DIR="${OMARCHY_SCREENSHOT_DIR:-${XDG_PICTURES_DIR:-$HOME/Pictures}}"
|
||||||
|
|
||||||
|
if [[ ! -d "$OUTPUT_DIR" ]]; then
|
||||||
|
notify-send "Screenshot directory does not exist: $OUTPUT_DIR" -u critical -t 3000
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
pkill slurp || hyprshot -m ${1:-region} --raw |
|
pkill slurp || hyprshot -m ${1:-region} --raw |
|
||||||
satty --filename - \
|
satty --filename - \
|
||||||
|
Reference in New Issue
Block a user