waybox/data/autostart
2022-02-22 21:24:09 -05:00

32 lines
929 B
Bash

#
# These things are run when a Waybox Wayland session is started.
# Copy to $XDG_CONFIG_HOME/waybox/autostart to customize.
#
#
# Change from Openbox: the desktop environment's config tools should begin
# through autostart elements (e.g. /etc/xdg/autostart); there's no need to
# specify them here.
#
# Update the DBus environment
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_TYPE
# Start a dock
cairo-dock &
# Start a panel
(waybar || yambar) &
# Load a random wallpaper
oldifs=$IFS
IFS=:
for wpdir in ${XDG_DATA_DIRS:-${datadir:-/usr/share}}:${XDG_DATA_HOME:-~/.local/share};
do
find $wpdir -path '*/backgrounds/*.jpg' -o -path '*/backgrounds/*.png' -o -path '*/backgrounds/*.svg' \
-o -path '*/wallpapers/*.jpg' -o -path '*/wallpapers/*.png' -o -path '*/wallpapers/*.svg';
done | (shuf -n 1 || tail -n 1) | xargs swaybg -m fill -i &
IFS=$oldifs
# vim: ft=sh