daily configuration optimization
Fix - airplay: systemd wantedBy target - fcitx5: remove redundant systemd service Remove - move scripts into configuration Style - ghostty: add more transparency to background Add - zellij
This commit is contained in:
parent
44c152fdc9
commit
9c9acc3494
24 changed files with 941 additions and 856 deletions
|
|
@ -5,51 +5,60 @@
|
|||
let
|
||||
record = pkgs.writeShellScript "toggle-wf-record" ''
|
||||
PID_FILE="/tmp/wf-recorder.pid"
|
||||
OUTPUT_DIR="$HOME/Videos/recordings"
|
||||
FILENAME="$OUTPUT_DIR/recording_$(date +%Y%m%d_%H%M%S).mp4"
|
||||
SINK_DEV="$(${pkgs.pulseaudio.out}/bin/pactl get-default-sink).monitor"
|
||||
|
||||
declare -A recordOptions=(
|
||||
[Monitor]="${pkgs.slurp}/bin/slurp -o"
|
||||
[Area]="${pkgs.slurp}/bin/slurp"
|
||||
)
|
||||
if [[ $1 = "toggle" ]]; then
|
||||
OUTPUT_DIR="$HOME/Videos/recordings"
|
||||
FILENAME="$OUTPUT_DIR/recording_$(date +%Y%m%d_%H%M%S).mp4"
|
||||
SINK_DEV="$(${pkgs.pulseaudio.out}/bin/pactl get-default-sink).monitor"
|
||||
|
||||
if [[ -f "$PID_FILE" ]]; then
|
||||
pid=$(cat "$PID_FILE")
|
||||
declare -A recordOptions=(
|
||||
[Monitor]="${pkgs.slurp}/bin/slurp -o"
|
||||
[Area]="${pkgs.slurp}/bin/slurp"
|
||||
)
|
||||
|
||||
if kill "$pid" 2>/dev/null; then
|
||||
rm "$PID_FILE"
|
||||
echo "Stopped recording"
|
||||
notify-send " RECORD" "Recording saved to $FILENAME"
|
||||
if [[ -f "$PID_FILE" ]]; then
|
||||
pid=$(cat "$PID_FILE")
|
||||
|
||||
if kill "$pid" 2>/dev/null; then
|
||||
rm "$PID_FILE"
|
||||
echo "Stopped recording"
|
||||
notify-send " RECORD" "Recording saved to $FILENAME"
|
||||
else
|
||||
echo "No process found, cleaning up"
|
||||
notify-send " RECORD" "Failed: No process found, cleaning up"
|
||||
rm "$PID_FILE"
|
||||
fi
|
||||
else
|
||||
echo "No process found, cleaning up"
|
||||
notify-send " RECORD" "Failed: No process found, cleaning up"
|
||||
rm "$PID_FILE"
|
||||
# Start recording
|
||||
choice=$(printf "%s\n" "''\${!recordOptions[@]}" | rofi -i -dmenu -config ~/.config/rofi/config.rasi -p "Which mode")
|
||||
|
||||
if [[ -z "$choice" ]]; then
|
||||
notify-send " RECORD" "Cancelled"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$OUTPUT_DIR"
|
||||
|
||||
geometry="$(''\${recordOptions[$choice]})"
|
||||
|
||||
if [[ -z "$geometry" ]]; then
|
||||
notify-send " RECORD" "Cancelled"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
${pkgs.wf-recorder}/bin/wf-recorder -y \
|
||||
-g "$geometry" \
|
||||
--audio="$SINK_DEV" \
|
||||
-f "$FILENAME" &
|
||||
echo $! > "$PID_FILE"
|
||||
echo "Started recording: $FILENAME"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f "$PID_FILE" ]; then
|
||||
jq -nc --arg text "on" --arg class "on" '{text: $text, class: $class, alt: $class}'
|
||||
else
|
||||
# Start recording
|
||||
choice=$(printf "%s\n" "''\${!recordOptions[@]}" | rofi -i -dmenu -config ~/.config/rofi/config.rasi -p "Which mode")
|
||||
|
||||
if [[ -z "$choice" ]]; then
|
||||
notify-send " RECORD" "Cancelled"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$OUTPUT_DIR"
|
||||
|
||||
geometry="$(''\${recordOptions[$choice]})"
|
||||
|
||||
if [[ -z "$geometry" ]]; then
|
||||
notify-send " RECORD" "Cancelled"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
${pkgs.wf-recorder}/bin/wf-recorder -y \
|
||||
-g "$geometry" \
|
||||
--audio="$SINK_DEV" \
|
||||
-f "$FILENAME" &
|
||||
echo $! > "$PID_FILE"
|
||||
echo "Started recording: $FILENAME"
|
||||
jq -nc --arg text "off" --arg class "off" '{text: $text, class: $class, alt: $class}'
|
||||
fi
|
||||
'';
|
||||
in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue