Remove outdated comments, altbarcmd no longer crashes speedwm if it's

set to something but altbar is 0.
This commit is contained in:
speedie 2022-11-30 17:16:10 +01:00
parent b623844223
commit ed0e491dba
3 changed files with 19 additions and 89 deletions

View file

@ -78,7 +78,7 @@ static Key keys[] = {
{ MODIFIER1|CONTROL|SHIFT, -1, XK_s, spawn, cmd( "speedwm-swal" ) }, { MODIFIER1|CONTROL|SHIFT, -1, XK_s, spawn, cmd( "speedwm-swal" ) },
{ MODIFIER1|CONTROL|SHIFT, -1, XK_n, spawn, cmd( "speedwm-netctrl" ) }, { MODIFIER1|CONTROL|SHIFT, -1, XK_n, spawn, cmd( "speedwm-netctrl" ) },
{ MODIFIER1|CONTROL|SHIFT, -1, XK_b, spawn, cmd( "speedwm-btctrl" ) }, { MODIFIER1|CONTROL|SHIFT, -1, XK_b, spawn, cmd( "speedwm-btctrl" ) },
{ MODIFIER1|CONTROL|SHIFT, -1, XK_r, spawn, cmd( "libspeedwm --perform core_wm_restart ; speedwm -s 'Loading'" ) }, { MODIFIER1|CONTROL|SHIFT, -1, XK_r, spawn, cmd( "libspeedwm --perform core_wm_restart; speedwm -s 'Loading'" ) },
/* System tray */ /* System tray */
#if USESYSTRAY #if USESYSTRAY

View file

@ -1,80 +1,8 @@
/* speedwm options /* speedwm
* *
* -- What is speedwm -- * Below is a configuration file which is technically C source code.
* See the man page (speedie.1) or README.md for help.
* *
* speedwm is a fork of suckless.org's dwm, a window manager for X.
*
* Unlike the original 'dwm' window manager, speedwm tries to be minimal, just like dwm but also has functionality and aesthetics as a goal.
* 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 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.
* While there are VERY likely going to be patch conflicts, this is still dwm, just modified. I suggest you take the time to learn the codebase for dwm as it can be applied to speedwm.
*
* Below is a configuration file. Read the instructions below for information about how to configure it.
*
* -- Usage --
*
* To use speedwm, you must first install all the dependencies. See the man page for speedwm for a list of dependencies.
* Then, you need to run 'speedwm_run' after X has started. This can usually be done by adding 'speedwm_run' to ~/.xinitrc and running 'startx'.
* If you use a display manger/login manager like sddm, lightdm or something that uses entries, the entry should be created after installation.
*
* -- What is this file for? --
*
* The header you are currently reading is for changing options for various features.
*
* If you are a user of a display manager, you may not be able to use .xinitrc. Because of this you can autostart shell scripts using the $HOME/.config/speedwm/autostart.sh script. It is not there by default but if you want to use it, just create the file, chmod +x it and add your shell script to it. There is also the autostart-once.sh script in the same directory which is only started once.
*
* -- What are all the headers about? --
*
* speedwm unlike dwm doesn't just have a single header, config.h but rather multiple. Below is a list of them
*
* - If you were looking for colors, and other options, they can be found here in options.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 host.mk
* - If you're looking to disable a feature, see toggle.h (Disabling features) and toggle.mk (Disabling libraries the features depend on)
* - If you want to change IPC settings, you can find the IPC options in ipc.h (speedwm-msg source in toggle/)
* - If you want to add .Xresources values (All of them have already been added), that's in the xresources.h header.
* - If you want to add an signal signum, it can be done in the signal.h header.
* - If you want to add/remove autostart lines, that can be found in the autostart.h header.
* - If you want to modify mouse binds, edit mouse.h.
* - If you want to extensively change alpha and color options (probably not necessary), you can modify the colors.h header.
*
* The goal of this is to decrease the size of headers and make it easier to find what you want to find, because if I were to combine all of this into one big file, it would be really difficult to hack on it (see dwm-tileipatch for an example).
*
* Also note that:
*
* speedwm.c = dwm.c
* host.mk = config.mk
* Rest of the headers = config.h/config.def.h
*
* -- Note on patching --
*
* I do not recommend that you attempt to use the patch coreutil as it is not likely to patch successfully.
* There are however a few speedwm specific patches available on my Codeberg (https://codeberg.org/speedie/patches). These were created when I removed a feature that I decided was not worth keeping in.
*
* Alternatively, you can change some of these in ~/.config/speedwm/speedwmrc.
*
* Do note that settings in speedwmrc will override the settings in all of the headers (as long as the file is valid).
* If you do not like this behavior, you may add "rm -f $HOME/.config/speedwm/speedwmrc" to autostart.sh which will make sure the speedwmrc options are not used.
*
******************************************************/
/* Options
*
* If xrdb is installed, you can simply edit ~/.config/speedwm/speedwmrc instead of recompiling.
* Once you're done with your edits, run 'make clean install'.
*
* It should be noted that options in speedwmrc will override the options in here. This means if an option does nothing here, it's likely different in the config file.
*/ */
/* Window alignment options */ /* Window alignment options */
@ -107,8 +35,7 @@ static int fadeinactive = 1; /* Fade inactive windows */
static double activeopacity = 1.0f; /* Window opacity when it's focused (0 <= opacity <= 1) */ static double activeopacity = 1.0f; /* Window opacity when it's focused (0 <= opacity <= 1) */
static double inactiveopacity = 0.875f; /* Window opacity when it's inactive (0 <= opacity <= 1) */ static double inactiveopacity = 0.875f; /* Window opacity when it's inactive (0 <= opacity <= 1) */
/* Rounded corners /* Rounded corners */
*/
static int roundedcorners = 0; /* Enable (1) rounded corners or disable (0) rounded corners. */ static int roundedcorners = 0; /* Enable (1) rounded corners or disable (0) rounded corners. */
static int cornerradius = 2; /* Radius of rounded corners, 10 is the default. */ static int cornerradius = 2; /* Radius of rounded corners, 10 is the default. */
@ -134,7 +61,7 @@ static int automove = 1; /* Allow clients to automatic
static int autoresize = 1; /* Allow resizing clients automatically when they request it. */ static int autoresize = 1; /* Allow resizing clients automatically when they request it. */
/* Font options */ /* Font options */
static char font[] = "Noto Sans Regular 8"; static char font[] = "Noto Sans Regular 8"; /* Font to draw the bar with */
/* Status options */ /* Status options */
static char defaultstatus[] = ""; /* What to print when a status bar is not running */ static char defaultstatus[] = ""; /* What to print when a status bar is not running */
@ -142,7 +69,7 @@ static char defaultstatus[] = ""; /* What to print when a stat
/* Alternate bar /* Alternate bar
* *
* Some users may prefer to use a different bar than what speedwm provides. * Some users may prefer to use a different bar than what speedwm provides.
* Polybar users for example might want to use their bspwm bar in speedwm. * Polybar users for example might want to use their (previously) bspwm bar in speedwm.
* If so, follow these instructions: * If so, follow these instructions:
* - Use xprop to find the class (WM_CLASS) and add that to altbarclass * - Use xprop to find the class (WM_CLASS) and add that to altbarclass
* - Set altbarcmd to the bar you want to use. * - Set altbarcmd to the bar you want to use.
@ -150,11 +77,11 @@ static char defaultstatus[] = ""; /* What to print when a stat
* - Recompile speedwm and restart it using 'speedwm_run -r' * - Recompile speedwm and restart it using 'speedwm_run -r'
* *
* If you didn't do any changes to the source code, just run speedwm_run -r' * If you didn't do any changes to the source code, just run speedwm_run -r'
* If you use Polybar, the default settings here will work, just set altbar to 1 and set altbarcmd to 'polybar &'. * If you use Polybar, the default settings here will work, just set altbar to 1.
* *
*/ */
static int altbar = 0; /* Use alternative bar (0/1) */ static int altbar = 0; /* Use alternative bar (0/1) */
static char *altbarcmd = ""; /* Command to run instead of the speedwm bar */ static char *altbarcmd = "polybar &"; /* Command to run instead of the speedwm bar */
static char *altbarclass = "Polybar"; /* Alternate bar class name */ static char *altbarclass = "Polybar"; /* Alternate bar class name */
static char *alttrayname = "tray"; /* Tray instance name */ static char *alttrayname = "tray"; /* Tray instance name */

View file

@ -6010,8 +6010,11 @@ tag(const Arg *arg)
void void
spawnbar() spawnbar()
{ {
if (!altbar)
return;
if (*altbarcmd) if (*altbarcmd)
if (system(altbarcmd) == 0) if (system(altbarcmd) == 0)
return; return;
} }
@ -7550,18 +7553,18 @@ main(int argc, char *argv[])
if (argc == 2 && !strcmp("-v", argv[1])) if (argc == 2 && !strcmp("-v", argv[1]))
die("speedwm-"VERSION); die("speedwm-"VERSION);
else if (argc != 1 && strcmp("-s", argv[1])) else if (argc != 1 && strcmp("-s", argv[1]))
die("usage: speedwm [-v] [-s]"); die("Invalid argument.");
if (!setlocale(LC_CTYPE, "") || !XSupportsLocale()) if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
fputs("warning: no locale support\n", stderr); fputs("Warning: no locale support\n", stderr);
if (!(dpy = XOpenDisplay(NULL))) if (!(dpy = XOpenDisplay(NULL)))
die("speedwm: cannot open display"); die("speedwm: Cannot open display.");
if (argc > 1 && !strcmp("-s", argv[1])) { if (argc > 1 && !strcmp("-s", argv[1])) {
XStoreName(dpy, RootWindow(dpy, DefaultScreen(dpy)), argv[2]); XStoreName(dpy, RootWindow(dpy, DefaultScreen(dpy)), argv[2]);
XCloseDisplay(dpy); XCloseDisplay(dpy);
return 0; return 0;
} }
if (!(xcon = XGetXCBConnection(dpy))) if (!(xcon = XGetXCBConnection(dpy)))
die("speedwm: cannot get xcb connection\n"); die("speedwm: Cannot get xcb connection\n");
checkotherwm(); checkotherwm();
autostart_exec(); autostart_exec();
XrmInitialize(); XrmInitialize();
@ -7575,13 +7578,13 @@ main(int argc, char *argv[])
#endif /* __OpenBSD__ */ #endif /* __OpenBSD__ */
scan(); scan();
run(); run();
if(restart) execvp(argv[0], argv); if(restart)
execvp(argv[0], argv);
cleanup(); cleanup();
XCloseDisplay(dpy); XCloseDisplay(dpy);
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
void void
insertclient(Client *item, Client *insertItem, int after) { insertclient(Client *item, Client *insertItem, int after) {
Client *c; Client *c;