From 5015cfc93bf7035197b3e549f5d07bc5131ddd4d Mon Sep 17 00:00:00 2001 From: Sravan Balaji Date: Sat, 1 Aug 2020 14:36:39 -0400 Subject: [PATCH] Merge All Autostart Applications & Blocking Processes into Master - Ignore applications if they don't exist rather than having separate branches for desktop and laptop - Re-organize scripts to define arrays and run applications with for loops --- autostart.sh | 53 ++++++++++++++++++++++--------------------- autostart_blocking.sh | 22 ++++++++++++++---- 2 files changed, 45 insertions(+), 30 deletions(-) diff --git a/autostart.sh b/autostart.sh index 005de2e..74c23c6 100755 --- a/autostart.sh +++ b/autostart.sh @@ -1,34 +1,35 @@ #!/bin/bash -############################ -# System Tray Applications # -############################ -# PulseAudio volume control -volctl & - -# Nyrna -nyrna & - -# Blueman -blueman-tray & - -# Network Manager Applet -nm-applet & - -# KDE Connect -kdeconnect-indicator & - ######################## -# Background Processes # +# Startup Applications # ######################## -# Deadd Notification Center -deadd-notification-center & +# List of applications to run on start +declare -a applications_array=(\ + # System Tray Applications + "volctl" \ # PulseAudio Volume Control + "nyrna" \ # Nyrna Application Suspend + "blueman-tray" \ # Blueman Bluetooth Manager + "nm-applet" \ # Network Manager Applet + "kdeconnect-indicator" \ # KDE Connect + # Background Processes + "deadd-notification-center" \ # Deadd Notification Center + "greenclip daemon" \ # Greenclip Clipboard Manager + "redshift-gtk" \ # Redshift Blue Light Filter + # Hardware Driver Applications + "solaar --window=hide" \ # Logitech Mouse Driver + "polychromatic-tray-applet" \ # Razer Keyboard Customization +) -# Greenclip -greenclip daemon & - -# Redshift -redshift-gtk & +# Run applications (ignore if they don't exist) +for i in "${applications_array[@]}" +do + if ! command -v $i > /dev/null + then + do_nothing() { :; } + else + $i & + fi +done ##################### # Cloud Drive Rsync # diff --git a/autostart_blocking.sh b/autostart_blocking.sh index 08471ba..6324e75 100755 --- a/autostart_blocking.sh +++ b/autostart_blocking.sh @@ -1,7 +1,21 @@ #!/bin/bash -# Start compositor using configuration file -picom --config ~/.config/picom/picom.conf & +############################## +# Startup Blocking Processes # +############################## +# List of processes to run on start +declare -a processes_array=(\ + "picom --config ~/.config/picom/picom.conf" \ # Start compositor using configuration file + "nitrogen --restore" \ # Restore wallpaper +) -# Restore wallpaper -nitrogen --restore & +# Run processes (ignore if they don't exist) +for i in "${processes_array[@]}" +do + if ! command -v $i > /dev/null + then + do_nothing() { :; } + else + $i & + fi +done