Files
dotfiles/dwl/.scripts/wayland-startup.sh
Sravan Balaji a5938074a9 Clean Up Wayland Init Script and Startup
- Re-org system settings setion to split into
  x11 and wayland
- Add wayland startup script
- Add .winitrc with env vars and startup script
  for wayland sessions (e.g., dwl)
- Update dwl config to disable autostart and env var patches
2024-09-29 14:53:32 -04:00

117 lines
3.5 KiB
Bash
Executable File

#!/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
"/usr/bin/wl-paste --type text --watch cliphist store" \ # Clipboard for Text
"/usr/bin/wl-paste --type image --watch cliphist store" \ # Clipboard for Images
# Tray Applications
"/usr/bin/gammastep-indicator" \ # Gamamstep Night Light Indicator
"/usr/bin/blueman-applet" \ # Bluetooth Manager Applet
"/usr/bin/nm-applet" \ # Network Manager Applet
"/usr/bin/kdeconnect-indicator" \ # KDE Connect Indicator
"/usr/bin/udiskie -a -n -s" \ # Udiskie
# Status Bar
"/usr/bin/sh -c $HOME/.config/dwl/waybar/launch.sh" \ # Waybar (dwl configuration)
# GUI Applications
"/usr/bin/nextcloud" \ # NextCloud Client
"/usr/bin/syncthing-gtk" \ # Syncthing GUI
"/usr/bin/openrgb" \ # OpenRGB
)
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" \
# Tray Applications
"pkill gammastep-indic" \
"pkill blueman-applet" \
"pkill nm-applet" \
"pkill kdeconnect-indi" \
"pkill udiskie" \
# Status Bar
"pkill waybar" \
# GUI Applications
"pkill nextcloud" \
"pkill syncthing-gtk" \
"pkill openrgb" \
)
help_menu() {
echo "Main script to launch and kill startup processes. Use only one argument at a time."
# echo " - Play / Pause: playerctl.sh --play-pause"
# echo " - Next: playerctl.sh --next"
# echo " - Previous: playerctl.sh --prev"
# echo " - Change Player: playerctl.sh --change"
# echo " - Rofi Menu: playerctl.sh --rofi"
# echo " - Help: playerctl.sh --help OR playerctl.sh -h"
}
rofi_menu() {
declare -a options=(
" Launch Startup Processes - startup"
" Kill Startup Processes - kill-startup"
"󰌍 Back - back"
"󰗼 Quit - quit"
)
choice=$(printf '%s\n' "${options[@]}" | rofi -dmenu -i)
option=$(printf '%s\n' "${choice}" | awk '{print $NF}')
if [[ "$option" == "quit" ]]; then
pkill rofi
elif [[ "$option" != "back" ]]; then
main "--$option" && main "--rofi"
fi
}
main() {
if [ $# -eq 0 ]; then
# No arguments
help_menu
else
case $1 in
--help | -h)
help_menu
;;
--startup)
for i in "${startup_array[@]}"
do
if ! command -v $i > /dev/null
then
do_nothing() { :; }
else
$i &
fi
done
;;
--kill-startup)
for i in "${kill_startup_array[@]}"
do
if ! command -v $i > /dev/null
then
do_nothing() { :; }
else
$i &
fi
done
;;
--rofi)
rofi_menu
;;
esac
fi
}
main $@