mirror of
https://git.adityakumar.xyz/betterlockscreen-openrc.git
synced 2024-11-09 10:39:45 +00:00
Don't change state of dunst on unlock if paused on lock (#233)
* Fix: Don't change state of dunst on unlock if paused on lock (credits to @souravdas142)
This commit is contained in:
parent
a64ce8f441
commit
321b8e8c5f
1 changed files with 7 additions and 4 deletions
|
@ -40,6 +40,9 @@ init_config () {
|
|||
wallpaper_cmd="feh --bg-fill --no-fehbg"
|
||||
time_format="%H:%M:%S"
|
||||
|
||||
# Storing current state of dunst before locking
|
||||
dunst_paused_state="$(dunstctl is-paused)"
|
||||
|
||||
# read user config
|
||||
USER_CONF="$HOME/.config/betterlockscreenrc"
|
||||
if [ -e "$USER_CONF" ]; then
|
||||
|
@ -82,8 +85,8 @@ prelock() {
|
|||
if [ "$DEFAULT_DPMS" == "Enabled" ]; then
|
||||
xset dpms "$lock_timeout"
|
||||
fi
|
||||
# pause dunst
|
||||
if command -v dunstctl &>/dev/null
|
||||
# If dusnt is already paused don't pause it again
|
||||
if [[ -e "$(command -v dunstctl)" && "$dunst_paused_state" == "false" ]]
|
||||
then
|
||||
dunstctl set-paused true
|
||||
fi
|
||||
|
@ -149,8 +152,8 @@ postlock() {
|
|||
xset dpms "$DEFAULT_TIMEOUT"
|
||||
fi
|
||||
|
||||
# unpause dunst
|
||||
if command -v dunstctl &>/dev/null
|
||||
# If dunst already paused before locking don't unpause dunst
|
||||
if [[ -e "$(command -v dunstctl)" && "$dunst_paused_state" == "false" ]]
|
||||
then
|
||||
dunstctl set-paused false
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue