speedwm-mkpage: Auto-pushed speedwm changes!

This commit is contained in:
speediegq 2022-09-09 11:13:25 +02:00
parent f2d171ca38
commit d79b774ea7
8 changed files with 214 additions and 59 deletions

View file

@ -47,6 +47,11 @@ install: all
touch drw.o speedwm.o util.o
mkdir -p ${DESTDIR}${PREFIX}/bin
[ -f speedwm-msg ] && cp -f speedwm speedwm-msg ${DESTDIR}${PREFIX}/bin || :
# Copy backup files
[ -f docs/options.def.h ] || cp -f options.h docs/options.def.h || :
[ -f docs/options.def.mk ] || cp -f options.mk docs/options.def.mk || :
[ -f docs/toggle.def.h ] || cp -f toggle.h docs/toggle.def.h || :
[ -f docs/toggle.def.mk ] || cp -f toggle.mk docs/toggle.def.mk || :
chmod 755 ${DESTDIR}${PREFIX}/bin/speedwm
[ -f speedwm-msg ] && chmod 755 ${DESTDIR}${PREFIX}/bin/speedwm-msg || :
cp -f docs/bindlist ${DESTDIR}${PREFIX}/share/speedwm-bindlist
@ -83,7 +88,7 @@ install: all
rm -f drw.o speedwm.o util.o speedwm speedwm-msg ; echo "Installed speedwm to ${DESTDIR}${PREFIX}/bin"
uninstall:
rm -f ${DESTDIR}${PREFIX}/bin/speedwm\
rm -f ${DESTDIR}${PREFIX}/bin/speedwm \
${DESTDIR}${PREFIX}/bin/speedwm-utils \
${DESTDIR}${PREFIX}/bin/speedwm-audioctrl \
${DESTDIR}${PREFIX}/bin/speedwm-winnav \
@ -97,6 +102,7 @@ uninstall:
${DESTDIR}${PREFIX}/bin/speedwm-pdfopen \
${DESTDIR}${PREFIX}/bin/speedwm-core \
${DESTDIR}${PREFIX}/bin/speedwm-dfmpeg \
${DESTDIR}${PREFIX}/bin/speedwm-msg \
${DESTDIR}${PREFIX}/bin/status \
${DESTDIR}${PREFIX}/share/speedwm-bindlist \
${DESTDIR}${PREFIX}/share/speedwm-deplist \
@ -113,23 +119,63 @@ docs:
./scripts/speedwm-help -a -o
help:
@echo speedwm help
@echo -- speedwm Makefile help --
@echo
@echo - Installation -
@echo install: Installs speedwm. You may need to run this as root.
@echo uninstall: Uninstalls speedwm. You may need to run this as root.
@echo
@echo - Patching -
@echo patch: Create a patch based on modifications to source code.
@echo patch_install: Patch the patches directly to source code.
@echo patch_remove: Remove the patches from source code.
@echo patch_clean: Remove patches for the current directory.
@echo patch_remove_backups: Remove backups from docs/.
@echo
@echo - LibXft -
@echo Note that often, this is no longer necessary. Check with your distro maintainers to see if they have updated libXft after bgra was merged.
@echo libxftfix: This option compiles and installs libXft-bgra which is necessary to prevent speedwm from crashing.
@echo gentoo-libxftfix: This option installs libXft-bgra by patching it for Gentoo only.
@echo arch-libxftfix: This option installs libXft-bgra using the AUR on Arch Linux only.
@echo
@echo - Documentation -
@echo help: Displays this help sheet.
@echo docs: View documentation for speedwm
@echo html: Write HTML document based on documentation.
@echo markdown: Write Markdown document based on documentation.
@echo readme: Write output of speedwm-help -a to readme.
@echo upload: git commit and git push this build.
@echo
@echo - Page -
@echo page: Creates the https://speedie.gq/speedwm page in HTML form.
@echo page_install: Copy the page to ${HTMLDIR}.
@echo page_push: git commit and git push the page in ${HTMLDIR}.
@echo make page page_install page_push to do all of the above page changes instantly.
@echo make release to run make markdown, make upload, make page, make page_install, make page_push instantly.
@echo page page_install page_push to do all of the above page changes instantly.
@echo
@echo - Releasing -
@echo release to run make markdown, make upload, make page, make page_install, make page_push instantly.
@echo dist to create a tarball.
patch:
chmod +x scripts/mkpatch
./scripts/mkpatch
@echo Created patches.
patch_install:
chmod +x scripts/mkpatch
./scripts/mkpatch -p
patch_remove:
chmod +x scripts/mkpatch
./scripts/mkpatch -r
patch_clean:
rm -f *.patch
@echo Removed patches for cd.
patch_remove_backups:
rm -f docs/*.def*
@echo Removed *.def* files.
release:
rm -f speedwm.html

View file

@ -238,10 +238,13 @@ Instead, config.h is split into different parts to make it easier to edit. Inste
- autostart.h for starting stuff right before speedwm (For example xclip, pywal, etc.)
- options.h for changing colors and applications to use with keybinds.
- fsignal.h for adding fake signals
- colors.h for changing alpha options, most users won't need to edit it.
- xresources.h for adding .Xresources options
- rules.h for adding rules
- colors.h for changing alpha options and color options, most users won't need to edit it.
- xresources.h for adding/removing .Xresources options
- rules.h for adding/removing rules
- keybinds.h for adding/removing keybinds.
- mouse.h for adding/removing mouse binds.
- ipccmd.h for adding/removing IPC commands. (If support is compiled in)
- toggle.h for adding/removing features from getting compiled in.
After you've edited one of the files, you need to run 'make clean install' to reinstall speedwm.
Remember that you can change colors through your .Xresources file (see .Xresources and Pywal) meaning you do not need to recompile speedwm.
@ -261,10 +264,10 @@ This fork of speedwm has .Xresources support thanks to the .Xresources patch.
It also has pywal support (tool which grabs colors based on your wallpaper).
Colors reload automagically because of a reloadxresources function this build has combined with fsignal and a wallpaper script I wrote.
Therefore, if you want colors to reload instantly, you're unfortunately forced to use the bundled wallpaper script.
Therefore, if you want colors to reload instantly, you're unfortunately forced to use the bundled wallpaper script. But that's alright because it's pretty good.
If you want to use another script, you can open up speedwm-utils and select 'Reload .Xresources' to reload .Xresources.
Alternatively, you can write a script yourself (18 reloads the colors)
Alternatively, you can write a script yourself (fsignal 31 reloads the colors)
Below is a list of all .Xresources values you can define. The .Xresources file should be placed in ~ or ~/.config by the user.
If it is not or you want it somewhere else, you can edit 'autostart.h' and 'make clean install'.

View file

@ -5,23 +5,64 @@
* Once you're done with your edits, run 'make clean install'. */
static Signal signals[] = {
/* signum function argument */
{ 1, setlayout, {.v = &layouts[0]} },
{ 2, setlayout, {.v = &layouts[1]} },
{ 3, setlayout, {.v = &layouts[2]} },
{ 4, setlayout, {.v = &layouts[3]} },
{ 5, setlayout, {.v = &layouts[4]} },
{ 6, setlayout, {.v = &layouts[5]} },
{ 7, setlayout, {.v = &layouts[6]} },
{ 8, setlayout, {.v = &layouts[7]} },
{ 9, setlayout, {.v = &layouts[8]} },
{ 10, setlayout, {.v = &layouts[9]} },
{ 11, setlayout, {.v = &layouts[10]} },
{ 12, setlayout, {.v = &layouts[11]} },
{ 13, setlayout, {.v = &layouts[12]} },
{ 14, setlayout, {.v = &layouts[13]} },
{ 15, setlayout, {.v = &layouts[14]} },
{ 16, cyclelayout, {.i = -1 } },
{ 17, cyclelayout, {.i = +1 } },
#if LAYOUT_TILE
{ 1, setlayout, {.v = &layouts[0]} }, // Tiling layout
#endif
{ 2, setlayout, {.v = &layouts[1]} }, // Floating layout
#if LAYOUT_MONOCLE
{ 3, setlayout, {.v = &layouts[2]} }, // Monocle layout
#endif
#if LAYOUT_GRID
{ 4, setlayout, {.v = &layouts[3]} }, // Grid layout
#endif
#if LAYOUT_DECK
{ 5, setlayout, {.v = &layouts[4]} }, // Deck layout
#endif
#if LAYOUT_CM
{ 6, setlayout, {.v = &layouts[5]} }, // Centered Master layout
#endif
#if LAYOUT_CFM
{ 7, setlayout, {.v = &layouts[6]} }, // Centered Floating Master layout
#endif
#if LAYOUT_SPIRAL
{ 8, setlayout, {.v = &layouts[7]} }, // Fibonacci Spiral layout
#endif
#if LAYOUT_DWINDLE
{ 9, setlayout, {.v = &layouts[8]} }, // Fibonacci Dwindle layout
#endif
#if LAYOUT_TCL
{ 10, setlayout, {.v = &layouts[9]} }, // Three Column layout
#endif
#if LAYOUT_BSTACK
{ 11, setlayout, {.v = &layouts[10]} }, // Bottom Stack layout
#endif
#if LAYOUT_BSTACKH
{ 12, setlayout, {.v = &layouts[11]} }, // Horizontal Bottom Stack layout
#endif
#if LAYOUT_HGRID
{ 13, setlayout, {.v = &layouts[12]} }, // Horizontal Grid layout
#endif
#if LAYOUT_TATAMI
{ 14, setlayout, {.v = &layouts[13]} }, // Tatami layout
#endif
#if LAYOUT_TW
{ 15, setlayout, {.v = &layouts[14]} }, // Tilewide layout
#endif
#if LAYOUT_STAIRS
{ 27, setlayout, {.v = &layouts[15]} }, // Stairs layout
#endif
#if LAYOUT_TILE54
{ 35, setlayout, {.v = &layouts[16]} }, // 5:4 tiling layout
#endif
#if LAYOUT_COL
{ 36, setlayout, {.v = &layouts[17]} }, // Column layout
#endif
#if LAYOUT_DGRID
{ 37, setlayout, {.v = &layouts[18]} }, // Dynamic Grid layout
#endif
{ 16, cyclelayout, {.i = -1 } }, // Cycle layout (back)
{ 17, cyclelayout, {.i = +1 } }, // Cycle layout (forward)
{ 18, livereloadxrdb, {0} },
{ 19, setmfact, {.f = -0.05} },
{ 20, setmfact, {.f = +0.05} },
@ -30,12 +71,8 @@ static Signal signals[] = {
{ 23, togglebar, {0} },
{ 24, togglefullscr, {0} },
{ 25, self_restart, {0} },
{ 27, setlayout, {.v = &layouts[15]} },
{ 28, resetlayout, {0} },
{ 29, reorganizetags, {0} },
{ 30, quit, {1} },
{ 31, quit, {0} },
{ 35, setlayout, {.v = &layouts[16]} },
{ 36, setlayout, {.v = &layouts[17]} },
{ 37, setlayout, {.v = &layouts[18]} },
};

View file

@ -10,17 +10,17 @@
static const char *ipcsockpath = "/tmp/speedwm.sock";
static IPCCommand ipccommands[] = {
IPCCOMMAND( view, 1, {ARG_TYPE_UINT} ),
IPCCOMMAND( tagmon, 1, {ARG_TYPE_UINT} ),
IPCCOMMAND( focusmon, 1, {ARG_TYPE_SINT} ),
IPCCOMMAND( focusstackvis, 1, {ARG_TYPE_SINT} ),
IPCCOMMAND( zoom, 1, {ARG_TYPE_NONE} ),
IPCCOMMAND( incnmaster, 1, {ARG_TYPE_SINT} ),
IPCCOMMAND( killclient, 1, {ARG_TYPE_SINT} ),
IPCCOMMAND( togglefloating, 1, {ARG_TYPE_NONE} ),
IPCCOMMAND( setmfact, 1, {ARG_TYPE_FLOAT} ),
IPCCOMMAND( setlayoutsafe, 1, {ARG_TYPE_PTR} ),
IPCCOMMAND( quit, 1, {ARG_TYPE_NONE} )
IPCCOMMAND(view, 1, { ARG_TYPE_UINT} ),
IPCCOMMAND(tagmon, 1, { ARG_TYPE_UINT} ),
IPCCOMMAND(focusmon, 1, { ARG_TYPE_SINT} ),
IPCCOMMAND(focusstackvis, 1, { ARG_TYPE_SINT} ),
IPCCOMMAND(zoom, 1, { ARG_TYPE_NONE} ),
IPCCOMMAND(incnmaster, 1, { ARG_TYPE_SINT} ),
IPCCOMMAND(killclient, 1, { ARG_TYPE_SINT} ),
IPCCOMMAND(togglefloating, 1, { ARG_TYPE_NONE} ),
IPCCOMMAND(setmfact, 1, { ARG_TYPE_FLOAT} ),
IPCCOMMAND(setlayoutsafe, 1, { ARG_TYPE_PTR} ),
IPCCOMMAND(quit, 1, { ARG_TYPE_NONE} )
};

View file

@ -5,12 +5,12 @@
* speedwm has a bigger codebase than suckless.org's dwm, however is still much more minimal than other tiling window managers such as i3-gaps while providing more features for the user.
*
* Keep in mind that speedwm is a personal window manager and therefore comes with keybinds for software I use and find appealing.
* If you do not like these keybinds, consider:
* - Copying this source code folder to another folder (such as speedwm-orig)
* - Deleting the lines you don't want in the files
* - Creating a patch using 'diff -up speedwm speedwm-orig > speedwm-settings.diff'
* - Copy the diff elsewhere. When updating speedwm (such as with 'git pull'), you can copy it to the source code folder and run 'patch < speedwm-settings.diff'.
* Otherwise you may maintain your own fork of speedwm.
* If you do not like these keybinds or other features, speedwm has a patch feature in the makefile so consider:
* - make patch | This creates patches with your changes compared to what it looked like when you first installed it. (Same as diff -up)
* - make patch_install | This installs your patches from the source code. (Same as patch <)
* - make patch_remove | This removes your patches from the source code. (Same as patch -R)
* - make patch_clean | This removes your patches completely (Same as rm *.patch)
* Otherwise you may maintain your own fork of speedwm if you prefer.
*
* In addition to this, if speedwm doesn't have a feature you want, there's nothing stopping you from adding it as it still follows the suckless philosophy somewhat.
* Below is a configuration file. Read the instructions below for information about how to configure it.
@ -26,10 +26,10 @@
* If you aren't aware of this, do not add anything to your .xinitrc if it is listed in autostart.h
*
* - If you were looking for the keybinds, they can be found in keybinds.h
* - If you use another operating system such as OpenBSD, FreeBSD or Solaris (Not GNU/Linux), edit config.mk
* - If you use another operating system such as OpenBSD, FreeBSD or Solaris (Not GNU/Linux), edit options.mk
* - If you're looking to disable a feature, see toggle.h (Disabling features) and toggle.mk (Disabling libraries the features depend on)
*
* This build comes with defines for common software such as your web
* browser or terminal.
* This build comes with defines for common software such as your web browser or terminal.
* If you wish to use a different browser for example, simply change the values.
*
* You do not need to edit 'keybinds.h' or 'rules.h' because that's where these are used.
@ -165,7 +165,7 @@ static const char *fonts[] = { font, font2, font3 };
static char defaultname[] = ""; /* What to print when a status bar is not running */
/* Bar options */
static char status[] = "status"; /* Status bar to use, speedwmblocks for speedwmblocks, slstatus for slstatus, etc. */
static char status[] = "status"; /* Status bar to use, stellar for stellar, dwmblocks for dwmblocks, slstatus for slstatus, etc. */
/* Alternate bar
*
@ -232,16 +232,24 @@ static int hidesticky = 0; /* Hide sticky indicator (1)
static int statusallmons = 1; /* Draw status bar on all monitors */
/* Layout options */
#if LAYOUT_MONOCLE
static unsigned int monocleclientcount = 0; /* Display client count in the Monocle layout */
static unsigned int monoclecount = 0; /* Display focused client and number of total clients in the Monocle layout */
static char monocleformat[] = "[%d/%d]"; /* Format of the monocle count. Unsigned integer monoclecount must be set to 1 for this to be used. */
#endif
#if LAYOUT_DECK
static unsigned int deckcount = 0; /* Display deck count in the deck layout */
static char deckformat[] = "D %d"; /* Format of the deck count. deckcount must be set to 1 for this to be used. */
#endif
#if LAYOUT_STAIRS
static unsigned int stairpx = 20; /* depth of the stairs layout */
static int stairdirection = 1; /* 0: left-aligned, 1: right-aligned */
static int stairsamesize = 1; /* 1 means shrink all the staired windows to the same size */
#endif
static int defaultlayout = 1; /* Reset layout when there is only one client visible */
#if LAYOUT_DGRID
static int forcevsplit = 1; /* Force two clients to always split vertically in the dynamic grid layout */
#endif
/* Bar colors */
static char col_background[] = "#222222"; /* speedwm dark bg & slstatus bg */
@ -357,4 +365,5 @@ static XPoint stickyiconbb = {4,8}; /* defines the bottom rig
/* You have reached the end of the configuration file.
* For keybinds, see 'keybinds.h'
* For feature toggles, see 'toggle.h'
*/

52
scripts/mkpatch Executable file
View file

@ -0,0 +1,52 @@
#!/bin/sh
# mkpatch.sh
# This shell script allows you to create a patch based on changes made to options.h, options.mk, toggle.h and toggle.mk.
# Set old pwd
CD="$(pwd)"
CP() {
cp docs/options.def.h /tmp/options.h
cp docs/options.def.mk /tmp/options.mk
cp docs/toggle.def.h /tmp/toggle.h
cp docs/toggle.def.mk /tmp/toggle.mk
}
MKDIFF() {
cd /tmp
# Create patches
diff -up ./options.h $CD/options.h > $CD/options.h_settings.patch && echo "Created options.h patch (see options.h_settings.patch)"
diff -up ./options.mk $CD/options.mk > $CD/options.mk_settings.patch && echo "Created options.mk patch (see options.mk_settings.patch)"
diff -up ./toggle.h $CD/toggle.h > $CD/toggle.h_settings.patch && echo "Created toggle.h patch (see toggle.h_settings.patch)"
diff -up ./toggle.mk $CD/toggle.mk > $CD/toggle.mk_settings.patch && echo "Created toggle.mk patch (see toggle.mk_settings.patch)"
# Delete
rm -f /tmp/options.h
rm -f /tmp/options.mk
rm -f /tmp/toggle.h
rm -f /tmp/toggle.mk
}
# Patch the source
if [ "$1" = "-p" ]; then
patch < options.h_settings.patch
patch < options.mk_settings.patch
patch < toggle.h_settings.patch
patch < toggle.mk_settings.patch
exit 0
fi
# Remove the patch
if [ "$1" = "-r" ]; then
patch -R < options.h_settings.patch
patch -R < options.mk_settings.patch
patch -R < toggle.h_settings.patch
patch -R < toggle.mk_settings.patch
exit 0
fi
CP
MKDIFF
cd $CD

View file

@ -4602,7 +4602,7 @@ updatebars(void)
};
XClassHint ch = {"speedwm", "speedwm"};
for (m = mons; m; m = m->next) {
#if USETAGPREVIEW
#if USETAGPREVIEW
if (!m->tagwin) {
m->tagwin = XCreateWindow(dpy, root, m->wx, m->by + bh, m->mw / scalepreview,
m->mh / scalepreview, 0, DefaultDepth(dpy, screen), CopyFromParent,
@ -4610,7 +4610,7 @@ updatebars(void)
XDefineCursor(dpy, m->tagwin, cursor[CurNormal]->cursor);
XUnmapWindow(dpy, m->tagwin);
}
#endif
#endif
if (m->barwin)
continue;
m->barwin = XCreateWindow(dpy, root, m->wx + sp, m->by + vp, m->ww - 2 * sp, bh, 0, depth,

View file

@ -102,8 +102,20 @@ ResourcePref resources[] = {
{ "shell", STRING, &shell },
{ "status", STRING, &status },
{ "defaultname", STRING, &defaultname },
#if LAYOUT_MONOCLE
{ "monocleformat", STRING, &monocleformat },
{ "monocleclientcount", INTEGER, &monocleclientcount },
{ "monoclecount", INTEGER, &monoclecount },
#endif
#if LAYOUT_DECK
{ "deckformat", STRING, &deckformat },
{ "deckcount", INTEGER, &deckcount },
#endif
#if LAYOUT_STAIRS
{ "stairpx", INTEGER, &stairpx },
{ "stairdirection", INTEGER, &stairdirection },
{ "stairsamesize", INTEGER, &stairsamesize },
#endif
{ "altbarclass", STRING, &altbarclass },
{ "altbarcmd", STRING, &altbarcmd },
{ "alttrayname", STRING, &alttrayname },
@ -132,8 +144,6 @@ ResourcePref resources[] = {
{ "warpcursor", INTEGER, &warpcursor },
{ "pertag", INTEGER, &pertag },
{ "i3nmaster", INTEGER, &i3nmaster },
{ "monocleclientcount", INTEGER, &monocleclientcount },
{ "monoclecount", INTEGER, &monoclecount },
#if USETAGPREVIEW
{ "scalepreview", INTEGER, &scalepreview },
{ "tagpreview", INTEGER, &tagpreview },
@ -154,10 +164,6 @@ ResourcePref resources[] = {
#if USEFADE
{ "fadeinactive", INTEGER, &fadeinactive },
#endif
{ "stairpx", INTEGER, &stairpx },
{ "stairdirection", INTEGER, &stairdirection },
{ "stairsamesize", INTEGER, &stairsamesize },
{ "deckcount", INTEGER, &deckcount },
{ "defaultlayout", INTEGER, &defaultlayout },
{ "wmclass", INTEGER, &wmclass },
{ "clicktofocus", INTEGER, &clicktofocus },
@ -174,7 +180,9 @@ ResourcePref resources[] = {
{ "gappov", INTEGER, &gappov },
{ "smartgaps", INTEGER, &smartgaps },
{ "smartgapsize", INTEGER, &smartgapsize },
#if LAYOUT_DGRID
{ "forcevsplit", INTEGER, &forcevsplit },
#endif
{ "mousemfact", INTEGER, &mousemfact },
{ "focusspawn", INTEGER, &focusspawn },
{ "floatscratchpad", INTEGER, &floatscratchpad },