Fix Autorandr/Lock Screen Bug

- Had a bug where autorandr would run after waking up from sleep
  which ran the postswitch script which would restart the window
  manager session, thus displaying the windows ON TOP of the lock
  screen
- Added a simple check to only restart session if i3lock (what
  betterlockscreen uses) is not running
This commit is contained in:
Sravan Balaji
2024-02-28 17:32:24 -05:00
parent e4e2adf3eb
commit 0ff957f9a3
2 changed files with 32 additions and 8 deletions

View File

@@ -1,5 +1,17 @@
#!/bin/bash #!/bin/bash
/home/sravan/.scripts/session.sh --restart & # Restart dwm # Check if screen is not currently locked
/usr/bin/nvidia-force-comp-pipeline & # NVIDIA Force Composition Pipeline if ! pgrep -x "i3lock" > /dev/null
/usr/bin/nitrogen --restore & # Restore wallpaper then
/usr/bin/betterlockscreen -u /home/sravan/Documents/Wallpapers/Desktop/Solar_System.png & # Update lock screen wallpaper # Restart session
/home/sravan/.scripts/session.sh --restart &
fi
# NVIDIA Force Composition Pipeline
/usr/bin/nvidia-force-comp-pipeline &
# Restore wallpaper
/usr/bin/nitrogen --restore &
# Update lock screen wallpaper
/usr/bin/betterlockscreen -u \
/home/sravan/Documents/Wallpapers/Desktop/Solar_System.png &

View File

@@ -3069,10 +3069,22 @@ See [[https://github.com/phillipberndt/autorandr#hook-scripts][autorandr hook sc
*** Post Switch *** Post Switch
#+BEGIN_SRC shell :shebang #!/bin/bash :tangle .config/autorandr/postswitch #+BEGIN_SRC shell :shebang #!/bin/bash :tangle .config/autorandr/postswitch
/home/sravan/.scripts/session.sh --restart & # Restart dwm # Check if screen is not currently locked
/usr/bin/nvidia-force-comp-pipeline & # NVIDIA Force Composition Pipeline if ! pgrep -x "i3lock" > /dev/null
/usr/bin/nitrogen --restore & # Restore wallpaper then
/usr/bin/betterlockscreen -u /home/sravan/Documents/Wallpapers/Desktop/Solar_System.png & # Update lock screen wallpaper # Restart session
/home/sravan/.scripts/session.sh --restart &
fi
# NVIDIA Force Composition Pipeline
/usr/bin/nvidia-force-comp-pipeline &
# Restore wallpaper
/usr/bin/nitrogen --restore &
# Update lock screen wallpaper
/usr/bin/betterlockscreen -u \
/home/sravan/Documents/Wallpapers/Desktop/Solar_System.png &
#+END_SRC #+END_SRC
** Compositor ** Compositor