speedwm-mkpage: Auto-pushed speedwm changes!

This commit is contained in:
speediegq 2022-09-10 11:47:08 +02:00
parent 85a1e2620a
commit d069d8b680
5 changed files with 34 additions and 5 deletions

View file

@ -468,3 +468,11 @@ speedwm has a patching system. It allows you to create a patch with your changes
The only (obvious) problem with doing this is that eventually the backup files patches are being created against will be pretty old causing patches to no longer apply correctly. If this is the case you will need to create new patches and backups.
If this seems like more effort than it is worth, maintaining your own fork is always an option. This allows you to perform any options you want yourself. This however doesn't allow you to grab any updates so this should be your second choice.
## Additional note on autostart
If you wish to add autostart entries without recompiling, consider using $HOME/.config/speedwm-de/autostart.sh. This is a path added to autostart.h and you can fill it with anything you want.
Do note that it will NOT just run once. It will run every time you restart and start speedwm (signum 30 and 31 count as well).
To get around this, you may wrap stuff in a function in the script and have some way of checking if it has ran before. If it hasn't, call the function.
An alternative is to use the $HOME/.config/speedwm-de/autostart_once.sh path. This one is autostarted by speedwm_run and is therefore not hardcoded and not affected by speedwm restarting. Just like the previous autostart script, it does not exist so you need to create it.

View file

@ -14,7 +14,11 @@
#define STATUSBAR status
#define ICONSIZE sizeicon
#define ICONSPACING spacingicon
static const char *const autostart[] = {
/* Autostart script, if it exists */
shell, "-c", "ls $HOME/.config/speedwm-de/autostart.sh && $HOME/.config/speedwm-de/autostart.sh", NULL,
/* Bind Right Super+hjkl to arrow keys */
shell, "-c", "xmodmap -e 'keycode 134 = Mode_switch'", NULL,

View file

@ -25,3 +25,11 @@ speedwm has a patching system. It allows you to create a patch with your changes
The only (obvious) problem with doing this is that eventually the backup files patches are being created against will be pretty old causing patches to no longer apply correctly. If this is the case you will need to create new patches and backups.
If this seems like more effort than it is worth, maintaining your own fork is always an option. This allows you to perform any options you want yourself. This however doesn't allow you to grab any updates so this should be your second choice.
-- Additional note on autostart --
If you wish to add autostart entries without recompiling, consider using $HOME/.config/speedwm-de/autostart.sh. This is a path added to autostart.h and you can fill it with anything you want.
Do note that it will NOT just run once. It will run every time you restart and start speedwm (signum 30 and 31 count as well).
To get around this, you may wrap stuff in a function in the script and have some way of checking if it has ran before. If it hasn't, call the function.
An alternative is to use the $HOME/.config/speedwm-de/autostart_once.sh path. This one is autostarted by speedwm_run and is therefore not hardcoded and not affected by speedwm restarting. Just like the previous autostart script, it does not exist so you need to create it.

View file

@ -70,6 +70,7 @@ case "$ARG1" in
sed "s|-- .Xresources and Pywal --|## .Xresources and Pywal|g" | \
sed "s|-- Fsignal --|## Fsignal|g" | \
sed "s|-- What is up with /usr/share --|## What is up with /usr/share|g" | \
sed "s|-- Additional note on autostart --|## Additional note on autostart|g" | \
sed "s|-- Maintaining settings easily --|## Maintaining settings easily|g" | \
sed "s|-- Switching run launcher --|## Switching run launcher|g" > ../README.md ;;
"-whtml") tail -n $(expr $(cat /tmp/${PREFIX}doc | wc -l) "-" 1) /tmp/${PREFIX}doc | \
@ -92,6 +93,7 @@ case "$ARG1" in
sed "s|-- Fsignal --|## Fsignal|g" | \
sed "s|-- What is up with /usr/share --|## What is up with /usr/share|g" | \
sed "s|-- Maintaining settings easily --|## Maintaining settings easily|g" | \
sed "s|-- Additional note on autostart --|## Additional note on autostart|g" | \
sed "s|-- Switching run launcher --|## Switching run launcher|g" > ../README.md
markdown ../README.md > ../readme.html || printf "\nmarkdown-to-html not found, install using:\nnpm install markdown-to-html -g\n" && exit 1 ;;
"-whtml-wtemplate") test ../readme.html && cat ../docs/speedwm.html.template.1 ../readme.html ../docs/speedwm.html.template.2 >> ../speedwm.html && exit 0

View file

@ -68,6 +68,7 @@ LOADCONFIG() {
fi
}
# Load wallpaper config
LOADSWAL() {
if [ "$DONOTLOADCONFIG" = "true" ]; then
DONOTLOADCONFIG=true
@ -75,7 +76,13 @@ LOADSWAL() {
$HOME/.config/speedwm-de/swal/swal_wm > /dev/null
echo "Loaded wallpaper and pywal colors"
fi
}
# Autostart
AUTOSTART() {
if [ -e "$HOME/.config/speedwm-de/autostart_once.sh" ]; then
$HOME/.config/speedwm-de/autostart_once.sh
fi
}
# Reset speedwm
@ -170,20 +177,20 @@ DELETECONFIG() {
}
case "$ARGS" in
"") CHECKEXISTINGWM ; XRESOURCES ; LOADSWAL ; LOADCONFIG ; RESET ; START_DWM ; exit 0 ;;
"-s") ISSFLAG=true ; CHECKEXISTINGWM ; XRESOURCES ; LOADSWAL ; LOADCONFIG ; RESET ; START_DWM ; exit 0 ;;
"") CHECKEXISTINGWM ; XRESOURCES ; AUTOSTART ; LOADSWAL ; LOADCONFIG ; RESET ; START_DWM ; exit 0 ;;
"-s") ISSFLAG=true ; CHECKEXISTINGWM ; XRESOURCES ; AUTOSTART ; LOADSWAL ; LOADCONFIG ; RESET ; START_DWM ; exit 0 ;;
"-configure") CONFIGURE ; exit 0 ;;
"-r") XRESOURCES ; LOADSWAL ; LOADCONFIG ; RESET ; echo "Restarted speedwm." ; exit 0 ;;
"-rnoload") RESET ; echo "Restarted speedwm." ; exit 0 ;;
"-h") HELP ; exit 0 ;;
"-f") CARG="force" ; XRESOURCES ; LOADSWAL ; LOADCONFIG ; RESET ; START_DWM ; exit 0 ;;
"-f") CARG="force" ; XRESOURCES ; AUTOSTART ; LOADSWAL ; LOADCONFIG ; RESET ; START_DWM ; exit 0 ;;
"-loadconfig") LOADCONFIG ; exit 0 ;;
"-unloadconfig") UNLOADCONFIG ; RESET ; exit 0 ;;
"-deleteconfig") DELETECONFIG ; RESET ; exit 0 ;;
"-noxrdb") START_DWM ; exit 0 ;;
"-stop") pgrep -x speedwm && pkill speedwm ; echo "speedwm has been stopped." ; exit 0
echo "speedwm is not running, cannot stop it." ; exit 1 ;;
"-nomkconfig") CHECKEXISTINGWM ; XRESOURCES ; LOADSWAL ; RESET ; START_DWM ; exit 0 ;;
"-nomkconfig") CHECKEXISTINGWM ; XRESOURCES ; AUTOSTART ; LOADSWAL ; RESET ; START_DWM ; exit 0 ;;
esac
exit 0