stow_dotfiles/hyprland/.config/hypr/scripts/Refresh.sh
Matthieu Fortin (CPC/CCP) e281b79c5c hyprland config
2024-09-18 11:56:48 -04:00

46 lines
841 B
Bash
Executable file

#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Scripts for refreshing ags waybar, rofi, swaync, wallust
SCRIPTSDIR=$HOME/.config/hypr/scripts
UserScripts=$HOME/.config/hypr/UserScripts
# Define file_exists function
file_exists() {
if [ -e "$1" ]; then
return 0 # File exists
else
return 1 # File does not exist
fi
}
# Kill already running processes
_ps=(waybar rofi swaync ags)
for _prs in "${_ps[@]}"; do
if pidof "${_prs}" >/dev/null; then
pkill "${_prs}"
fi
done
# quit ags
ags -q
sleep 0.3
#Restart waybar
waybar &
# relaunch swaync
sleep 0.5
swaync > /dev/null 2>&1 &
# relaunch ags
ags &
# Relaunching rainbow borders if the script exists
sleep 1
if file_exists "${UserScripts}/RainbowBorders.sh"; then
${UserScripts}/RainbowBorders.sh &
fi
exit 0