initial commit of record-location

This commit is contained in:
vaguesyntax
2025-11-01 14:38:16 +03:00
parent bf87ed69ce
commit e567f06cef
3 changed files with 85 additions and 48 deletions
@@ -460,6 +460,10 @@ Singleton {
} }
} }
property JsonObject screenRecord: JsonObject {
property string savePath: Directories.videos
}
property JsonObject sounds: JsonObject { property JsonObject sounds: JsonObject {
property bool battery: false property bool battery: false
property bool pomodoro: false property bool pomodoro: false
@@ -85,6 +85,25 @@ ContentPage {
} }
ContentSection {
icon: "screen_record"
title: Translation.tr("Screen Recording")
ContentSubsection {
title: Translation.tr("Save path") + " (example: /home/user/Videos)"
MaterialTextArea {
Layout.fillWidth: true
placeholderText: Translation.tr("Path")
text: Config.options.screenRecord.savePath
wrapMode: TextEdit.Wrap
onTextChanged: {
Config.options.screenRecord.savePath = text;
}
}
}
}
ContentSection { ContentSection {
icon: "search" icon: "search"
title: Translation.tr("Search") title: Translation.tr("Search")
@@ -1,5 +1,18 @@
#!/usr/bin/env bash #!/usr/bin/env bash
CONFIG_FILE="$HOME/.config/illogical-impulse/config.json"
JSON_PATH=".screenRecord.savePath"
CUSTOM_PATH=$(jq -r "$JSON_PATH" "$CONFIG_FILE" 2>/dev/null)
RECORDING_DIR=""
if [[ -n "$CUSTOM_PATH" ]]; then
RECORDING_DIR="$CUSTOM_PATH"
else
RECORDING_DIR="$HOME/Videos"
fi
getdate() { getdate() {
date '+%Y-%m-%d_%H.%M.%S' date '+%Y-%m-%d_%H.%M.%S'
} }
@@ -10,12 +23,13 @@ getactivemonitor() {
hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .name' hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .name'
} }
xdgvideo="$(xdg-user-dir VIDEOS)" # ORİJİNAL XDG MANTIĞI SİLİNDİ, YERİNE SADECE YENİ DEĞİŞKEN KULLANILDI
if [[ $xdgvideo = "$HOME" ]]; then # xdgvideo="$(xdg-user-dir VIDEOS)"
unset xdgvideo # if $xdgvideo = "$HOME" ]]; then
fi # unset xdgvideo
mkdir -p "${xdgvideo:-$HOME/Videos}" # fi
cd "${xdgvideo:-$HOME/Videos}" || exit mkdir -p "$RECORDING_DIR"
cd "$RECORDING_DIR" || exit
# parse --region <value> without modifying $@ so other flags like --fullscreen still work # parse --region <value> without modifying $@ so other flags like --fullscreen still work
ARGS=("$@") ARGS=("$@")