From 6a050b96f39da5e08808df7c985a07514be4cf65 Mon Sep 17 00:00:00 2001 From: Sravan Balaji Date: Sun, 29 Sep 2024 16:14:53 -0400 Subject: [PATCH] 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` --- README.org | 162 +++++++++--------------- deadd/.scripts/deadd.sh | 8 +- dunst/.scripts/dunst.sh | 4 +- dwl/.scripts/session.sh | 12 +- dwl/.scripts/wayland-startup.sh | 58 ++------- dwl/.winitrc | 8 +- naughty/.scripts/naughty.sh | 4 +- picom/.scripts/picom.sh | 4 +- shikane/.config/shikane/config.toml | 4 +- system76/.scripts/cpu-gpu.sh | 42 +++--- trackpad/.scripts/trackpad.sh | 4 +- xfce4-notifyd/.scripts/xfce4-notifyd.sh | 4 +- 12 files changed, 117 insertions(+), 197 deletions(-) diff --git a/README.org b/README.org index 832e061..e1a1049 100644 --- a/README.org +++ b/README.org @@ -684,10 +684,10 @@ main() { # Start Dunst /usr/bin/dunst -config ~/.config/dunst/dunstrc & - notify-send "Turning Dunst ON" + notify-send "Turning Dunst ON" & ;; --off) - notify-send "Turning Dunst OFF" + notify-send "Turning Dunst OFF" & if [ $(is_running) -eq '1' ]; then pkill dunst @@ -1207,10 +1207,10 @@ main() { boolean:deadd-notification-center:true \ string:type:reloadStyle - notify-send "Turning Deadd ON" + notify-send "Turning Deadd ON" & ;; --off) - notify-send "Turning Deadd OFF" + notify-send "Turning Deadd OFF" & if [ $(is_running) -eq '1' ]; then pkill deadd-notificat @@ -1220,7 +1220,7 @@ main() { kill -s USR1 $(pidof deadd-notification-center) ;; --pause) - notify-send "Pausing Notifications" + notify-send "Pausing Notifications" & /usr/bin/notify-send.py a --hint \ boolean:deadd-notification-center:true \ @@ -1231,7 +1231,7 @@ main() { boolean:deadd-notification-center:true \ string:type:unpausePopups > /dev/null 2>&1 - notify-send "Unpausing Notifications" + notify-send "Unpausing Notifications" & ;; --rofi) rofi_menu @@ -1290,7 +1290,7 @@ main() { ' ;; --pause) - notify-send "Pausing Notifications" + notify-send "Pausing Notifications" & /usr/bin/awesome-client ' local naughty = require("naughty") @@ -1303,7 +1303,7 @@ main() { naughty.resume() ' - notify-send "Unpausing Notifications" + notify-send "Unpausing Notifications" & ;; --rofi) rofi_menu @@ -1964,14 +1964,14 @@ main() { xfce4-notifyd-config ;; --pause) - notify-send "Pausing Notifications" + notify-send "Pausing Notifications" & xfconf-query -c xfce4-notifyd -p /do-not-disturb -s true ;; --unpause) xfconf-query -c xfce4-notifyd -p /do-not-disturb -s false - notify-send "Unpausing Notifications" + notify-send "Unpausing Notifications" & ;; --rofi) rofi_menu @@ -3563,14 +3563,14 @@ main() { picom --config $HOME/.config/picom/picom.conf -b - notify-send "Turning Picom ON" + notify-send "Turning Picom ON" & ;; --off) if [ $(is_running) -eq '1' ]; then pkill picom fi - notify-send "Turning Picom OFF" + notify-send "Turning Picom OFF" & ;; --rofi) rofi_menu @@ -3808,7 +3808,7 @@ postlock() { #+BEGIN_SRC toml :tangle shikane/.config/shikane/config.toml [[profile]] name = "docked" -exec = ["notify-send shikane \"Profile $SHIKANE_PROFILE_NAME has been applied\""] +exec = ["notify-send shikane \"Profile $SHIKANE_PROFILE_NAME has been applied\" &"] [[profile.output]] enable = false @@ -3847,7 +3847,7 @@ adaptive_sync = false #+BEGIN_SRC toml :tangle shikane/.config/shikane/config.toml [[profile]] name = "mobile" -exec = ["notify-send shikane \"Profile $SHIKANE_PROFILE_NAME has been applied\""] +exec = ["notify-send shikane \"Profile $SHIKANE_PROFILE_NAME has been applied\" &"] [[profile.output]] enable = true @@ -9037,58 +9037,30 @@ export _JAVA_AWT_WM_NONREPARENTING=1 # Java fix for Window Managers export XDG_CURRENT_DESKTOP=wlroots # Set XDG current desktop #+END_SRC -**** Stop Startup Applications & Processes - -#+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle dwl/.winitrc -$HOME/.scripts/wayland-startup.sh --kill-startup -$HOME/.scripts/wayland-startup.sh --kill-delay -#+END_SRC - **** Launch Environment #+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle dwl/.winitrc -dwl & -#+END_SRC +$HOME/.scripts/wayland-startup.sh --kill-startup -**** Startup Applications & Processes - -#+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle dwl/.winitrc -sleep 2 -$HOME/.scripts/wayland-startup.sh --startup & -sleep 3 -$HOME/.scripts/wayland-startup.sh --delay & +exec dwl -s 'sleep 5 && $HOME/.scripts/wayland-startup.sh --startup' #+END_SRC *** Wayland Startup #+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle dwl/.scripts/wayland-startup.sh declare -a startup_array=(\ - # Display / Compositor Setup - "/usr/bin/shikane" \ # Display Setup - "/usr/bin/bash $HOME/.azotebg" \ # Wallpaper - "/usr/bin/gammastep -x" \ # Reset gammastep night light # Background Processes "/usr/libexec/polkit-gnome-authentication-agent-1" \ # GNOME Polkit Authentication Agent "/usr/bin/kdeconnectd --replace" \ # KDE Connect Daemon - "/usr/bin/bash $HOME/.scripts/dunst.sh" \ # Dunst Notification Daemon + "$HOME/.scripts/dunst.sh --on" \ # Dunst Notification Daemon "/usr/bin/wl-paste --type text --watch cliphist store" \ # Clipboard for Text "/usr/bin/wl-paste --type image --watch cliphist store" \ # Clipboard for Images -) - -declare -a kill_startup_array=(\ # Display / Compositor Setup - "pkill shikane" \ - "pkill gammastep" \ - # Background Processes - "pkill polkit-gnome-au" \ - "pkill kdeconnectd" \ - "pkill dunst" \ - "pkill wl-paste" \ -) - -declare -a delay_array=(\ + "/usr/bin/shikane" \ # Display Setup + "$HOME/.azotebg" \ # Wallpaper + "/usr/bin/gammastep -x" \ # Reset gammastep night light # Status Bar - "/usr/bin/sh -c $HOME/.config/dwl/waybar/launch.sh" \ # Waybar (dwl configuration) + "$HOME/.config/dwl/waybar/launch.sh" \ # Waybar (dwl configuration) # Tray Applications "/usr/bin/gammastep-indicator" \ # Gamamstep Night Light Indicator "/usr/bin/blueman-applet" \ # Bluetooth Manager Applet @@ -9101,7 +9073,15 @@ declare -a delay_array=(\ "/usr/bin/openrgb" \ # OpenRGB ) -declare -a kill_delay_array=(\ +declare -a kill_startup_array=(\ + # Background Processes + "pkill polkit-gnome-au" \ + "pkill kdeconnectd" \ + "$HOME/.scripts/dunst.sh --off" \ + "pkill wl-paste" \ + # Display / Compositor Setup + "pkill shikane" \ + "pkill gammastep" \ # Status Bar "pkill waybar" \ # Tray Applications @@ -9129,9 +9109,7 @@ help_menu() { rofi_menu() { declare -a options=( " Launch Startup Processes - startup" - "󰔟 Launch Delayed Processes - delay" " Kill Startup Processes - kill-startup" - " Kill Delayed Processes - kill-delay" "󰌍 Back - back" "󰗼 Quit - quit" ) @@ -9166,17 +9144,6 @@ main() { fi done ;; - --delay) - for i in "${delay_array[@]}" - do - if ! command -v $i > /dev/null - then - do_nothing() { :; } - else - $i & - fi - done - ;; --kill-startup) for i in "${kill_startup_array[@]}" do @@ -9188,17 +9155,6 @@ main() { fi done ;; - --kill-delay) - for i in "${kill_delay_array[@]}" - do - if ! command -v $i > /dev/null - then - do_nothing() { :; } - else - $i & - fi - done - ;; --rofi) rofi_menu ;; @@ -9580,10 +9536,10 @@ trackpad_id=13 if xinput list-props $trackpad_id | grep "Device Enabled (.*):.*1" >/dev/null then xinput disable $trackpad_id - notify-send -u low -i mouse "Trackpad disabled" + notify-send -u low -i mouse "Trackpad disabled" & else xinput enable $trackpad_id - notify-send -u low -i mouse "Trackpad enabled" + notify-send -u low -i mouse "Trackpad enabled" & fi #+END_SRC @@ -9694,46 +9650,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 @@ -9741,33 +9697,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) @@ -9885,27 +9841,27 @@ main() { help_menu ;; --logout) - notify-send "Session Control" "Logging Out of dwl" + notify-send "Session Control" "Logging Out of dwl" & pkill dwl ;; --lock) - notify-send "Session Control" "Locking Session" + notify-send "Session Control" "Locking Session" & swaylock ;; --sleep) - notify-send "Session Control" "Going to Sleep" + notify-send "Session Control" "Going to Sleep" & systemctl suspend ;; --reboot) - notify-send "Session Control" "Rebooting System" + notify-send "Session Control" "Rebooting System" & systemctl reboot ;; --shutdown) - notify-send "Session Control" "Shutting Down System" + notify-send "Session Control" "Shutting Down System" & systemctl poweroff ;; --hibernate) - notify-send "Session Control" "Hibernating System" + notify-send "Session Control" "Hibernating System" & systemctl hibernate ;; --rofi) diff --git a/deadd/.scripts/deadd.sh b/deadd/.scripts/deadd.sh index cbb0b21..cfc8a67 100755 --- a/deadd/.scripts/deadd.sh +++ b/deadd/.scripts/deadd.sh @@ -66,10 +66,10 @@ main() { boolean:deadd-notification-center:true \ string:type:reloadStyle - notify-send "Turning Deadd ON" + notify-send "Turning Deadd ON" & ;; --off) - notify-send "Turning Deadd OFF" + notify-send "Turning Deadd OFF" & if [ $(is_running) -eq '1' ]; then pkill deadd-notificat @@ -79,7 +79,7 @@ main() { kill -s USR1 $(pidof deadd-notification-center) ;; --pause) - notify-send "Pausing Notifications" + notify-send "Pausing Notifications" & /usr/bin/notify-send.py a --hint \ boolean:deadd-notification-center:true \ @@ -90,7 +90,7 @@ main() { boolean:deadd-notification-center:true \ string:type:unpausePopups > /dev/null 2>&1 - notify-send "Unpausing Notifications" + notify-send "Unpausing Notifications" & ;; --rofi) rofi_menu diff --git a/dunst/.scripts/dunst.sh b/dunst/.scripts/dunst.sh index 309232d..088d958 100755 --- a/dunst/.scripts/dunst.sh +++ b/dunst/.scripts/dunst.sh @@ -75,10 +75,10 @@ main() { # Start Dunst /usr/bin/dunst -config ~/.config/dunst/dunstrc & - notify-send "Turning Dunst ON" + notify-send "Turning Dunst ON" & ;; --off) - notify-send "Turning Dunst OFF" + notify-send "Turning Dunst OFF" & if [ $(is_running) -eq '1' ]; then pkill dunst diff --git a/dwl/.scripts/session.sh b/dwl/.scripts/session.sh index 4ce8e88..daaca6d 100755 --- a/dwl/.scripts/session.sh +++ b/dwl/.scripts/session.sh @@ -41,27 +41,27 @@ main() { help_menu ;; --logout) - notify-send "Session Control" "Logging Out of dwl" + notify-send "Session Control" "Logging Out of dwl" & pkill dwl ;; --lock) - notify-send "Session Control" "Locking Session" + notify-send "Session Control" "Locking Session" & swaylock ;; --sleep) - notify-send "Session Control" "Going to Sleep" + notify-send "Session Control" "Going to Sleep" & systemctl suspend ;; --reboot) - notify-send "Session Control" "Rebooting System" + notify-send "Session Control" "Rebooting System" & systemctl reboot ;; --shutdown) - notify-send "Session Control" "Shutting Down System" + notify-send "Session Control" "Shutting Down System" & systemctl poweroff ;; --hibernate) - notify-send "Session Control" "Hibernating System" + notify-send "Session Control" "Hibernating System" & systemctl hibernate ;; --rofi) diff --git a/dwl/.scripts/wayland-startup.sh b/dwl/.scripts/wayland-startup.sh index d2b6cc3..3fae133 100755 --- a/dwl/.scripts/wayland-startup.sh +++ b/dwl/.scripts/wayland-startup.sh @@ -1,31 +1,17 @@ #!/usr/bin/env bash declare -a startup_array=(\ - # Display / Compositor Setup - "/usr/bin/shikane" \ # Display Setup - "/usr/bin/bash $HOME/.azotebg" \ # Wallpaper - "/usr/bin/gammastep -x" \ # Reset gammastep night light # Background Processes "/usr/libexec/polkit-gnome-authentication-agent-1" \ # GNOME Polkit Authentication Agent "/usr/bin/kdeconnectd --replace" \ # KDE Connect Daemon - "/usr/bin/bash $HOME/.scripts/dunst.sh" \ # Dunst Notification Daemon + "$HOME/.scripts/dunst.sh --on" \ # Dunst Notification Daemon "/usr/bin/wl-paste --type text --watch cliphist store" \ # Clipboard for Text "/usr/bin/wl-paste --type image --watch cliphist store" \ # Clipboard for Images -) - -declare -a kill_startup_array=(\ # Display / Compositor Setup - "pkill shikane" \ - "pkill gammastep" \ - # Background Processes - "pkill polkit-gnome-au" \ - "pkill kdeconnectd" \ - "pkill dunst" \ - "pkill wl-paste" \ -) - -declare -a delay_array=(\ + "/usr/bin/shikane" \ # Display Setup + "$HOME/.azotebg" \ # Wallpaper + "/usr/bin/gammastep -x" \ # Reset gammastep night light # Status Bar - "/usr/bin/sh -c $HOME/.config/dwl/waybar/launch.sh" \ # Waybar (dwl configuration) + "$HOME/.config/dwl/waybar/launch.sh" \ # Waybar (dwl configuration) # Tray Applications "/usr/bin/gammastep-indicator" \ # Gamamstep Night Light Indicator "/usr/bin/blueman-applet" \ # Bluetooth Manager Applet @@ -38,7 +24,15 @@ declare -a delay_array=(\ "/usr/bin/openrgb" \ # OpenRGB ) -declare -a kill_delay_array=(\ +declare -a kill_startup_array=(\ + # Background Processes + "pkill polkit-gnome-au" \ + "pkill kdeconnectd" \ + "$HOME/.scripts/dunst.sh --off" \ + "pkill wl-paste" \ + # Display / Compositor Setup + "pkill shikane" \ + "pkill gammastep" \ # Status Bar "pkill waybar" \ # Tray Applications @@ -66,9 +60,7 @@ help_menu() { rofi_menu() { declare -a options=( " Launch Startup Processes - startup" - "󰔟 Launch Delayed Processes - delay" " Kill Startup Processes - kill-startup" - " Kill Delayed Processes - kill-delay" "󰌍 Back - back" "󰗼 Quit - quit" ) @@ -103,17 +95,6 @@ main() { fi done ;; - --delay) - for i in "${delay_array[@]}" - do - if ! command -v $i > /dev/null - then - do_nothing() { :; } - else - $i & - fi - done - ;; --kill-startup) for i in "${kill_startup_array[@]}" do @@ -125,17 +106,6 @@ main() { fi done ;; - --kill-delay) - for i in "${kill_delay_array[@]}" - do - if ! command -v $i > /dev/null - then - do_nothing() { :; } - else - $i & - fi - done - ;; --rofi) rofi_menu ;; diff --git a/dwl/.winitrc b/dwl/.winitrc index a16d45c..6dee8ae 100755 --- a/dwl/.winitrc +++ b/dwl/.winitrc @@ -10,11 +10,5 @@ export _JAVA_AWT_WM_NONREPARENTING=1 # Java fix for Window Managers export XDG_CURRENT_DESKTOP=wlroots # Set XDG current desktop $HOME/.scripts/wayland-startup.sh --kill-startup -$HOME/.scripts/wayland-startup.sh --kill-delay -dwl & - -sleep 2 -$HOME/.scripts/wayland-startup.sh --startup & -sleep 3 -$HOME/.scripts/wayland-startup.sh --delay & +exec dwl -s 'sleep 5 && $HOME/.scripts/wayland-startup.sh --startup' diff --git a/naughty/.scripts/naughty.sh b/naughty/.scripts/naughty.sh index ef9289a..271f401 100755 --- a/naughty/.scripts/naughty.sh +++ b/naughty/.scripts/naughty.sh @@ -43,7 +43,7 @@ main() { ' ;; --pause) - notify-send "Pausing Notifications" + notify-send "Pausing Notifications" & /usr/bin/awesome-client ' local naughty = require("naughty") @@ -56,7 +56,7 @@ main() { naughty.resume() ' - notify-send "Unpausing Notifications" + notify-send "Unpausing Notifications" & ;; --rofi) rofi_menu diff --git a/picom/.scripts/picom.sh b/picom/.scripts/picom.sh index a6e4636..66f1102 100755 --- a/picom/.scripts/picom.sh +++ b/picom/.scripts/picom.sh @@ -57,14 +57,14 @@ main() { picom --config $HOME/.config/picom/picom.conf -b - notify-send "Turning Picom ON" + notify-send "Turning Picom ON" & ;; --off) if [ $(is_running) -eq '1' ]; then pkill picom fi - notify-send "Turning Picom OFF" + notify-send "Turning Picom OFF" & ;; --rofi) rofi_menu diff --git a/shikane/.config/shikane/config.toml b/shikane/.config/shikane/config.toml index 219dd33..06ceff8 100644 --- a/shikane/.config/shikane/config.toml +++ b/shikane/.config/shikane/config.toml @@ -1,6 +1,6 @@ [[profile]] name = "docked" -exec = ["notify-send shikane \"Profile $SHIKANE_PROFILE_NAME has been applied\""] +exec = ["notify-send shikane \"Profile $SHIKANE_PROFILE_NAME has been applied\" &"] [[profile.output]] enable = false @@ -35,7 +35,7 @@ adaptive_sync = false [[profile]] name = "mobile" -exec = ["notify-send shikane \"Profile $SHIKANE_PROFILE_NAME has been applied\""] +exec = ["notify-send shikane \"Profile $SHIKANE_PROFILE_NAME has been applied\" &"] [[profile.output]] enable = true diff --git a/system76/.scripts/cpu-gpu.sh b/system76/.scripts/cpu-gpu.sh index 3194b27..748aedb 100755 --- a/system76/.scripts/cpu-gpu.sh +++ b/system76/.scripts/cpu-gpu.sh @@ -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) diff --git a/trackpad/.scripts/trackpad.sh b/trackpad/.scripts/trackpad.sh index 2bb6027..e219609 100755 --- a/trackpad/.scripts/trackpad.sh +++ b/trackpad/.scripts/trackpad.sh @@ -4,8 +4,8 @@ trackpad_id=13 if xinput list-props $trackpad_id | grep "Device Enabled (.*):.*1" >/dev/null then xinput disable $trackpad_id - notify-send -u low -i mouse "Trackpad disabled" + notify-send -u low -i mouse "Trackpad disabled" & else xinput enable $trackpad_id - notify-send -u low -i mouse "Trackpad enabled" + notify-send -u low -i mouse "Trackpad enabled" & fi diff --git a/xfce4-notifyd/.scripts/xfce4-notifyd.sh b/xfce4-notifyd/.scripts/xfce4-notifyd.sh index 9925e59..18180d5 100755 --- a/xfce4-notifyd/.scripts/xfce4-notifyd.sh +++ b/xfce4-notifyd/.scripts/xfce4-notifyd.sh @@ -40,14 +40,14 @@ main() { xfce4-notifyd-config ;; --pause) - notify-send "Pausing Notifications" + notify-send "Pausing Notifications" & xfconf-query -c xfce4-notifyd -p /do-not-disturb -s true ;; --unpause) xfconf-query -c xfce4-notifyd -p /do-not-disturb -s false - notify-send "Unpausing Notifications" + notify-send "Unpausing Notifications" & ;; --rofi) rofi_menu