chore: update configs
This commit is contained in:
parent
fb086cb885
commit
d15fe0104c
@ -8,7 +8,7 @@ set $right l
|
|||||||
|
|
||||||
|
|
||||||
# wf-recorder
|
# wf-recorder
|
||||||
set $screenrecorder `bash $HOME/.config/sway/scripts/toggle-screen-recorder.sh`
|
set $screenrecorder `bash $HOME/.config/sway/scripts/open-screen-recorder.sh`
|
||||||
bindsym --to-code $mod+Shift+R exec $screenrecorder
|
bindsym --to-code $mod+Shift+R exec $screenrecorder
|
||||||
|
|
||||||
# background
|
# background
|
||||||
|
5
.config/sway/scripts/toggle-screen-recorder.sh → .config/sway/scripts/open-screen-recorder.sh
Normal file → Executable file
5
.config/sway/scripts/toggle-screen-recorder.sh → .config/sway/scripts/open-screen-recorder.sh
Normal file → Executable file
@ -1,9 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
local pid="$(pgrep "wf-recorder" || pgrep "slurp")"
|
pid="$(pgrep "wf-recorder" || pgrep "slurp")"
|
||||||
|
status=$?
|
||||||
|
|
||||||
if [[ $? != 0 ]]; then
|
if [[ $status != 0 ]]; then
|
||||||
GEO="$(slurp)" && wf-recorder -g "$GEO" -f "$HOME/Pictures/$(date +'recording_%Y-%m-%d-%H%M%S.mp4')"
|
GEO="$(slurp)" && wf-recorder -g "$GEO" -f "$HOME/Pictures/$(date +'recording_%Y-%m-%d-%H%M%S.mp4')"
|
||||||
else
|
else
|
||||||
pkill --signal SIGINT wf-recorder
|
pkill --signal SIGINT wf-recorder
|
@ -102,8 +102,8 @@
|
|||||||
"tooltip": true,
|
"tooltip": true,
|
||||||
"format": "{} ",
|
"format": "{} ",
|
||||||
"interval": 60,
|
"interval": 60,
|
||||||
"exec": "$HOME/.config/waybar/scripts/check_updates.sh",
|
"exec": "$HOME/.config/waybar/scripts/check-updates.sh",
|
||||||
"exec-if": "[[ `$HOME/.config/waybar/scripts/check_updates.sh` != 0 ]]",
|
"exec-if": "[[ `$HOME/.config/waybar/scripts/check-updates.sh` != 0 ]]",
|
||||||
"signal": 1
|
"signal": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -113,7 +113,8 @@
|
|||||||
"return-type": "json",
|
"return-type": "json",
|
||||||
"interval": 1,
|
"interval": 1,
|
||||||
"exec": "echo '{\"class\": \"recording\"}'",
|
"exec": "echo '{\"class\": \"recording\"}'",
|
||||||
"exec-if": "pgrep wf-recorder"
|
"exec-if": "pgrep wf-recorder",
|
||||||
|
"on-click": "$HOME/.config/waybar/scripts/close-screen-recorder.sh"
|
||||||
},
|
},
|
||||||
|
|
||||||
"custom/power": {
|
"custom/power": {
|
||||||
@ -188,7 +189,7 @@
|
|||||||
"format-plugged": "{capacity}% ",
|
"format-plugged": "{capacity}% ",
|
||||||
"format-icons": ["", "", "", "", "", ""],
|
"format-icons": ["", "", "", "", "", ""],
|
||||||
"tooltip-format": "{timeTo}\nCapacity: {capacity}%\nPower: {power:0.2f}w\nCycles: {cycles}\nHealth: {health}%",
|
"tooltip-format": "{timeTo}\nCapacity: {capacity}%\nPower: {power:0.2f}w\nCycles: {cycles}\nHealth: {health}%",
|
||||||
"on-update": "$HOME/.config/waybar/scripts/check_battery.sh"
|
"on-update": "$HOME/.config/waybar/scripts/check-battery.sh"
|
||||||
},
|
},
|
||||||
|
|
||||||
"disk": {
|
"disk": {
|
||||||
|
22
.config/waybar/scripts/check-battery.sh
Executable file
22
.config/waybar/scripts/check-battery.sh
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
bat="/sys/class/power_supply/BAT1"
|
||||||
|
crit="${1:-15}"
|
||||||
|
stat="$(cat $bat/status)"
|
||||||
|
perc="$(cat $bat/capacity)"
|
||||||
|
|
||||||
|
notifysend() {
|
||||||
|
local pid
|
||||||
|
local title="Low Battery"
|
||||||
|
local body="Current charge: $perc%"
|
||||||
|
|
||||||
|
notify-send --print-id --urgency=critical --icon=dialog-warning "$title" "$body"
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
if [[ "$stat" == "Discharging" ]] && [[ "$perc" -le "$crit" ]] && [[ ! -f "$file" ]]; then
|
||||||
|
notifysend
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main $@
|
@ -1,41 +0,0 @@
|
|||||||
#! /usr/bin/env bash
|
|
||||||
|
|
||||||
file=~/.config/waybar/scripts/lowbat
|
|
||||||
bat="/sys/class/power_supply/BAT1"
|
|
||||||
crit="${1:-15}"
|
|
||||||
stat="$(cat $bat/status)"
|
|
||||||
perc="$(cat $bat/capacity)"
|
|
||||||
|
|
||||||
notifysend() {
|
|
||||||
local pid
|
|
||||||
local title="Low Battery"
|
|
||||||
local body="Current charge: $perc%"
|
|
||||||
if [[ ! -f "$file" ]]; then
|
|
||||||
pid="$(notify-send --print-id --urgency=critical --icon=dialog-warning "$title" "$body")"
|
|
||||||
else
|
|
||||||
pid="$(notify-send --print-id --replace-id="$(cat $file)" --urgency=critical --icon=dialog-warning "$title" "$body")"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo $pid > $file
|
|
||||||
}
|
|
||||||
|
|
||||||
main() {
|
|
||||||
if [[ "$stat" == "Discharging" ]] && [[ "$perc" -le "$crit" ]] && [[ ! -f "$file" ]]; then
|
|
||||||
notifysend
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -f "$file" ]]; then
|
|
||||||
case "$stat" in
|
|
||||||
"Charging" )
|
|
||||||
rm $file
|
|
||||||
;;
|
|
||||||
"Discharging" )
|
|
||||||
notifysend
|
|
||||||
;;
|
|
||||||
* );;
|
|
||||||
esac
|
|
||||||
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
main $@
|
|
12
.config/waybar/scripts/close-screen-recorder.sh
Executable file
12
.config/waybar/scripts/close-screen-recorder.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
main() {
|
||||||
|
pid="$(pgrep "wf-recorder" || pgrep "slurp")"
|
||||||
|
status=$?
|
||||||
|
|
||||||
|
if [[ $status == 0 ]]; then
|
||||||
|
pkill --signal SIGINT wf-recorder
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main $@
|
Loading…
x
Reference in New Issue
Block a user