aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/RefreshNoWaybar.sh
blob: be06167cefe7bb7be41577d3f6230759643c063a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash

# Modified version of Refresh but no waybar refresh
# Used by automatic wallpaper change
# Modified inorder to refresh rofi background, Pywal

SCRIPTSDIR=$HOME/.config/hypr/scripts
UserSCRIPTSDIR=$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=(rofi)
for _prs in "${_ps[@]}"; do
    if pidof "${_prs}" >/dev/null; then
        pkill "${_prs}"
    fi
done

# Pywal refresh
${SCRIPTSDIR}/PywalSwww.sh &

# Relaunching rainbow borders if the script exists
sleep 1
if file_exists "${UserSCRIPTSDIR}/RainbowBorders.sh"; then
    ${UserSCRIPTSDIR}/RainbowBorders.sh &
fi

# for cava-pywal (note, need to manually restart cava once wallpaper changes)
ln -sf "$HOME/.cache/wal/cava-colors" "$HOME/.config/cava/config" || true

exit 0
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage