diff --git a/docs/doc-05 b/docs/doc-05 index ed50910..acf20fb 100644 --- a/docs/doc-05 +++ b/docs/doc-05 @@ -12,7 +12,6 @@ Instead, config.h is split into different parts to make it easier to edit. Inste - mouse.h for adding/removing mouse binds. - ipc.h for adding/removing IPC commands. (If support is compiled in) - toggle.h for adding/removing features from getting compiled in. - - touch.h for touchpad resizing. 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. diff --git a/mouse.h b/mouse.h index 41e672f..d800ead 100644 --- a/mouse.h +++ b/mouse.h @@ -27,13 +27,6 @@ static const Button buttons[] = { { ClkTagBar, 0, Button1, view, {0} }, { ClkTagBar, 0, Button4, view, {0} }, { ClkTagBar, 0, Button5, view, {0} }, - - #if USETOUCH - { ClkClientWin, MODIFIER1, Button4, touchpad, {.v = &scrollargs[0]} }, - { ClkClientWin, MODIFIER1, Button5, touchpad, {.v = &scrollargs[1]} }, - { ClkClientWin, MODIFIER1, Button6, touchpad, {.v = &scrollargs[2]} }, - { ClkClientWin, MODIFIER1, Button7, touchpad, {.v = &scrollargs[3]} }, - #endif }; /* Commands that will run when a part of the status bar is pressed diff --git a/options.h b/options.h index 078dfe5..2ab881c 100644 --- a/options.h +++ b/options.h @@ -125,29 +125,29 @@ static unsigned int smartgapsize = 0; /* Gaps for smartgaps. If set static int smartgaps = 0; /* 1 means use different gap size when there is only one window */ /* Window aesthetic options */ +#if USEFADE static int fadeinactive = 1; /* Fade inactive windows */ 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 Bool bUseOpacity = True; /* Starts with opacity on any unfocused windows */ - -/* Touchpad scroll resizing - * - * Touchpad scroll resizing allows you to resize windows with your touchpad. If you do not use this, it can be disabled in toggle.h. - */ -static const int scroll = 30; /* Amount to resize window by for each scroll */ +#endif /* Rounded corners */ +#if USEROUNDCORNERS 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. */ +#endif /* Tag preview options */ +#if USETAGPREVIEW static int tagpreview = 1; /* Enable tag previews */ static int tagpreviewpaddingv = 0; /* Vertical tag padding */ static int tagpreviewpaddingh = 0; /* Horizontal tag padding */ static int mousepreview = 1; /* Display tag previews if hovering over a tag */ static int barpreview = 0; /* Display the bar in the preview */ static int scalepreview = 2; /* Size of tag preview. Lower is bigger, higher is smaller. */ +#endif /* Window spawning options */ static int attachdirection = 3; /* 0 default, 1 above, 2 aside, 3 below, 4 bottom, 5 top */ @@ -201,8 +201,10 @@ static int fullscreenhidebar = 1; /* Hide the bar when full scr static int lockfullscreen = 1; /* Window icon options */ +#if USEWINICON static int iconsize = 10; /* size of the icon */ static int iconspacing = 5; /* spacing between the title and icon */ +#endif /* Bar options */ static int barposition = 1; /* Bar position. Top: 1, Bottom: 0 */ @@ -214,10 +216,12 @@ static int barpaddingh = 10; /* Horizontal bar padding in static int layoutposition = 1; /* Layout indicator on the left (1) or on the right (0) */ /* Systray options */ +#if USESYSTRAY static int systraypinning = 0; /* Show systray on focused monitor (0) or () to pin to a specific monitor */ static int systrayonleft = 0; /* Systray position. Right: 0, Left: 1. */ static int systrayspacing = 2; /* Systray spacing in pixels */ static int showsystray = 0; /* Show systray by default (0) or show (1) */ +#endif /* Tag text options */ static int underline = 0; /* Underline tags (1) or not (0) */ @@ -244,28 +248,26 @@ static int statusallmons = 1; /* Draw status bar on all mon * * The ifs are here so that you can toggle them. If you don't want/need a layout, you can disable it in the toggle.h header file. */ - -/* Monocle */ +#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. */ - -/* Deck */ +#endif +#if LAYOUT_DECK static unsigned int deckcount = 0; /* Display deck count in the deck layout */ static char deckformat[] = "[%d]"; /* Format of the deck count. deckcount must be set to 1 for this to be used. */ - -/* Stair */ +#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 */ - -/* Dynamic grid */ -static int forcevsplit = 1; /* Force two clients to always split vertically in the dynamic grid layout */ - -/* Reset options */ +#endif static int resetlayout = 1; /* Reset layout when there is only one client visible */ static int resetmfact = 1; /* Reset mfact when there is only one client visible */ static int resetgaps = 1; /* Reset gaps 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 bar background and status background color */ diff --git a/speedwm.c b/speedwm.c index b6ef083..c416c3c 100644 --- a/speedwm.c +++ b/speedwm.c @@ -342,9 +342,6 @@ static void attachtop(Client *c); static void attachstack(Client *c); #if USEMOUSE static void buttonpress(XEvent *e); -#if USETOUCH -static void touchpad(const Arg *arg); -#endif #endif static void checkotherwm(void); static void cleanup(void); @@ -715,11 +712,6 @@ static int systraypinningfailfirst = 1; /* Mouse support */ #if USEMOUSE static const char *statuscmd[] = { shell, "-c", NULL, NULL }; -#if USETOUCH -#define Button6 6 -#define Button7 7 -#include "touch.h" /* Include touchpad support */ -#endif #include "mouse.h" /* Include mouse support */ #endif @@ -1198,47 +1190,6 @@ buttonpress(XEvent *e) && CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state)) buttons[i].func((click == ClkTagBar || click == ClkWinTitle) && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg); } - -#if USETOUCH -void -touchpad(const Arg *arg) -{ - int nw, nh; - Client *c; - Monitor *m; - XEvent ev; - int dw = *((int*)arg->v + 1); - int dh = *(int*)arg->v; - - if (!(c = selmon->sel)) - return; - if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */ - return; - restack(selmon); - if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, - None, cursor[CurResize]->cursor, CurrentTime) != GrabSuccess) - return; - nw = MAX(c->w + dw, 1); - nh = MAX(c->h + dh, 1); - if (c->mon->wx + nw >= selmon->wx && c->mon->wx + nw <= selmon->wx + selmon->ww - && c->mon->wy + nh >= selmon->wy && c->mon->wy + nh <= selmon->wy + selmon->wh) - { - if (!c->isfloating && selmon->lt[selmon->sellt]->arrange - && (abs(nw - c->w) > snap || abs(nh - c->h) > snap)) - togglefloating(NULL); - } - if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) - resize(c, c->x, c->y, nw, nh, 1); - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); - XUngrabPointer(dpy, CurrentTime); - while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); - if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { - sendmon(c, m); - selmon = m; - focus(NULL); - } -} -#endif #endif diff --git a/toggle.h b/toggle.h index 178b147..6a1dbe4 100644 --- a/toggle.h +++ b/toggle.h @@ -23,7 +23,6 @@ Not compatible with BSDs so for those, set this to 0. */ #define USEROUNDCORNERS 1 /* Whether or not to include rounded corners */ #define USEMEDIA 1 /* Whether or not to include media keys */ #define USEMOUSE 1 /* Whether or not to include mouse binds */ -#define USETOUCH 1 /* Whether or not to include touchpad window resizing. Requires USEMOUSE to be enabled. */ #define USEXRESOURCES 1 /* Whether or not to include .Xresources support. By disabling this, you're also disabling the speedwmrc config file. It is recommended that you keep this enabled. */ #define USEXFTWORKAROUND 0 /* Whether or not to include the libXft emoji workaround. This is usually not necessary so only enable it if you find that you need it. */ diff --git a/touch.h b/touch.h deleted file mode 100644 index 152cbd3..0000000 --- a/touch.h +++ /dev/null @@ -1,12 +0,0 @@ -/* Mouse scroll arguments - * - * This is where you can adjust the touchpad window resizing. - */ - -static const int scrollargs[][2] = { - /* width change height change */ - { +scroll, 0 }, - { -scroll, 0 }, - { 0, +scroll }, - { 0, -scroll }, -};