~brown121407/dwm

102e94ca7cd4f7930b47d7e54bc3fc714a150995 — Alexandru-Sergiu Marton 1 year, 22 days ago 44b9a5f
Change bindings.
3 files changed, 142 insertions(+), 39 deletions(-)

M LICENSE
M config.def.h
M dwm.c
M LICENSE => LICENSE +1 -0
@@ 17,6 17,7 @@ MIT/X Consortium License
© 2015-2016 Quentin Rameau <quinq@fifth.space>
© 2015-2016 Eric Pruitt <eric.pruitt@gmail.com>
© 2016-2017 Markus Teich <markus.teich@stusta.mhn.de>
© 2020 Alexandru-Sergiu Marton <brown121407@posteo.ro>

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),

M config.def.h => config.def.h +140 -39
@@ 85,46 85,8 @@ static const char *termcmd[]  = { "st", NULL };

static Key keys[] = {
	/* modifier                     key        function        argument */
	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
	{ MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
	{ MODKEY,                       XK_b,      togglebar,      {0} },
	STACKKEYS(MODKEY,                          focus)
	STACKKEYS(MODKEY|ShiftMask,                push)
	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
	{ MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
	{ MODKEY|Mod4Mask,              XK_h,      incrgaps,       {.i = +1 } },
	{ MODKEY|Mod4Mask,              XK_l,      incrgaps,       {.i = -1 } },
	{ MODKEY|Mod4Mask|ShiftMask,    XK_h,      incrogaps,      {.i = +1 } },
	{ MODKEY|Mod4Mask|ShiftMask,    XK_l,      incrogaps,      {.i = -1 } },
	{ MODKEY|Mod4Mask|ControlMask,  XK_h,      incrigaps,      {.i = +1 } },
	{ MODKEY|Mod4Mask|ControlMask,  XK_l,      incrigaps,      {.i = -1 } },
	{ MODKEY|Mod4Mask,              XK_0,      togglegaps,     {0} },
	{ MODKEY|Mod4Mask|ShiftMask,    XK_0,      defaultgaps,    {0} },
	{ MODKEY,                       XK_y,      incrihgaps,     {.i = +1 } },
	{ MODKEY,                       XK_o,      incrihgaps,     {.i = -1 } },
	{ MODKEY|ControlMask,           XK_y,      incrivgaps,     {.i = +1 } },
	{ MODKEY|ControlMask,           XK_o,      incrivgaps,     {.i = -1 } },
	{ MODKEY|Mod4Mask,              XK_y,      incrohgaps,     {.i = +1 } },
	{ MODKEY|Mod4Mask,              XK_o,      incrohgaps,     {.i = -1 } },
	{ MODKEY|ShiftMask,             XK_y,      incrovgaps,     {.i = +1 } },
	{ MODKEY|ShiftMask,             XK_o,      incrovgaps,     {.i = -1 } },
	{ MODKEY,                       XK_Return, zoom,           {0} },
	{ MODKEY,                       XK_Tab,    view,           {0} },
	{ MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
	{ MODKEY,                       XK_space,  setlayout,      {0} },
	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
	{ MODKEY|ShiftMask,             XK_f,      togglefullscr,  {0} },
	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
	TAGKEYS(                        XK_1,                      0)
	TAGKEYS(                        XK_2,                      1)
	TAGKEYS(                        XK_3,                      2)


@@ 134,7 96,146 @@ static Key keys[] = {
	TAGKEYS(                        XK_7,                      6)
	TAGKEYS(                        XK_8,                      7)
	TAGKEYS(                        XK_9,                      8)
	{ MODKEY|ShiftMask,             XK_BackSpace, quit,        {0} },
	{ MODKEY,               XK_0,           view,       {.ui = ~0 } },
	{ MODKEY|ShiftMask,     XK_0,           tag,        {.ui = ~0 } },

	{ MODKEY,               XK_minus,       spawn,      SHCMD("") },
	{ MODKEY|ShiftMask,     XK_minus,       spawn,      SHCMD("") },
	{ MODKEY,               XK_equal,       spawn,      SHCMD("") },
	{ MODKEY|ShiftMask,     XK_equal,       spawn,      SHCMD("") },
	{ MODKEY,               XK_BackSpace,   spawn,      SHCMD("") },
	{ MODKEY|ShiftMask,     XK_BackSpace,   spawn,      SHCMD("power") },


	{ MODKEY,            XK_Tab,      view,         {0} },
	{ MODKEY|ShiftMask,  XK_Tab,      spawn,        SHCMD("") },
	{ MODKEY,            XK_q,        killclient,   {0} },
	{ MODKEY|ShiftMask,  XK_q,        spawn,        SHCMD("") },
	{ MODKEY,            XK_w,        spawn,        SHCMD("$BROWSER") },
	{ MODKEY|ShiftMask,  XK_w,        spawn,        SHCMD("") },
	{ MODKEY,            XK_e,        spawn,        SHCMD("") },
	{ MODKEY|ShiftMask,  XK_e,        spawn,        SHCMD("") },
	{ MODKEY,            XK_r,        spawn,        SHCMD("st -e ranger") },
	{ MODKEY|ShiftMask,  XK_r,        spawn,        SHCMD("st -e htop") },
	{ MODKEY,            XK_t,        setlayout,    {.v = &layouts[0]} },
	{ MODKEY|ShiftMask,  XK_t,        setlayout,    {.v = &layouts[1]} },
	{ MODKEY,            XK_y,        setlayout,    {.v = &layouts[2]} },
	/* { MODKEY|ShiftMask,  XK_y,        setlayout,    {.v = &layouts[3]} }, */
	/* { MODKEY,            XK_u,        setlayout,    {.v = &layouts[4]} }, */
	/* { MODKEY|ShiftMask,  XK_u,        setlayout,    {.v = &layouts[5]} }, */
	/* { MODKEY,            XK_i,        setlayout,    {.v = &layouts[6]} }, */
	/* { MODKEY|ShiftMask,  XK_i,        setlayout,    {.v = &layouts[7]} }, */
	{ MODKEY,            XK_o,        incnmaster,   {.i = +1 } },
	{ MODKEY|ShiftMask,  XK_o,        incnmaster,   {.i = -1 } },

	{ MODKEY,            XK_p,            spawn,         SHCMD("") },
	{ MODKEY|ShiftMask,  XK_p,            spawn,         SHCMD("") },
	{ MODKEY,            XK_bracketleft,  spawn,         SHCMD("") },
	{ MODKEY|ShiftMask,  XK_bracketleft,  spawn,         SHCMD("") },
	{ MODKEY,            XK_bracketright, spawn,         SHCMD("") },
	{ MODKEY|ShiftMask,  XK_bracketright, spawn,         SHCMD("") },
	{ MODKEY,            XK_backslash,    view,          {0} },
	{ MODKEY|ShiftMask,  XK_backslash,    spawn,         SHCMD("") },

	{ MODKEY,            XK_a,            spawn,         SHCMD("st -e sound control") },
	{ MODKEY|ShiftMask,  XK_a,            spawn,         SHCMD("") },
	/* { MODKEY,            XK_s,            togglesticky,  {0} }, */
	{ MODKEY|ShiftMask,  XK_s,            spawn,         SHCMD("") },
	{ MODKEY,            XK_d,            spawn,         {.v = dmenucmd } },
	{ MODKEY|ShiftMask,  XK_d,            spawn,         SHCMD("") },
	{ MODKEY,            XK_f,            togglefullscr, {0} },
	{ MODKEY|ShiftMask,  XK_f,            setlayout,     {.v = &layouts[8]} },
	/* { MODKEY,            XK_g,            shiftview,     { .i = -1 } }, */
	/* { MODKEY|ShiftMask,  XK_g,            shifttag,      { .i = -1 } }, */
	{ MODKEY,            XK_h,            setmfact,      {.f = -0.05} },
	/* J and K are automatically bound above in STACKEYS */
	{ MODKEY,            XK_l,            setmfact,         {.f = +0.05} },
	/* { MODKEY,            XK_semicolon,    shiftview,        { .i = 1 } }, */
	/* { MODKEY|ShiftMask,  XK_semicolon,    shifttag,         { .i = 1 } }, */
	/* { MODKEY,            XK_apostrophe,   togglescratch,    {.ui = 1} }, */
	{ MODKEY|ShiftMask,  XK_apostrophe,   spawn,            SHCMD("") },
	{ MODKEY,            XK_Return,       spawn,            {.v = termcmd } },
	/* { MODKEY|ShiftMask,  XK_Return,       togglescratch,    {.ui = 0} }, */

	{ MODKEY,            XK_z,            incrgaps,         {.i = +1 } },
	{ MODKEY|ShiftMask,  XK_z,            incrgaps,         {.i = -1 } },
	{ MODKEY,            XK_x,            spawn,            SHCMD("") },
	{ MODKEY|ShiftMask,  XK_x,            spawn,            SHCMD("") },
	{ MODKEY,            XK_c,            spawn,            SHCMD("") },
	{ MODKEY|ShiftMask,  XK_c,            spawn,            SHCMD("") },
	{ MODKEY,            XK_v,            spawn,            SHCMD("") },
	{ MODKEY|ShiftMask,  XK_v,            spawn,            SHCMD("") },
	{ MODKEY,            XK_b,            togglebar,        {0} },
	{ MODKEY|ShiftMask,  XK_b,            spawn,            SHCMD("") },
	{ MODKEY,            XK_n,            spawn,            SHCMD("") },
	{ MODKEY|ShiftMask,  XK_n,            spawn,            SHCMD("") },
	{ MODKEY,            XK_m,            spawn,            SHCMD("") },
	{ MODKEY|ShiftMask,  XK_m,            spawn,            SHCMD("sound toggle") },
	{ MODKEY,            XK_comma,        spawn,            SHCMD("") },
	{ MODKEY|ShiftMask,  XK_comma,        spawn,            SHCMD("") },
	{ MODKEY,            XK_period,       spawn,            SHCMD("") },
	{ MODKEY|ShiftMask,  XK_period,       spawn,            SHCMD("") },

	{ MODKEY,            XK_Left,         focusmon,         {.i = -1 } },
	{ MODKEY|ShiftMask,  XK_Left,         tagmon,           {.i = -1 } },
	{ MODKEY,            XK_Right,        focusmon,         {.i = +1 } },
	{ MODKEY|ShiftMask,  XK_Right,        tagmon,           {.i = +1 } },

	/* { MODKEY,            XK_Page_Up,      shiftview,        { .i = -1 } }, */
	/* { MODKEY|ShiftMask,  XK_Page_Up,      shifttag,         { .i = -1 } }, */
	/* { MODKEY,            XK_Page_Down,    shiftview,        { .i = +1 } }, */
	/* { MODKEY|ShiftMask,  XK_Page_Down,    shifttag,         { .i = +1 } }, */
	{ MODKEY,            XK_Insert,       spawn,            SHCMD("notify-send \"📋 Clipboard contents:\" \"$(xclip -o -selection clipboard)\"") },

	{ MODKEY,            XK_F1,        spawn,        SHCMD("") },
	{ MODKEY,            XK_F2,        quit,         {0} },
	{ MODKEY,            XK_F3,        spawn,        SHCMD("") },
	{ MODKEY,            XK_F4,        spawn,        SHCMD("") },
	{ MODKEY,            XK_F5,        spawn,        SHCMD("") },
	{ MODKEY,            XK_F6,        spawn,        SHCMD("") },
	{ MODKEY,            XK_F7,        spawn,        SHCMD("") },
	{ MODKEY,            XK_F8,        spawn,        SHCMD("") },
	{ MODKEY,            XK_F9,        spawn,        SHCMD("dmenumount") },
	{ MODKEY,            XK_F10,       spawn,        SHCMD("dmenuumount") },
	{ MODKEY,            XK_F11,       spawn,        SHCMD("") },
	{ MODKEY,            XK_F12,       spawn,        SHCMD("") },
	{ MODKEY,            XK_space,     zoom,            {0} },
	{ MODKEY|ShiftMask,  XK_space,     togglefloating,  {0} },

	{ 0,                 XK_Print,          spawn,        SHCMD("scrot fs") },
	{ ShiftMask,         XK_Print,          spawn,        SHCMD("scrot menu") },
	{ MODKEY,            XK_Print,          spawn,        SHCMD("") },
	{ MODKEY|ShiftMask,  XK_Print,          spawn,        SHCMD("") },
	{ MODKEY,            XK_Delete,         spawn,        SHCMD("") },
	{ MODKEY,            XK_Scroll_Lock,    spawn,        SHCMD("") },

	{ 0, XF86XK_AudioMute,          spawn,        SHCMD("sound toggle") },
	{ 0, XF86XK_AudioRaiseVolume,   spawn,        SHCMD("sound up") },
	{ 0, XF86XK_AudioLowerVolume,   spawn,        SHCMD("sound down") },
	{ 0, XF86XK_AudioPrev,          spawn,        SHCMD("") },
	{ 0, XF86XK_AudioNext,          spawn,        SHCMD("") },
	{ 0, XF86XK_AudioPause,         spawn,        SHCMD("") },
	{ 0, XF86XK_AudioPlay,          spawn,        SHCMD("") },
	{ 0, XF86XK_AudioStop,          spawn,        SHCMD("") },
	{ 0, XF86XK_AudioRewind,        spawn,        SHCMD("") },
	{ 0, XF86XK_AudioForward,       spawn,        SHCMD("") },
	{ 0, XF86XK_AudioMedia,         spawn,        SHCMD("") },
	{ 0, XF86XK_PowerOff,           spawn,        SHCMD("power") },
	{ 0, XF86XK_Calculator,         spawn,        SHCMD("st -e bc -l") },
	{ 0, XF86XK_Sleep,              spawn,        SHCMD("power") },
	{ 0, XF86XK_WWW,                spawn,        SHCMD("$BROWSER") },
	{ 0, XF86XK_DOS,                spawn,        SHCMD("st") },
	{ 0, XF86XK_ScreenSaver,        spawn,        SHCMD("") },
	{ 0, XF86XK_TaskPane,           spawn,        SHCMD("st -e htop") },
	{ 0, XF86XK_Mail,               spawn,        SHCMD("") },
	{ 0, XF86XK_MyComputer,         spawn,        SHCMD("") },
	{ 0, XF86XK_Battery,            spawn,        SHCMD("") },
	{ 0, XF86XK_Launch1,            spawn,        SHCMD("") },
	{ 0, XF86XK_TouchpadToggle,     spawn,        SHCMD("") },
	{ 0, XF86XK_TouchpadOff,        spawn,        SHCMD("") },
	{ 0, XF86XK_TouchpadOn,         spawn,        SHCMD("") },
	{ 0, XF86XK_MonBrightnessUp,    spawn,        SHCMD("") },
	{ 0, XF86XK_MonBrightnessDown,  spawn,        SHCMD("") },
};

/* button definitions */

M dwm.c => dwm.c +1 -0
@@ 32,6 32,7 @@
#include <sys/wait.h>
#include <X11/cursorfont.h>
#include <X11/keysym.h>
#include <X11/XF86keysym.h>
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include <X11/Xproto.h>