I have a shell script that contains startup logic for apps that are supposed to run after the Awesome window manager is up and running. Currently, it launches both polybar and picom. Picom works fine, but Polybar does not start at all.
#!/bin/sh
# See https://wiki.archlinux.org/title/Awesome#Autostart
run() {
if ! pgrep -f "$1" ;
then
"$@"&
fi
}
run "~/.config/polybar/launch.sh"
run "picom --experimental-backends -b"
rc.lua fires the shell script from above after everything is initialized. Meaning that the following code is sitting at the end of my rc file.
-- See https://wiki.archlinux.org/title/Awesome#Autostart
awful.spawn.with_shell("~/.config/awesome/autorun.sh")
~/.config/polybar/launch.sh:
#!/bin/bash
# Terminate already running bar instances
killall -q polybar
# If all your bars have ipc enabled, you can also use
# polybar-msg cmd quit
# Launch Polybar, using default config location ~/.config/polybar/config.ini
polybar mybar 2>&1 | tee -a /tmp/polybar.log & disown
echo "Polybar launched..."
The strange thing is that when I run ~/.config/polybar/launch.sh from the terminal, it runs perfectly fine. Why does it not start when launched from my window manager (from the rc.lua file to be exact)?