if [ -e "$HOME/.config/speedwm-de/global/config" ]; then
. $HOME/.config/speedwm-de/global/config
else
mkdir -p $HOME/.config/speedwm-de/global
printf "HAVE_GRID=$HAVE_GRID # Whether or not to use the Grid argument. If you do not have the dmenu grid patch, set this to false. Doing so will disable grid." > $HOME/.config/speedwm-de/global/config
echo "! This is your speedwm configuration file. It is configured in .Xresources syntax." >> $HOME/.config/speedwm-de/speedwmrc && echo "Wrote comment 2"
echo "! It is loaded on startup but you can reload it during runtime by running $0 -r.\n" >> $HOME/.config/speedwm-de/speedwmrc && echo "Wrote comment 3"
sed "s| - ||g" /usr/share/example.Xresources >> $HOME/.config/speedwm-de/speedwmrc && echo "Wrote example configuration file"
fi
fi
fi
}
LOADSWAL() {
if [ "$DONOTLOADCONFIG" = "true" ]; then
DONOTLOADCONFIG=true
else
$HOME/.config/speedwm-de/swal/swal_wm > /dev/null
echo "Loaded wallpaper and pywal colors"
fi
}
# Reset speedwm
RESET() {
if [ "$DONOTRELOAD" = "true" ]; then
DONOTRELOAD=true
else
xsetroot -name "Loading" # To hide the ugly fsignal status
xsetroot -name "fsignal:31" # Send fsignal to restart speedwm
xsetroot -name "Loading" # To hide the ugly fsignal status
fi
}
# Check for running window managers
CHECKEXISTINGWM() {
if [ "$CARG" = "force" ]; then
echo "WARNING: Bypassing all checks (due to -f argument). Use this with caution!"
else
pgrep -x speedwm > /dev/null && echo "speedwm is already running. Use $0 -r to restart it."
printf "speedwm\nNo arguments | Start speedwm using default options\n-s | Start speedwm using either sx or startx. This does not require you to use a .xinitrc file. Simply install xinit/sx and run speedwm -s\n-f | Start speedwm bypassing all checks (such as whether or not a window manager is running)\n-noxrdb | Start speedwm without loading colors.\n-nomkconfig | Start speedwm without creating a config file (or loading it)\n-h | View this list of arguments\n-r | Restart speedwm and reload colors\n-loadconfig | Load and create config if it does not exist\n-unloadconfig | Unload the speedwm configuration\n-deleteconfig | Delete the speedwm configuration\n-rnoload | Restart speedwm without reloading colors\n-configure | Bring up a list of speedwm-de dotfiles in $RUNLAUNCHER and ask the user which one to open in \$EDITOR inside \$TERMINAL"