Fix Wayland Startup Issues

- Make all notify-send commands non-blocking
  (i.e., run in background)
- Remove delay array from wayland startup
- Call startup script with `dwl -s`
This commit is contained in:
Sravan Balaji
2024-09-29 16:14:53 -04:00
parent e123f25cf7
commit 6a050b96f3
12 changed files with 117 additions and 197 deletions

View File

@@ -103,46 +103,46 @@ main() {
;;
--graphics-query)
current_graphics=$(sudo system76-power graphics)
notify-send "System76-Power Graphics" "$current_graphics"
notify-send "System76-Power Graphics" "$current_graphics" &
;;
--graphics-compute)
notify-send "System76-Power Graphics" "Switching to Compute Graphics..."
notify-send "System76-Power Graphics" "Switching to Compute Graphics..." &
sudo system76-power graphics compute
notify-send -u critical -t 0 "System76-Power Graphics" "Please reboot computer to switch graphics"
notify-send -u critical -t 0 "System76-Power Graphics" "Please reboot computer to switch graphics" &
;;
--graphics-hybrid)
notify-send "System76-Power Graphics" "Switching to Hybrid Graphics..."
notify-send "System76-Power Graphics" "Switching to Hybrid Graphics..." &
sudo system76-power graphics hybrid
notify-send -u critical -t 0 "System76-Power Graphics" "Please reboot computer to switch graphics"
notify-send -u critical -t 0 "System76-Power Graphics" "Please reboot computer to switch graphics" &
;;
--graphics-integrated)
notify-send "System76-Power Graphics" "Switching to Integrated Graphics..."
notify-send "System76-Power Graphics" "Switching to Integrated Graphics..." &
sudo system76-power graphics integrated
notify-send -u critical -t 0 "System76-Power Graphics" "Please reboot computer to switch graphics"
notify-send -u critical -t 0 "System76-Power Graphics" "Please reboot computer to switch graphics" &
;;
--graphics-nvidia)
notify-send "System76-Power Graphics" "Switching to Nvidia Graphics..."
notify-send "System76-Power Graphics" "Switching to Nvidia Graphics..." &
sudo system76-power graphics nvidia
notify-send -u critical -t 0 "System76-Power Graphics" "Please reboot computer to switch graphics"
notify-send -u critical -t 0 "System76-Power Graphics" "Please reboot computer to switch graphics" &
;;
--rofi-cpu-profile)
rofi_cpu_profile_menu
;;
--cpu-profile-query)
current_profile=$(sudo system76-power profile)
notify-send "System76-Power CPU Profile" "$current_profile"
notify-send "System76-Power CPU Profile" "$current_profile" &
;;
--cpu-profile-battery)
sudo system76-power profile battery
notify-send "System76-Power CPU Profile" "Switched to Battery Profile"
notify-send "System76-Power CPU Profile" "Switched to Battery Profile" &
;;
--cpu-profile-balanced)
sudo system76-power profile balanced
notify-send "System76-Power CPU Profile" "Switched to Balanced Profile"
notify-send "System76-Power CPU Profile" "Switched to Balanced Profile" &
;;
--cpu-profile-performance)
sudo system76-power profile performance
notify-send "System76-Power CPU Profile" "Switched to Performance Profile"
notify-send "System76-Power CPU Profile" "Switched to Performance Profile" &
;;
--rofi-gpu-profile)
rofi_gpu_profile_menu
@@ -150,33 +150,33 @@ main() {
--gpu-profile-query)
if [ $XDG_SESSION_TYPE == "x11" ]; then
current_profile=$(nvidia-settings -q GpuPowerMizerMode)
notify-send "NVIDIA GPU Profile" "$current_profile"
notify-send "NVIDIA GPU Profile" "$current_profile" &
elif [ $XDG_SESSION_TYPE == "wayland" ]; then
notify-send "NVIDIA GPU Profile not supported on Wayland"
notify-send "NVIDIA GPU Profile not supported on Wayland" &
fi
;;
--gpu-profile-adaptive)
if [ $XDG_SESSION_TYPE == "x11" ]; then
nvidia-settings -a "[gpu:0]/GpuPowerMizerMode=0"
notify-send "NVIDIA GPU Profile" "Switched to Adaptive Profile"
notify-send "NVIDIA GPU Profile" "Switched to Adaptive Profile" &
elif [ $XDG_SESSION_TYPE == "wayland" ]; then
notify-send "NVIDIA GPU Profile not supported on Wayland"
notify-send "NVIDIA GPU Profile not supported on Wayland" &
fi
;;
--gpu-profile-performance)
if [ $XDG_SESSION_TYPE == "x11" ]; then
nvidia-settings -a "[gpu:0]/GpuPowerMizerMode=1"
notify-send "NVIDIA GPU Profile" "Switched to Performance Profile"
notify-send "NVIDIA GPU Profile" "Switched to Performance Profile" &
elif [ $XDG_SESSION_TYPE == "wayland" ]; then
notify-send "NVIDIA GPU Profile not supported on Wayland"
notify-send "NVIDIA GPU Profile not supported on Wayland" &
fi
;;
--gpu-profile-auto)
if [ $XDG_SESSION_TYPE == "x11" ]; then
nvidia-settings -a "[gpu:0]/GpuPowerMizerMode=2"
notify-send "NVIDIA GPU Profile" "Switched to Auto Profile"
notify-send "NVIDIA GPU Profile" "Switched to Auto Profile" &
elif [ $XDG_SESSION_TYPE == "wayland" ]; then
notify-send "NVIDIA GPU Profile not supported on Wayland"
notify-send "NVIDIA GPU Profile not supported on Wayland" &
fi
;;
--rofi)