dotfiles

My beautiful configs and dotfiles managed by Nix' home-manager
Log | Files | Refs | README | LICENSE

tabbed.h (2760B)


      1 /* See LICENSE file for copyright and license details. */
      2 
      3 #include "theme.h"
      4 
      5 /* appearance */
      6 static const char font[] = "Fira Code:size=10";
      7 static const char *colors[][3] = { // dark
      8   /*               fg         bg         border   */
      9     [SchemeNorm] = {white, "#3b484d", "#3b484d"},
     10     [SchemeSel] = {black, "#bd3d3f", "#bd3d3f"},
     11     [SchemeUrg] = {orange, gray3, orange},
     12   };
     13 
     14 static const char before[] = "<";
     15 static const char after[] = ">";
     16 static const char titletrim[] = "...";
     17 static const int tabwidth = 200;
     18 static const Bool foreground = True;
     19 static Bool urgentswitch = False;
     20 
     21 /*
     22  * Where to place a new tab when it is opened. When npisrelative is True,
     23  * then the current position is changed + newposition. If npisrelative
     24  * is False, then newposition is an absolute position.
     25  */
     26 static int newposition = 0;
     27 static Bool npisrelative = False;
     28 
     29 #define SETPROP(p)                                                             \
     30   {                                                                            \
     31     .v = (char *[]) {                                                          \
     32       "/bin/sh", "-c",                                                         \
     33           "prop=\"`xwininfo -children -id $1 | grep '^     0x' |"              \
     34           "sed -e's@^ *\\(0x[0-9a-f]*\\) \"\\([^\"]*\\)\".*@\\1 \\2@' |"       \
     35           "xargs -0 printf %b | dmenu -l 10 -w $1`\" &&"                       \
     36           "xprop -id $1 -f $0 8s -set $0 \"$prop\"",                           \
     37           p, winid, NULL                                                       \
     38     }                                                                          \
     39   }
     40 
     41 #define MODKEY ControlMask
     42 static const Key keys[] = {
     43     /* modifier             key        function     argument */
     44     {MODKEY | ShiftMask, XK_Return, focusonce, {0}},
     45     {MODKEY | ShiftMask, XK_Return, spawn, {0}},
     46 
     47     {MODKEY | ShiftMask, XK_l, rotate, {.i = +1}},
     48     {MODKEY | ShiftMask, XK_h, rotate, {.i = -1}},
     49     {MODKEY | ShiftMask, XK_j, movetab, {.i = -1}},
     50     {MODKEY | ShiftMask, XK_k, movetab, {.i = +1}},
     51     {MODKEY, XK_Tab, rotate, {.i = 0}},
     52 
     53     {MODKEY, XK_grave, spawn, SETPROP("_TABBED_SELECT_TAB")},
     54     {MODKEY, XK_1, move, {.i = 0}},
     55     {MODKEY, XK_2, move, {.i = 1}},
     56     {MODKEY, XK_3, move, {.i = 2}},
     57     {MODKEY, XK_4, move, {.i = 3}},
     58     {MODKEY, XK_5, move, {.i = 4}},
     59     {MODKEY, XK_6, move, {.i = 5}},
     60     {MODKEY, XK_7, move, {.i = 6}},
     61     {MODKEY, XK_8, move, {.i = 7}},
     62     {MODKEY, XK_9, move, {.i = 8}},
     63     {MODKEY, XK_0, move, {.i = 9}},
     64 
     65     {MODKEY, XK_q, killclient, {0}},
     66 
     67     {MODKEY, XK_u, focusurgent, {0}},
     68     {MODKEY | ShiftMask, XK_u, toggle, {.v = (void *)&urgentswitch}},
     69 
     70     {0, XK_F11, fullscreen, {0}},
     71 };