Support screen recordings
This commit is contained in:
parent
c1ea8fb375
commit
87b525839c
4 changed files with 53 additions and 24 deletions
|
|
@ -44,6 +44,7 @@ syncthing \
|
|||
tmux \
|
||||
udisks2 \
|
||||
wev \
|
||||
wf-recorder \
|
||||
wl-clipboard \
|
||||
xdg-desktop-portal-wlr \
|
||||
xournalpp \
|
||||
|
|
|
|||
|
|
@ -245,6 +245,7 @@ bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
|
|||
|
||||
bindsym Print exec take-screenshot everything
|
||||
bindsym Shift+Print exec take-screenshot
|
||||
bindsym Pause exec kill -s INT $(pgrep wf-recorder)
|
||||
|
||||
#
|
||||
# Start a password manager in the scratchpad
|
||||
|
|
|
|||
|
|
@ -1,5 +1,12 @@
|
|||
#! /usr/bin/sh
|
||||
|
||||
recordings=$(pgrep wf-recorder | wc -l)
|
||||
if [ "${recordings}" = "0" ]; then
|
||||
recs=""
|
||||
else
|
||||
recs="📽${recordings}"
|
||||
fi
|
||||
|
||||
touchpad=$(swaymsg -t get_inputs | jq -r '[.[] | select(.type == "touchpad")][0] | .libinput.send_events')
|
||||
if [ "${touchpad}" = "enabled" ]; then
|
||||
touchpad_active="✅"
|
||||
|
|
@ -77,4 +84,4 @@ case "${battery_state}" in
|
|||
;;
|
||||
esac
|
||||
|
||||
echo 🕹️${touchpad_active} 📆${today} ${clock_face}${now} ${audio_symbol}${audio_volume}% ${battery_symbol}${battery}%
|
||||
echo ${recs} 🕹️${touchpad_active} 📆${today} ${clock_face}${now} ${audio_symbol}${audio_volume}% ${battery_symbol}${battery}%
|
||||
|
|
|
|||
|
|
@ -1,18 +1,30 @@
|
|||
#! /usr/bin/sh
|
||||
|
||||
listopts() {
|
||||
echo "Focused monitor"
|
||||
echo "Focused monitor → 📋"
|
||||
echo "Select region"
|
||||
echo "Select region → 📋"
|
||||
echo "Focused window"
|
||||
echo "Focused window → 📋"
|
||||
echo "Select window"
|
||||
echo "Select window → 📋"
|
||||
echo "📷 Focused monitor"
|
||||
echo "📷 Focused monitor → 📋"
|
||||
echo "📷 Select region"
|
||||
echo "📷 Select region → 📋"
|
||||
echo "📷 Focused window"
|
||||
echo "📷 Focused window → 📋"
|
||||
echo "📷 Select window"
|
||||
echo "📷 Select window → 📋"
|
||||
echo "📽 Record focused monitor"
|
||||
echo "📽 Record select region"
|
||||
echo "📽 Record focused window"
|
||||
echo "📽 Record select window"
|
||||
}
|
||||
|
||||
gen_filename() {
|
||||
echo ~/Photos/screenshots/$(date +'screenshot-%Y%m%dT%H%M%S.png')
|
||||
ts() {
|
||||
date +'%Y%m%dT%H%M%S'
|
||||
}
|
||||
|
||||
screenshot_filename() {
|
||||
echo ~/Photos/screenshots/screenshot-$(ts).png
|
||||
}
|
||||
|
||||
recording_filename() {
|
||||
echo ~/Photos/screenshots/recording-$(ts).mp4
|
||||
}
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
|
|
@ -35,21 +47,29 @@ select_window() {
|
|||
|
||||
case "${option}" in
|
||||
"everything")
|
||||
grim "$(gen_filename)";;
|
||||
"Focused monitor")
|
||||
grim -o "$(get_focused_monitor)" "$(gen_filename)";;
|
||||
"Focused monitor → 📋")
|
||||
grim "$(screenshot_filename)";;
|
||||
"📷 Focused monitor")
|
||||
grim -o "$(get_focused_monitor)" "$(screenshot_filename)";;
|
||||
"📷 Focused monitor → 📋")
|
||||
grim -o "$(get_focused_monitor)" - | wl-copy;;
|
||||
"Select region")
|
||||
grim -g "$(slurp)" "$(gen_filename)";;
|
||||
"Select region → 📋")
|
||||
"📷 Select region")
|
||||
grim -g "$(slurp)" "$(screenshot_filename)";;
|
||||
"📷 Select region → 📋")
|
||||
grim -g "$(slurp)" - | wl-copy;;
|
||||
"Focused window")
|
||||
grim -g "$(get_focused_window)" "$(gen_filename)";;
|
||||
"Focused window → 📋")
|
||||
"📷 Focused window")
|
||||
grim -g "$(get_focused_window)" "$(screenshot_filename)";;
|
||||
"📷 Focused window → 📋")
|
||||
grim -g "$(get_focused_window)" - | wl-copy;;
|
||||
"Select window")
|
||||
grim -g "$(select_window)" "$(gen_filename)";;
|
||||
"Select window → 📋")
|
||||
"📷 Select window")
|
||||
grim -g "$(select_window)" "$(screenshot_filename)";;
|
||||
"📷 Select window → 📋")
|
||||
grim -g "$(select_window)" - | wl-copy;;
|
||||
"📽 Record focused monitor")
|
||||
wf-recorder -o "$(get_focused_monitor)" -f "$(recording_filename)";;
|
||||
"📽 Record select region")
|
||||
wf-recorder -g "$(slurp)" -f "$(recording_filename)";;
|
||||
"📽 Record focused window")
|
||||
wf-recorder -g "$(get_focused_window)" -f "$(recording_filename)";;
|
||||
"📽 Record select window")
|
||||
wf-recorder -g "$(select_window)" -f "$(recording_filename)";;
|
||||
esac
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue