From 0c45f03b0b9f348a6eb0460bf8215929a69bf35c Mon Sep 17 00:00:00 2001 From: Julian T Date: Thu, 15 Dec 2022 15:43:12 +0100 Subject: 2bwm config and some bspwm changes --- 2bwm/resc/2bwm/2bwm.copying | 14 ++++ 2bwm/resc/2bwm/2bwm.desktop | 6 ++ 2bwm/resc/2bwm/PKGBUILD | 31 +++++++ 2bwm/resc/2bwm/config.h | 200 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 251 insertions(+) create mode 100644 2bwm/resc/2bwm/2bwm.copying create mode 100644 2bwm/resc/2bwm/2bwm.desktop create mode 100644 2bwm/resc/2bwm/PKGBUILD create mode 100644 2bwm/resc/2bwm/config.h (limited to '2bwm/resc') diff --git a/2bwm/resc/2bwm/2bwm.copying b/2bwm/resc/2bwm/2bwm.copying new file mode 100644 index 0000000..c4d323d --- /dev/null +++ b/2bwm/resc/2bwm/2bwm.copying @@ -0,0 +1,14 @@ +Copyright (c) 2010, 2011, 2012 Michael Cardell Widerkrantz, mc at the domain hack.org. +Copyright (c) 2013 Patrick Louis and Youri Mouton, patrick or beastie at the domain unixhub.net. + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/2bwm/resc/2bwm/2bwm.desktop b/2bwm/resc/2bwm/2bwm.desktop new file mode 100644 index 0000000..f75061a --- /dev/null +++ b/2bwm/resc/2bwm/2bwm.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=2bwm +Comment=2bwm - A fast floating and keyboard driven window manager +Exec=2bwm +Type=XSession diff --git a/2bwm/resc/2bwm/PKGBUILD b/2bwm/resc/2bwm/PKGBUILD new file mode 100644 index 0000000..5d2376b --- /dev/null +++ b/2bwm/resc/2bwm/PKGBUILD @@ -0,0 +1,31 @@ +# Maintainer: Brian Bidulock +pkgname='2bwm' +pkgver=0.3 +pkgrel=1 +pkgdesc="A fast floating window manager" +arch=('i686' 'x86_64') +url="https://github.com/venam/2bwm" +license=('ISC') +depends=('xcb-util-wm' 'xcb-util-keysyms' 'xcb-util-xrm') +conflicts=('2bwm-git' 'mcwm' 'mcwm-git') # due to /usr/bin/hidden program +makedepends=('git' 'xcb-util') +source=("$pkgname::git+https://github.com/bbidulock/2bwm.git#tag=v${pkgver}" '2bwm.desktop' '2bwm.copying' 'config.h') +md5sums=('SKIP' + '4342d9210effbe4bfb58722f4275aa5c' + 'adaee5c7e455ba15e0ca9a2692464253' + 'SKIP') + +prepare() { + cp $srcdir/config.h $pkgname/config.h -v +} + +build() { + cd $pkgname + make PREFIX=/usr +} +package() { + cd $pkgname + make DESTDIR="$pkgdir" PREFIX=/usr MANPREFIX=/usr/share/man install + install -Dm644 "$srcdir/2bwm.desktop" "$pkgdir/usr/share/xsessions/2bwm.desktop" + install -Dm644 "$srcdir/2bwm.copying" "$pkgdir/usr/share/licenses/$pkgname/COPYING" +} diff --git a/2bwm/resc/2bwm/config.h b/2bwm/resc/2bwm/config.h new file mode 100644 index 0000000..7d4340b --- /dev/null +++ b/2bwm/resc/2bwm/config.h @@ -0,0 +1,200 @@ +///---User configurable stuff---/// +///---Modifiers---/// +#define MOD XCB_MOD_MASK_4 /* Super/Windows key or check xmodmap(1) with -pm defined in /usr/include/xcb/xproto.h */ +///--Speed---/// +/* Move this many pixels when moving or resizing with keyboard unless the window has hints saying otherwise. + *0)move step slow 1)move step fast + *2)mouse slow 3)mouse fast */ +static const uint16_t movements[] = {20,40,15,400}; +/* resize by line like in mcwm -- jmbi */ +static const bool resize_by_line = true; +/* the ratio used when resizing and keeping the aspect */ +static const float resize_keep_aspect_ratio= 1.03; +///---Offsets---/// +/*0)offsetx 1)offsety + *2)maxwidth 3)maxheight */ +static const uint8_t offsets[] = {0,21,0,21}; +///---Colors---/// +/*0)focuscol 1)unfocuscol + *2)fixedcol 3)unkilcol + *4)fixedunkilcol 5)outerbordercol + *6)emptycol */ +static const char *colors[] = {"#35586c","#333333","#7a8c5c","#ff6666","#cc9933","#0d131a","#000000"}; +/* if this is set to true the inner border and outer borders colors will be swapped */ +static const bool inverted_colors = true; +///---Cursor---/// +/* default position of the cursor: + * correct values are: + * TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT, MIDDLE + * All these are relative to the current window. */ +#define CURSOR_POSITION MIDDLE +///---Borders---/// +/*0) Outer border size. If you put this negative it will be a square. + *1) Full borderwidth 2) Magnet border size + *3) Resize border size */ +static const uint8_t borders[] = {3,5,5,4}; +/* Windows that won't have a border. + * It uses substring comparison with what is found in the WM_NAME + * attribute of the window. You can test this using `xprop WM_NAME` + */ +#define LOOK_INTO "WM_NAME" +static const char *ignore_names[] = {"bar", "xclock"}; +///--Menus and Programs---/// +static const char *menucmd[] = { "rofi", "-show", "drun", NULL }; +static const char *termcmd[] = { "termite", NULL }; +///---Shortcuts---/// +/* Check /usr/include/X11/keysymdef.h for the list of all keys + * 0x000000 is for no modkey + * If you are having trouble finding the right keycode use the `xev` to get it + * For example: + * KeyRelease event, serial 40, synthetic NO, window 0x1e00001, + * root 0x98, subw 0x0, time 211120530, (128,73), root:(855,214), + * state 0x10, keycode 171 (keysym 0x1008ff17, XF86AudioNext), same_screen YES, + * XLookupString gives 0 bytes: + * XFilterEvent returns: False + * + * The keycode here is keysym 0x1008ff17, so use 0x1008ff17 + * + * + * For AZERTY keyboards XK_1...0 should be replaced by : + * DESKTOPCHANGE( XK_ampersand, 0) + * DESKTOPCHANGE( XK_eacute, 1) + * DESKTOPCHANGE( XK_quotedbl, 2) + * DESKTOPCHANGE( XK_apostrophe, 3) + * DESKTOPCHANGE( XK_parenleft, 4) + * DESKTOPCHANGE( XK_minus, 5) + * DESKTOPCHANGE( XK_egrave, 6) + * DESKTOPCHANGE( XK_underscore, 7) + * DESKTOPCHANGE( XK_ccedilla, 8) + * DESKTOPCHANGE( XK_agrave, 9)* + */ +#define DESKTOPCHANGE(K,N) \ +{ MOD , K, changeworkspace, {.i=N}}, \ +{ MOD |SHIFT, K, sendtoworkspace, {.i=N}}, +static key keys[] = { + /* modifier key function argument */ + // Focus to next/previous window + { MOD , XK_Tab, focusnext, {.i=TWOBWM_FOCUS_NEXT}}, + { MOD |SHIFT, XK_Tab, focusnext, {.i=TWOBWM_FOCUS_PREVIOUS}}, + // Kill a window + { MOD , XK_q, deletewin, {}}, + // Resize a window + { MOD |SHIFT, XK_k, resizestep, {.i=TWOBWM_RESIZE_UP}}, + { MOD |SHIFT, XK_j, resizestep, {.i=TWOBWM_RESIZE_DOWN}}, + { MOD |SHIFT, XK_l, resizestep, {.i=TWOBWM_RESIZE_RIGHT}}, + { MOD |SHIFT, XK_h, resizestep, {.i=TWOBWM_RESIZE_LEFT}}, + // Resize a window slower + { MOD |SHIFT|CONTROL,XK_k, resizestep, {.i=TWOBWM_RESIZE_UP_SLOW}}, + { MOD |SHIFT|CONTROL,XK_j, resizestep, {.i=TWOBWM_RESIZE_DOWN_SLOW}}, + { MOD |SHIFT|CONTROL,XK_l, resizestep, {.i=TWOBWM_RESIZE_RIGHT_SLOW}}, + { MOD |SHIFT|CONTROL,XK_h, resizestep, {.i=TWOBWM_RESIZE_LEFT_SLOW}}, + // Move a window + { MOD , XK_k, movestep, {.i=TWOBWM_MOVE_UP}}, + { MOD , XK_j, movestep, {.i=TWOBWM_MOVE_DOWN}}, + { MOD , XK_l, movestep, {.i=TWOBWM_MOVE_RIGHT}}, + { MOD , XK_h, movestep, {.i=TWOBWM_MOVE_LEFT}}, + // Move a window slower + { MOD |CONTROL, XK_k, movestep, {.i=TWOBWM_MOVE_UP_SLOW}}, + { MOD |CONTROL, XK_j, movestep, {.i=TWOBWM_MOVE_DOWN_SLOW}}, + { MOD |CONTROL, XK_l, movestep, {.i=TWOBWM_MOVE_RIGHT_SLOW}}, + { MOD |CONTROL, XK_h, movestep, {.i=TWOBWM_MOVE_LEFT_SLOW}}, + // Teleport the window to an area of the screen. + // Center: + { MOD , XK_g, teleport, {.i=TWOBWM_TELEPORT_CENTER}}, + // Center y: + { MOD |SHIFT, XK_g, teleport, {.i=TWOBWM_TELEPORT_CENTER_Y}}, + // Center x: + { MOD |CONTROL, XK_g, teleport, {.i=TWOBWM_TELEPORT_CENTER_X}}, + // Top left: + { MOD , XK_y, teleport, {.i=TWOBWM_TELEPORT_TOP_LEFT}}, + // Top right: + { MOD , XK_u, teleport, {.i=TWOBWM_TELEPORT_TOP_RIGHT}}, + // Bottom left: + { MOD , XK_b, teleport, {.i=TWOBWM_TELEPORT_BOTTOM_LEFT}}, + // Bottom right: + { MOD , XK_n, teleport, {.i=TWOBWM_TELEPORT_BOTTOM_RIGHT}}, + // Resize while keeping the window aspect + { MOD , XK_Home, resizestep_aspect, {.i=TWOBWM_RESIZE_KEEP_ASPECT_GROW}}, + { MOD , XK_End, resizestep_aspect, {.i=TWOBWM_RESIZE_KEEP_ASPECT_SHRINK}}, + // Maximize (ignore offset and no EWMH atom) + { MOD , XK_x, maximize, {}}, + // Full screen (disregarding offsets and adding EWMH atom) + { MOD |SHIFT , XK_x, fullscreen, {}}, + // Maximize vertically + { MOD , XK_m, maxvert_hor, {.i=TWOBWM_MAXIMIZE_VERTICALLY}}, + // Maximize horizontally + { MOD |SHIFT, XK_m, maxvert_hor, {.i=TWOBWM_MAXIMIZE_HORIZONTALLY}}, + // Maximize and move + // vertically left + { MOD |SHIFT, XK_y, maxhalf, {.i=TWOBWM_MAXHALF_VERTICAL_LEFT}}, + // vertically right + { MOD |SHIFT, XK_u, maxhalf, {.i=TWOBWM_MAXHALF_VERTICAL_RIGHT}}, + // horizontally left + { MOD |SHIFT, XK_b, maxhalf, {.i=TWOBWM_MAXHALF_HORIZONTAL_BOTTOM}}, + // horizontally right + { MOD |SHIFT, XK_n, maxhalf, {.i=TWOBWM_MAXHALF_HORIZONTAL_TOP}}, + //fold half vertically + { MOD |SHIFT|CONTROL,XK_y, maxhalf, {.i=TWOBWM_MAXHALF_FOLD_VERTICAL}}, + //fold half horizontally + { MOD |SHIFT|CONTROL,XK_b, maxhalf, {.i=TWOBWM_MAXHALF_FOLD_HORIZONTAL}}, + //unfold vertically + { MOD |SHIFT|CONTROL,XK_u, maxhalf, {.i=TWOBWM_MAXHALF_UNFOLD_VERTICAL}}, + //unfold horizontally + { MOD |SHIFT|CONTROL,XK_n, maxhalf, {.i=TWOBWM_MAXHALF_UNFOLD_HORIZONTAL}}, + // Next/Previous screen + { MOD , XK_comma, changescreen, {.i=TWOBWM_NEXT_SCREEN}}, + { MOD , XK_period, changescreen, {.i=TWOBWM_PREVIOUS_SCREEN}}, + // Raise or lower a window + { MOD , XK_r, raiseorlower, {}}, + // Next/Previous workspace + { MOD , XK_v, nextworkspace, {}}, + { MOD , XK_c, prevworkspace, {}}, + // Move to Next/Previous workspace + { MOD |SHIFT , XK_v, sendtonextworkspace,{}}, + { MOD |SHIFT , XK_c, sendtoprevworkspace,{}}, + // Iconify the window + { MOD |SHIFT, XK_i, hide, {}}, + // Make the window unkillable + { MOD , XK_a, unkillable, {}}, + // Make the window appear always on top + { MOD, XK_t, always_on_top, {}}, + // Make the window stay on all workspaces + { MOD , XK_f, fix, {}}, + // Move the cursor + { MOD , XK_Up, cursor_move, {.i=TWOBWM_CURSOR_UP_SLOW}}, + { MOD , XK_Down, cursor_move, {.i=TWOBWM_CURSOR_DOWN_SLOW}}, + { MOD , XK_Right, cursor_move, {.i=TWOBWM_CURSOR_RIGHT_SLOW}}, + { MOD , XK_Left, cursor_move, {.i=TWOBWM_CURSOR_LEFT_SLOW}}, + // Move the cursor faster + { MOD |SHIFT, XK_Up, cursor_move, {.i=TWOBWM_CURSOR_UP}}, + { MOD |SHIFT, XK_Down, cursor_move, {.i=TWOBWM_CURSOR_DOWN}}, + { MOD |SHIFT, XK_Right, cursor_move, {.i=TWOBWM_CURSOR_RIGHT}}, + { MOD |SHIFT, XK_Left, cursor_move, {.i=TWOBWM_CURSOR_LEFT}}, + // Start programs + { MOD , XK_d, start, {.com = menucmd}}, + { MOD , XK_i , start, {.com = termcmd}}, + // Exit or restart 2bwm + { MOD |SHIFT , XK_e, twobwm_exit, {.i=0}}, + { MOD |SHIFT , XK_r, twobwm_restart, {.i=0}}, + // Change current workspace + DESKTOPCHANGE( XK_1, 0) + DESKTOPCHANGE( XK_2, 1) + DESKTOPCHANGE( XK_3, 2) + DESKTOPCHANGE( XK_4, 3) + DESKTOPCHANGE( XK_5, 4) + DESKTOPCHANGE( XK_6, 5) + DESKTOPCHANGE( XK_7, 6) + DESKTOPCHANGE( XK_8, 7) + DESKTOPCHANGE( XK_9, 8) + DESKTOPCHANGE( XK_0, 9) +}; +// the last argument makes it a root window only event +static Button buttons[] = { + { MOD ,XCB_BUTTON_INDEX_1, mousemotion, {.i=TWOBWM_MOVE}, false}, + { MOD ,XCB_BUTTON_INDEX_3, mousemotion, {.i=TWOBWM_RESIZE}, false}, + { 0 ,XCB_BUTTON_INDEX_3, start, {.com = menucmd}, true}, + { MOD|SHIFT, XCB_BUTTON_INDEX_1, changeworkspace, {.i=0}, false}, + { MOD|SHIFT, XCB_BUTTON_INDEX_3, changeworkspace, {.i=1}, false}, + { MOD|ALT, XCB_BUTTON_INDEX_1, changescreen, {.i=1}, false}, + { MOD|ALT, XCB_BUTTON_INDEX_3, changescreen, {.i=0}, false} +}; -- cgit v1.2.3