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 \
|
tmux \
|
||||||
udisks2 \
|
udisks2 \
|
||||||
wev \
|
wev \
|
||||||
|
wf-recorder \
|
||||||
wl-clipboard \
|
wl-clipboard \
|
||||||
xdg-desktop-portal-wlr \
|
xdg-desktop-portal-wlr \
|
||||||
xournalpp \
|
xournalpp \
|
||||||
|
|
|
||||||
|
|
@ -245,6 +245,7 @@ bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
|
||||||
|
|
||||||
bindsym Print exec take-screenshot everything
|
bindsym Print exec take-screenshot everything
|
||||||
bindsym Shift+Print exec take-screenshot
|
bindsym Shift+Print exec take-screenshot
|
||||||
|
bindsym Pause exec kill -s INT $(pgrep wf-recorder)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Start a password manager in the scratchpad
|
# Start a password manager in the scratchpad
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,12 @@
|
||||||
#! /usr/bin/sh
|
#! /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')
|
touchpad=$(swaymsg -t get_inputs | jq -r '[.[] | select(.type == "touchpad")][0] | .libinput.send_events')
|
||||||
if [ "${touchpad}" = "enabled" ]; then
|
if [ "${touchpad}" = "enabled" ]; then
|
||||||
touchpad_active="✅"
|
touchpad_active="✅"
|
||||||
|
|
@ -77,4 +84,4 @@ case "${battery_state}" in
|
||||||
;;
|
;;
|
||||||
esac
|
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
|
#! /usr/bin/sh
|
||||||
|
|
||||||
listopts() {
|
listopts() {
|
||||||
echo "Focused monitor"
|
echo "📷 Focused monitor"
|
||||||
echo "Focused monitor → 📋"
|
echo "📷 Focused monitor → 📋"
|
||||||
echo "Select region"
|
echo "📷 Select region"
|
||||||
echo "Select region → 📋"
|
echo "📷 Select region → 📋"
|
||||||
echo "Focused window"
|
echo "📷 Focused window"
|
||||||
echo "Focused window → 📋"
|
echo "📷 Focused window → 📋"
|
||||||
echo "Select window"
|
echo "📷 Select 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() {
|
ts() {
|
||||||
echo ~/Photos/screenshots/$(date +'screenshot-%Y%m%dT%H%M%S.png')
|
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
|
if [ -z "$1" ]; then
|
||||||
|
|
@ -35,21 +47,29 @@ select_window() {
|
||||||
|
|
||||||
case "${option}" in
|
case "${option}" in
|
||||||
"everything")
|
"everything")
|
||||||
grim "$(gen_filename)";;
|
grim "$(screenshot_filename)";;
|
||||||
"Focused monitor")
|
"📷 Focused monitor")
|
||||||
grim -o "$(get_focused_monitor)" "$(gen_filename)";;
|
grim -o "$(get_focused_monitor)" "$(screenshot_filename)";;
|
||||||
"Focused monitor → 📋")
|
"📷 Focused monitor → 📋")
|
||||||
grim -o "$(get_focused_monitor)" - | wl-copy;;
|
grim -o "$(get_focused_monitor)" - | wl-copy;;
|
||||||
"Select region")
|
"📷 Select region")
|
||||||
grim -g "$(slurp)" "$(gen_filename)";;
|
grim -g "$(slurp)" "$(screenshot_filename)";;
|
||||||
"Select region → 📋")
|
"📷 Select region → 📋")
|
||||||
grim -g "$(slurp)" - | wl-copy;;
|
grim -g "$(slurp)" - | wl-copy;;
|
||||||
"Focused window")
|
"📷 Focused window")
|
||||||
grim -g "$(get_focused_window)" "$(gen_filename)";;
|
grim -g "$(get_focused_window)" "$(screenshot_filename)";;
|
||||||
"Focused window → 📋")
|
"📷 Focused window → 📋")
|
||||||
grim -g "$(get_focused_window)" - | wl-copy;;
|
grim -g "$(get_focused_window)" - | wl-copy;;
|
||||||
"Select window")
|
"📷 Select window")
|
||||||
grim -g "$(select_window)" "$(gen_filename)";;
|
grim -g "$(select_window)" "$(screenshot_filename)";;
|
||||||
"Select window → 📋")
|
"📷 Select window → 📋")
|
||||||
grim -g "$(select_window)" - | wl-copy;;
|
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
|
esac
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue