Compare commits
3 Commits
507ba45188
...
main
Author | SHA1 | Date | |
---|---|---|---|
d424fc0852 | |||
a27b458435 | |||
da689d2d0a |
@@ -8,7 +8,7 @@ set $right l
|
||||
|
||||
|
||||
# wf-recorder
|
||||
set $screenrecorder `bash $HOME/.config/sway/scripts/open-screen-recorder.sh`
|
||||
set $screenrecorder `bash $HOME/.config/sway/scripts/screen-recorder.sh`
|
||||
bindsym --to-code $mod+Shift+R exec $screenrecorder
|
||||
|
||||
# background
|
||||
|
@@ -1,14 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
main() {
|
||||
pid="$(pgrep "wf-recorder" || pgrep "slurp")"
|
||||
status=$?
|
||||
|
||||
if [[ $status != 0 ]]; then
|
||||
GEO="$(slurp)" && wf-recorder -g "$GEO" -f "$HOME/Videos/$(date +'recording_%Y-%m-%d-%H%M%S.mp4')"
|
||||
else
|
||||
pkill --signal SIGINT wf-recorder
|
||||
fi
|
||||
}
|
||||
|
||||
main $@
|
27
.config/sway/scripts/screen-recorder.sh
Executable file
27
.config/sway/scripts/screen-recorder.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
main() {
|
||||
pid="$(pgrep "wf-recorder" || pgrep "slurp")"
|
||||
status=$?
|
||||
|
||||
if [[ $status != 0 ]]; then
|
||||
if [[ -f ~/.config/user-dirs.dirs ]]; then
|
||||
source ~/.config/user-dirs.dirs
|
||||
fi
|
||||
|
||||
output_dir="${XDG_VIDEOS_DIR:-$HOME/Videos}"
|
||||
|
||||
if [[ ! -d "$output_dir" ]]; then
|
||||
notify-send "Screen recording output directory does not exist: $output_dir" -u critical -t 3000
|
||||
exit 1
|
||||
fi
|
||||
|
||||
filename="$output_dir/$(date +'recording_%Y-%m-%d-%H%M%S.mp4')"
|
||||
|
||||
region="$(slurp)" && wf-recorder -g "$region" -f "$filename"
|
||||
else
|
||||
pkill --signal SIGINT wf-recorder
|
||||
fi
|
||||
}
|
||||
|
||||
main $@
|
@@ -104,7 +104,7 @@
|
||||
"return-type": "json",
|
||||
"exec": "echo '{\"class\": \"recording\"}'",
|
||||
"exec-if": "pgrep wf-recorder",
|
||||
"on-click": "$HOME/.config/waybar/scripts/close-screen-recorder.sh"
|
||||
"on-click": "$HOME/.config/sway/scripts/screen-recorder.sh"
|
||||
},
|
||||
"privacy": {
|
||||
"icon-spacing": 4,
|
||||
@@ -215,9 +215,9 @@
|
||||
"network": {
|
||||
"interval": 3,
|
||||
"tooltip": true,
|
||||
"tooltip-format": "{ifname} via {gwaddr} ",
|
||||
"tooltip-format-wifi": "{ipaddr} ({ifname}) via {essid} ",
|
||||
"tooltip-format-ethernet": "{ipaddr} ({ifname}) via {essid} ",
|
||||
"tooltip-format": "{ifname} via {gwaddr}",
|
||||
"tooltip-format-wifi": "{ipaddr} ({ifname}) via {essid}\n\n⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}",
|
||||
"tooltip-format-ethernet": "{ipaddr} ({ifname}) via {essid}\n\n⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}",
|
||||
"tooltip-format-disconnected": "Disconnected",
|
||||
"format": "{ifname}",
|
||||
"format-icons": ["", "", "", "", ""],
|
||||
|
@@ -1,14 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
main() {
|
||||
data=""
|
||||
updates=$(checkupdates --nocolor 2>/dev/null)
|
||||
|
||||
if [[ $? -ne 0 || -z "$updates" ]]; then
|
||||
echo '{"text": "", "tooltip": ""}' | jq --unbuffered --compact-output
|
||||
data='{"text": "", "tooltip": ""}'
|
||||
else
|
||||
numberOfUpdates=$(echo "$updates" | wc -l)
|
||||
tooltip=$(echo "$updates" | sed 's/\n/\r/g' | jq -sR .)
|
||||
echo "{\"text\": \"$numberOfUpdates\", \"tooltip\": $tooltip}" | jq --unbuffered --compact-output
|
||||
data="{\"text\": \"$numberOfUpdates\", \"tooltip\": $tooltip}"
|
||||
fi
|
||||
|
||||
echo $data | jq --unbuffered --compact-output
|
||||
}
|
||||
|
||||
main "$@"
|
||||
main "$@"
|
||||
|
@@ -1,12 +0,0 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
main() {
|
||||
pid="$(pgrep "wf-recorder" || pgrep "slurp")"
|
||||
status=$?
|
||||
|
||||
if [[ $status == 0 ]]; then
|
||||
pkill --signal SIGINT wf-recorder
|
||||
fi
|
||||
}
|
||||
|
||||
main $@
|
Reference in New Issue
Block a user