void-packages

Void Source Packages
git clone git://ezup.dev/void-packages.git
Log | Files | Refs | README | LICENSE

config.h (12189B)


      1///---User configurable stuff---///
      2///---Modifiers---///
      3#define MOD             XCB_MOD_MASK_4       /* Super/Windows key  or check xmodmap(1) with -pm  defined in /usr/include/xcb/xproto.h */
      4///--Speed---///
      5/* Move this many pixels when moving or resizing with keyboard unless the window has hints saying otherwise.
      6 *0)move step slow   1)move step fast
      7 *2)mouse slow       3)mouse fast     */
      8static const uint16_t movements[] = {20,40,15,400};
      9/* resize by line like in mcwm -- jmbi */
     10static const bool     resize_by_line          = true;
     11/* the ratio used when resizing and keeping the aspect */
     12static const float    resize_keep_aspect_ratio= 1.03;
     13///---Offsets---///
     14/*0)offsetx          1)offsety
     15 *2)maxwidth         3)maxheight */
     16static const uint8_t offsets[] = {0,0,0,0}; /* 0, 35, 0, 24 */
     17///---Colors---///
     18/*0)focuscol         1)unfocuscol
     19 *2)fixedcol         3)unkilcol
     20 *4)fixedunkilcol    5)outerbordercol
     21 *6)emptycol         */
     22static const char *colors[] = {"#35586c","#333333","#7a8c5c","#ff6666","#cc9933","#0d131a","#000000"};
     23/* if this is set to true the inner border and outer borders colors will be swapped */
     24static const bool inverted_colors = true;
     25///---Cursor---///
     26/* default position of the cursor:
     27 * correct values are:
     28 * TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT, MIDDLE
     29 * All these are relative to the current window. */
     30#define CURSOR_POSITION MIDDLE
     31///---Borders---///
     32/*0) Outer border size. If you put this negative it will be a square.
     33 *1) Full borderwidth    2) Magnet border size
     34 *3) Resize border size  */
     35static const uint8_t borders[] = {3,5,5,4};
     36/* Windows that won't have a border.
     37 * It uses substring comparison with what is found in the WM_NAME
     38 * attribute of the window. You can test this using `xprop WM_NAME`
     39 */
     40#define LOOK_INTO "WM_NAME"
     41static const char *ignore_names[] = {"bar", "xclock"};
     42///--Menus and Programs---///
     43static const char *termcmd[]   = { "st", NULL };
     44static const char *menucmd[]   = { "dmenu_run", NULL };
     45///--Custom foo---///
     46static void halfandcentered(const Arg *arg)
     47{
     48	Arg arg2 = {.i=TWOBWM_MAXHALF_VERTICAL_LEFT};
     49	maxhalf(&arg2);
     50	Arg arg3 = {.i=TWOBWM_TELEPORT_CENTER};
     51	teleport(&arg3);
     52}
     53///---Sloppy focus behavior---///
     54/*
     55 * Command to execute when switching from sloppy focus to click to focus
     56 * The strings "Sloppy" and "Click" will be passed as the last argument
     57 * If NULL this is ignored
     58 */
     59static const char *sloppy_switch_cmd[] = {};
     60//static const char *sloppy_switch_cmd[] = { "notify-send", "toggle sloppy", NULL };
     61static void toggle_sloppy(const Arg *arg)
     62{
     63	is_sloppy = !is_sloppy;
     64	if (arg->com != NULL && LENGTH(arg->com) > 0) {
     65		start(arg);
     66	}
     67}
     68///---Shortcuts---///
     69/* Check /usr/include/X11/keysymdef.h for the list of all keys
     70 * 0x000000 is for no modkey
     71 * If you are having trouble finding the right keycode use the `xev` to get it
     72 * For example:
     73 * KeyRelease event, serial 40, synthetic NO, window 0x1e00001,
     74 *  root 0x98, subw 0x0, time 211120530, (128,73), root:(855,214),
     75 *  state 0x10, keycode 171 (keysym 0x1008ff17, XF86AudioNext), same_screen YES,
     76 *  XLookupString gives 0 bytes: 
     77 *  XFilterEvent returns: False
     78 *
     79 *  The keycode here is keysym 0x1008ff17, so use  0x1008ff17
     80 *
     81 *
     82 * For AZERTY keyboards XK_1...0 should be replaced by :
     83 *      DESKTOPCHANGE(     XK_ampersand,                     0)
     84 *      DESKTOPCHANGE(     XK_eacute,                        1)
     85 *      DESKTOPCHANGE(     XK_quotedbl,                      2)
     86 *      DESKTOPCHANGE(     XK_apostrophe,                    3)
     87 *      DESKTOPCHANGE(     XK_parenleft,                     4)
     88 *      DESKTOPCHANGE(     XK_minus,                         5)
     89 *      DESKTOPCHANGE(     XK_egrave,                        6)
     90 *      DESKTOPCHANGE(     XK_underscore,                    7)
     91 *      DESKTOPCHANGE(     XK_ccedilla,                      8)
     92 *      DESKTOPCHANGE(     XK_agrave,                        9)*
     93 */
     94#define DESKTOPCHANGE(K,N) \
     95{  MOD ,             K,              changeworkspace, {.i=N}}, \
     96{  MOD |SHIFT,       K,              sendtoworkspace, {.i=N}},
     97static key keys[] = {
     98    /* modifier           key            function           argument */
     99    // Focus to next/previous window
    100    {  MOD ,              XK_Tab,        focusnext,         {.i=TWOBWM_FOCUS_NEXT}},
    101    {  MOD |SHIFT,        XK_Tab,        focusnext,         {.i=TWOBWM_FOCUS_PREVIOUS}},
    102    // Kill a window
    103    {  MOD ,              XK_q,          deletewin,         {}},
    104    // Resize a window
    105    {  MOD |SHIFT,        XK_k,          resizestep,        {.i=TWOBWM_RESIZE_UP}},
    106    {  MOD |SHIFT,        XK_j,          resizestep,        {.i=TWOBWM_RESIZE_DOWN}},
    107    {  MOD |SHIFT,        XK_l,          resizestep,        {.i=TWOBWM_RESIZE_RIGHT}},
    108    {  MOD |SHIFT,        XK_h,          resizestep,        {.i=TWOBWM_RESIZE_LEFT}},
    109    // Resize a window slower
    110    {  MOD |SHIFT|CONTROL,XK_k,          resizestep,        {.i=TWOBWM_RESIZE_UP_SLOW}},
    111    {  MOD |SHIFT|CONTROL,XK_j,          resizestep,        {.i=TWOBWM_RESIZE_DOWN_SLOW}},
    112    {  MOD |SHIFT|CONTROL,XK_l,          resizestep,        {.i=TWOBWM_RESIZE_RIGHT_SLOW}},
    113    {  MOD |SHIFT|CONTROL,XK_h,          resizestep,        {.i=TWOBWM_RESIZE_LEFT_SLOW}},
    114    // Move a window
    115    {  MOD ,              XK_k,          movestep,          {.i=TWOBWM_MOVE_UP}},
    116    {  MOD ,              XK_j,          movestep,          {.i=TWOBWM_MOVE_DOWN}},
    117    {  MOD ,              XK_l,          movestep,          {.i=TWOBWM_MOVE_RIGHT}},
    118    {  MOD ,              XK_h,          movestep,          {.i=TWOBWM_MOVE_LEFT}},
    119    // Move a window slower
    120    {  MOD |CONTROL,      XK_k,          movestep,          {.i=TWOBWM_MOVE_UP_SLOW}},
    121    {  MOD |CONTROL,      XK_j,          movestep,          {.i=TWOBWM_MOVE_DOWN_SLOW}},
    122    {  MOD |CONTROL,      XK_l,          movestep,          {.i=TWOBWM_MOVE_RIGHT_SLOW}},
    123    {  MOD |CONTROL,      XK_h,          movestep,          {.i=TWOBWM_MOVE_LEFT_SLOW}},
    124    // Teleport the window to an area of the screen.
    125    // Center:
    126    {  MOD ,              XK_g,          teleport,          {.i=TWOBWM_TELEPORT_CENTER}},
    127    // Center y:
    128    {  MOD |SHIFT,        XK_g,          teleport,          {.i=TWOBWM_TELEPORT_CENTER_Y}},
    129    // Center x:
    130    {  MOD |CONTROL,      XK_g,          teleport,          {.i=TWOBWM_TELEPORT_CENTER_X}},
    131    // Top left:
    132    {  MOD ,              XK_y,          teleport,          {.i=TWOBWM_TELEPORT_TOP_LEFT}},
    133    // Top right:
    134    {  MOD ,              XK_u,          teleport,          {.i=TWOBWM_TELEPORT_TOP_RIGHT}},
    135    // Bottom left:
    136    {  MOD ,              XK_b,          teleport,          {.i=TWOBWM_TELEPORT_BOTTOM_LEFT}},
    137    // Bottom right:
    138    {  MOD ,              XK_n,          teleport,          {.i=TWOBWM_TELEPORT_BOTTOM_RIGHT}},
    139    // Resize while keeping the window aspect
    140    {  MOD ,              XK_Home,       resizestep_aspect, {.i=TWOBWM_RESIZE_KEEP_ASPECT_GROW}},
    141    {  MOD ,              XK_End,        resizestep_aspect, {.i=TWOBWM_RESIZE_KEEP_ASPECT_SHRINK}},
    142    // Maximize (ignore offset and no EWMH atom)
    143    {  MOD ,              XK_x,          maximize,          {}},
    144    // Full screen (disregarding offsets and adding EWMH atom)
    145    {  MOD |SHIFT ,       XK_x,          fullscreen,        {}},
    146    // Maximize vertically
    147    {  MOD ,              XK_m,          maxvert_hor,       {.i=TWOBWM_MAXIMIZE_VERTICALLY}},
    148    // Maximize horizontally
    149    {  MOD |SHIFT,        XK_m,          maxvert_hor,       {.i=TWOBWM_MAXIMIZE_HORIZONTALLY}},
    150    // Maximize and move
    151    // vertically left
    152    {  MOD |SHIFT,        XK_y,          maxhalf,           {.i=TWOBWM_MAXHALF_VERTICAL_LEFT}},
    153    // vertically right
    154    {  MOD |SHIFT,        XK_u,          maxhalf,           {.i=TWOBWM_MAXHALF_VERTICAL_RIGHT}},
    155    // horizontally left
    156    {  MOD |SHIFT,        XK_b,          maxhalf,           {.i=TWOBWM_MAXHALF_HORIZONTAL_BOTTOM}},
    157    // horizontally right
    158    {  MOD |SHIFT,        XK_n,          maxhalf,           {.i=TWOBWM_MAXHALF_HORIZONTAL_TOP}},
    159    //fold half vertically
    160    {  MOD |SHIFT|CONTROL,XK_y,          maxhalf,           {.i=TWOBWM_MAXHALF_FOLD_VERTICAL}},
    161    //fold half horizontally
    162    {  MOD |SHIFT|CONTROL,XK_b,          maxhalf,           {.i=TWOBWM_MAXHALF_FOLD_HORIZONTAL}},
    163    //unfold vertically
    164    {  MOD |SHIFT|CONTROL,XK_u,          maxhalf,           {.i=TWOBWM_MAXHALF_UNFOLD_VERTICAL}},
    165    //unfold horizontally
    166    {  MOD |SHIFT|CONTROL,XK_n,          maxhalf,           {.i=TWOBWM_MAXHALF_UNFOLD_HORIZONTAL}},
    167    // Next/Previous screen
    168    {  MOD ,              XK_comma,      changescreen,      {.i=TWOBWM_NEXT_SCREEN}},
    169    {  MOD ,              XK_period,     changescreen,      {.i=TWOBWM_PREVIOUS_SCREEN}},
    170    // Raise or lower a window
    171    {  MOD ,              XK_r,          raiseorlower,      {}},
    172    // Next/Previous workspace
    173    {  MOD ,              XK_v,          nextworkspace,     {}},
    174    {  MOD ,              XK_c,          prevworkspace,     {}},
    175    // Move to Next/Previous workspace
    176    {  MOD |SHIFT ,       XK_v,          sendtonextworkspace,{}},
    177    {  MOD |SHIFT ,       XK_c,          sendtoprevworkspace,{}},
    178    // Iconify the window
    179    {  MOD ,              XK_i,          hide,              {}},
    180    // Make the window unkillable
    181    {  MOD ,              XK_a,          unkillable,        {}},
    182    // Make the window appear always on top
    183    {  MOD,               XK_t,          always_on_top,     {}},
    184    // Make the window stay on all workspaces
    185    {  MOD ,              XK_f,          fix,               {}},
    186    // Move the cursor
    187    {  MOD ,              XK_Up,         cursor_move,       {.i=TWOBWM_CURSOR_UP_SLOW}},
    188    {  MOD ,              XK_Down,       cursor_move,       {.i=TWOBWM_CURSOR_DOWN_SLOW}},
    189    {  MOD ,              XK_Right,      cursor_move,       {.i=TWOBWM_CURSOR_RIGHT_SLOW}},
    190    {  MOD ,              XK_Left,       cursor_move,       {.i=TWOBWM_CURSOR_LEFT_SLOW}},
    191    // Move the cursor faster
    192    {  MOD |SHIFT,        XK_Up,         cursor_move,       {.i=TWOBWM_CURSOR_UP}},
    193    {  MOD |SHIFT,        XK_Down,       cursor_move,       {.i=TWOBWM_CURSOR_DOWN}},
    194    {  MOD |SHIFT,        XK_Right,      cursor_move,       {.i=TWOBWM_CURSOR_RIGHT}},
    195    {  MOD |SHIFT,        XK_Left,       cursor_move,       {.i=TWOBWM_CURSOR_LEFT}},
    196    // Start programs
    197    {  MOD ,              XK_w,          start,             {.com = menucmd}},
    198    {  MOD ,              XK_Return,     start,             {.com = termcmd}},
    199    // Exit or restart 2bwm
    200    {  MOD |CONTROL,      XK_q,          twobwm_exit,       {.i=0}},
    201    {  MOD |CONTROL,      XK_r,          twobwm_restart,    {.i=0}},
    202    {  MOD ,              XK_space,      halfandcentered,   {.i=0}},
    203    {  MOD ,              XK_s,          toggle_sloppy,     {.com = sloppy_switch_cmd}},
    204    // Change current workspace
    205       DESKTOPCHANGE(     XK_asterisk,                      0)  // 0
    206       DESKTOPCHANGE(     XK_parenleft,                     1)  // 1
    207       DESKTOPCHANGE(     XK_parenright,                    2)
    208       DESKTOPCHANGE(     XK_braceright,                    3)
    209       DESKTOPCHANGE(     XK_plus,                          4)
    210       DESKTOPCHANGE(     XK_braceleft,                     5)
    211       DESKTOPCHANGE(     XK_bracketright,                  6)
    212       DESKTOPCHANGE(     XK_bracketleft,                   7)
    213       DESKTOPCHANGE(     XK_exclam,                        8)
    214       DESKTOPCHANGE(     XK_equal,                         9)  // 9
    215};
    216// the last argument makes it a root window only event
    217static Button buttons[] = {
    218    {  MOD        ,XCB_BUTTON_INDEX_1,     mousemotion,   {.i=TWOBWM_MOVE}, false},
    219    {  MOD        ,XCB_BUTTON_INDEX_3,     mousemotion,   {.i=TWOBWM_RESIZE}, false},
    220    {  0          ,XCB_BUTTON_INDEX_3,     start,         {.com = menucmd}, true},
    221    {  MOD|SHIFT,  XCB_BUTTON_INDEX_1,     changeworkspace, {.i=0}, false},
    222    {  MOD|SHIFT,  XCB_BUTTON_INDEX_3,     changeworkspace, {.i=1}, false},
    223    {  MOD|ALT,    XCB_BUTTON_INDEX_1,     changescreen,    {.i=1}, false},
    224    {  MOD|ALT,    XCB_BUTTON_INDEX_3,     changescreen,    {.i=0}, false}
    225};