dotfiles

custom dotfiles
git clone git://git.pyratebeard.net/dotfiles.git
Log | Files | Refs | README

config.h (12954B)


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