Add notify scripts
This commit is contained in:
parent
b43c4905cc
commit
33768e8e91
5 changed files with 62 additions and 0 deletions
11
usr/share/river/scripts/brightness-notify.sh
Executable file
11
usr/share/river/scripts/brightness-notify.sh
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
VALUE=$(light -G | cut -d'.' -f1)
|
||||
TEXT="Brightness: ${VALUE}%"
|
||||
|
||||
notify-send \
|
||||
--expire-time 800 \
|
||||
--hint string:x-canonical-private-synchronous:brightness \
|
||||
--hint "int:value:$VALUE" \
|
||||
--hint "int:transient:1" \
|
||||
"${TEXT}"
|
15
usr/share/river/scripts/dunst.sh
Executable file
15
usr/share/river/scripts/dunst.sh
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
COUNT=$(dunstctl count waiting)
|
||||
ENABLED=
|
||||
DISABLED=
|
||||
|
||||
if [ $COUNT != 0 ]; then
|
||||
DISABLED=" $COUNT"
|
||||
fi
|
||||
|
||||
if dunstctl is-paused | grep -q "false" ; then
|
||||
echo $ENABLED
|
||||
else
|
||||
echo $DISABLED
|
||||
fi
|
6
usr/share/river/scripts/flock.sh
Executable file
6
usr/share/river/scripts/flock.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env sh
|
||||
HASH="$(echo "$@" | shasum | cut -f1 -d" " | cut -c1-7)"
|
||||
|
||||
mkdir -p "$HOME/.local/state"
|
||||
|
||||
flock --verbose -n "$HOME/.local/state/${HASH}.lock" "$@"
|
8
usr/share/river/scripts/screenshot-notify.sh
Executable file
8
usr/share/river/scripts/screenshot-notify.sh
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
DIR=${XDG_PICTURES_DIR:-$HOME/Pictures}
|
||||
|
||||
while true; do
|
||||
mkdir -p "$DIR" && inotifywait -q -e create "$DIR" --format '%w%f' | xargs notify-send "Screenshot saved"
|
||||
done
|
22
usr/share/river/scripts/volume-notify.sh
Executable file
22
usr/share/river/scripts/volume-notify.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh
|
||||
|
||||
VOLUME=$(pulsemixer --get-volume)
|
||||
# get first percent value
|
||||
VOLUME=${VOLUME%%%*}
|
||||
VOLUME=${VOLUME##* }
|
||||
|
||||
TEXT="Volume: ${VOLUME}%"
|
||||
case $(pulsemixer --get-mute) in
|
||||
*1)
|
||||
TEXT="Volume: muted"
|
||||
VOLUME=0
|
||||
;;
|
||||
esac
|
||||
|
||||
notify-send \
|
||||
--app-name sway \
|
||||
--expire-time 800 \
|
||||
--hint string:x-canonical-private-synchronous:volume \
|
||||
--hint "int:value:$VOLUME" \
|
||||
--hint "int:transient:1" \
|
||||
"${TEXT}"
|
Loading…
Add table
Reference in a new issue