summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config.def.h121
-rw-r--r--dwl.c79
-rw-r--r--dwl.desktop2
3 files changed, 68 insertions, 134 deletions
diff --git a/config.def.h b/config.def.h
index e9154fd..2c7ad73 100644
--- a/config.def.h
+++ b/config.def.h
@@ -80,7 +80,9 @@ static const MonitorRule monrules[] = {
{ "eDP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
*/
/* defaults */
- { NULL, 0.5f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
+ { "DP-3", 0.5f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0 },
+ { "HDMI-A-3", 0.5f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0 },
+ { "DP-1", 0.5f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 1920, 0 },
};
/* keyboard */
@@ -141,14 +143,16 @@ LIBINPUT_CONFIG_TAP_MAP_LMR -- 1/2/3 finger tap maps to left/middle/right
static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TAP_MAP_LRM;
/* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */
-#define MODKEY WLR_MODIFIER_LOGO
-#define METAKEY WLR_MODIFIER_ALT
+#define MODKEY WLR_MODIFIER_LOGO
+#define META WLR_MODIFIER_ALT
+#define CTRL WLR_MODIFIER_CTRL
+#define SHIFT WLR_MODIFIER_SHIFT
#define TAGKEYS(KEY,SKEY,TAG) \
- { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
- { MODKEY|WLR_MODIFIER_ALT|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \
- { MODKEY|WLR_MODIFIER_SHIFT, SKEY, tag, {.ui = 1 << TAG} }, \
- { MODKEY|WLR_MODIFIER_ALT, KEY, toggletag, {.ui = 1 << TAG} }
+ { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
+ { MODKEY|META|CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \
+ { MODKEY|SHIFT, SKEY, tag, {.ui = 1 << TAG} }, \
+ { MODKEY|META, KEY, toggletag, {.ui = 1 << TAG} }
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
@@ -156,57 +160,66 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
/* commands */
static const char *termcmd[] = { "alacritty", NULL };
static const char *menucmd[] = { "wmenu-run", NULL };
+static const char *dmpass_full_cmd[] = { "dmpass", "--full", NULL };
+static const char *dmpass_cmd[] = { "dmpass", NULL };
+static const char *dmotp_cmd[] = { "dmotp", NULL };
static const char *browser_cmd[] = { "firefox", NULL };
static const Key keys[] = {
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
- /* modifier key function argument */
- { MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
- { MODKEY, XKB_KEY_Return, spawn, {.v = termcmd} },
- { MODKEY, XKB_KEY_F3, spawn, {.v = browser_cmd } },
- { MODKEY, XKB_KEY_b, togglebar, {0} },
- { MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
- { MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_J, movestack, {.i = +1} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_K, movestack, {.i = -1} },
- { MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
- { MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
- { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_a, incnmaster, {.i = +1} },
- { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_x, incnmaster, {.i = -1} },
- { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_minus, setmfact, {.f = -0.025f} },
- { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_equal, setmfact, {.f = +0.025f} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, zoom, {0} },
- { METAKEY, XKB_KEY_Escape, view, {0} },
- { MODKEY, XKB_KEY_q, killclient, {0} },
- { MODKEY, XKB_KEY_s, setlayout, {.v = &layouts[0]} },
- { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[1]} },
- { MODKEY, XKB_KEY_n, setlayout, {.v = &layouts[2]} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, setlayout, {0} },
- { MODKEY, XKB_KEY_space, togglefloating, {0} },
- { MODKEY, XKB_KEY_f, togglefullscreen, {0} },
- { MODKEY, XKB_KEY_0, view, {.ui = ~0} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
- { MODKEY, XKB_KEY_bracketleft, focusmon, {.i = WLR_DIRECTION_LEFT} },
- { MODKEY, XKB_KEY_bracketright, focusmon, {.i = WLR_DIRECTION_RIGHT} },
- { MODKEY, XKB_KEY_h, focusmon, {.i = WLR_DIRECTION_LEFT} },
- { MODKEY, XKB_KEY_l, focusmon, {.i = WLR_DIRECTION_RIGHT} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_H, tagmon, {.i = WLR_DIRECTION_LEFT} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_L, tagmon, {.i = WLR_DIRECTION_RIGHT} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_bracketleft, tagmon, {.i = WLR_DIRECTION_LEFT} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_bracketright, tagmon, {.i = WLR_DIRECTION_RIGHT} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_H, focusmon, {.i = WLR_DIRECTION_LEFT} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_L, focusmon, {.i = WLR_DIRECTION_RIGHT} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_leftmiddlecurlybrace, focusmon, {.i = WLR_DIRECTION_LEFT} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_rightmiddlecurlybrace, focusmon, {.i = WLR_DIRECTION_RIGHT} },
- TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0),
- TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1),
- TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2),
- TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3),
- TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4),
- TAGKEYS( XKB_KEY_6, XKB_KEY_asciicircum, 5),
- TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6),
- TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7),
- TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8),
+ /* modifier key function argument */
+ { MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
+ { MODKEY, XKB_KEY_Return, spawn, {.v = termcmd} },
+ { MODKEY, XKB_KEY_F3, spawn, {.v = browser_cmd } },
+ { MODKEY|CTRL, XKB_KEY_p, spawn, {.v = dmpass_cmd } },
+ { MODKEY|CTRL|SHIFT, XKB_KEY_p, spawn, {.v = dmpass_full_cmd } },
+ { MODKEY|CTRL, XKB_KEY_o, spawn, {.v = dmotp_cmd } },
+ { MODKEY, XKB_KEY_b, togglebar, {0} },
+ { MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
+ { MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
+ { MODKEY|SHIFT, XKB_KEY_J, movestack, {.i = +1} },
+ { MODKEY|SHIFT, XKB_KEY_K, movestack, {.i = -1} },
+ { MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
+ { MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
+ { MODKEY|CTRL, XKB_KEY_a, incnmaster, {.i = +1} },
+ { MODKEY|CTRL, XKB_KEY_x, incnmaster, {.i = -1} },
+ { MODKEY|CTRL, XKB_KEY_minus, setmfact, {.f = -0.025f} },
+ { MODKEY|CTRL, XKB_KEY_equal, setmfact, {.f = +0.025f} },
+ { MODKEY, XKB_KEY_minus, incigaps, {.i = -1 } },
+ { MODKEY, XKB_KEY_equal, incigaps, {.i = +1 } },
+ { MODKEY|SHIFT, XKB_KEY_plus, togglegaps, {0} },
+ { MODKEY|SHIFT, XKB_KEY_Return, zoom, {0} },
+ { META, XKB_KEY_Escape, view, {0} },
+ { MODKEY, XKB_KEY_q, killclient, {0} },
+ { MODKEY, XKB_KEY_s, setlayout, {.v = &layouts[0]} },
+ { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[1]} },
+ { MODKEY, XKB_KEY_n, setlayout, {.v = &layouts[2]} },
+ { MODKEY|SHIFT, XKB_KEY_space, setlayout, {0} },
+ { MODKEY, XKB_KEY_space, togglefloating, {0} },
+ { MODKEY, XKB_KEY_f, togglefullscreen, {0} },
+ { MODKEY, XKB_KEY_0, view, {.ui = ~0} },
+ { MODKEY|SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
+ { MODKEY, XKB_KEY_bracketleft, focusmon, {.i = WLR_DIRECTION_LEFT} },
+ { MODKEY, XKB_KEY_bracketright, focusmon, {.i = WLR_DIRECTION_RIGHT} },
+ { MODKEY, XKB_KEY_h, focusmon, {.i = WLR_DIRECTION_LEFT} },
+ { MODKEY, XKB_KEY_l, focusmon, {.i = WLR_DIRECTION_RIGHT} },
+ { MODKEY|SHIFT, XKB_KEY_H, tagmon, {.i = WLR_DIRECTION_LEFT} },
+ { MODKEY|SHIFT, XKB_KEY_L, tagmon, {.i = WLR_DIRECTION_RIGHT} },
+ { MODKEY|SHIFT, XKB_KEY_bracketleft, tagmon, {.i = WLR_DIRECTION_LEFT} },
+ { MODKEY|SHIFT, XKB_KEY_bracketright, tagmon, {.i = WLR_DIRECTION_RIGHT} },
+ { MODKEY|SHIFT, XKB_KEY_H, focusmon, {.i = WLR_DIRECTION_LEFT} },
+ { MODKEY|SHIFT, XKB_KEY_L, focusmon, {.i = WLR_DIRECTION_RIGHT} },
+ { MODKEY|SHIFT, XKB_KEY_leftmiddlecurlybrace, focusmon, {.i = WLR_DIRECTION_LEFT} },
+ { MODKEY|SHIFT, XKB_KEY_rightmiddlecurlybrace, focusmon, {.i = WLR_DIRECTION_RIGHT} },
+ TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0),
+ TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1),
+ TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2),
+ TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3),
+ TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4),
+ TAGKEYS( XKB_KEY_6, XKB_KEY_asciicircum, 5),
+ TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6),
+ TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7),
+ TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8),
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_E, quit, {0} },
/* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
diff --git a/dwl.c b/dwl.c
index 9e4f6c5..f8af818 100644
--- a/dwl.c
+++ b/dwl.c
@@ -318,7 +318,6 @@ static void createpopup(struct wl_listener *listener, void *data);
static void cursorconstrain(struct wlr_pointer_constraint_v1 *constraint);
static void cursorframe(struct wl_listener *listener, void *data);
static void cursorwarptohint(void);
-static void defaultgaps(const Arg *arg);
static void destroydecoration(struct wl_listener *listener, void *data);
static void destroydragicon(struct wl_listener *listener, void *data);
static void destroyidleinhibitor(struct wl_listener *listener, void *data);
@@ -341,13 +340,7 @@ static void fullscreennotify(struct wl_listener *listener, void *data);
static void gpureset(struct wl_listener *listener, void *data);
static void handlesig(int signo);
static void incnmaster(const Arg *arg);
-static void incgaps(const Arg *arg);
static void incigaps(const Arg *arg);
-static void incihgaps(const Arg *arg);
-static void incivgaps(const Arg *arg);
-static void incogaps(const Arg *arg);
-static void incohgaps(const Arg *arg);
-static void incovgaps(const Arg *arg);
static void inputdevice(struct wl_listener *listener, void *data);
static int keybinding(uint32_t mods, xkb_keysym_t sym);
static void keypress(struct wl_listener *listener, void *data);
@@ -1453,12 +1446,6 @@ cursorwarptohint(void)
}
void
-defaultgaps(const Arg *arg)
-{
- setgaps(gappoh, gappov, gappih, gappiv);
-}
-
-void
destroydecoration(struct wl_listener *listener, void *data)
{
Client *c = wl_container_of(listener, c, destroy_decoration);
@@ -1940,17 +1927,6 @@ incnmaster(const Arg *arg)
}
void
-incgaps(const Arg *arg)
-{
- setgaps(
- selmon->gappoh + arg->i,
- selmon->gappov + arg->i,
- selmon->gappih + arg->i,
- selmon->gappiv + arg->i
- );
-}
-
-void
incigaps(const Arg *arg)
{
setgaps(
@@ -1962,61 +1938,6 @@ incigaps(const Arg *arg)
}
void
-incihgaps(const Arg *arg)
-{
- setgaps(
- selmon->gappoh,
- selmon->gappov,
- selmon->gappih + arg->i,
- selmon->gappiv
- );
-}
-
-void
-incivgaps(const Arg *arg)
-{
- setgaps(
- selmon->gappoh,
- selmon->gappov,
- selmon->gappih,
- selmon->gappiv + arg->i
- );
-}
-
-void
-incogaps(const Arg *arg)
-{
- setgaps(
- selmon->gappoh + arg->i,
- selmon->gappov + arg->i,
- selmon->gappih,
- selmon->gappiv
- );
-}
-
-void
-incohgaps(const Arg *arg)
-{
- setgaps(
- selmon->gappoh + arg->i,
- selmon->gappov,
- selmon->gappih,
- selmon->gappiv
- );
-}
-
-void
-incovgaps(const Arg *arg)
-{
- setgaps(
- selmon->gappoh,
- selmon->gappov + arg->i,
- selmon->gappih,
- selmon->gappiv
- );
-}
-
-void
inputdevice(struct wl_listener *listener, void *data)
{
/* This event is raised by the backend when a new input device becomes
diff --git a/dwl.desktop b/dwl.desktop
index 5609521..aaefde9 100644
--- a/dwl.desktop
+++ b/dwl.desktop
@@ -1,5 +1,5 @@
[Desktop Entry]
Name=dwl
Comment=dwm for Wayland
-Exec=dwl -s /home/jozan/.config/wayland/init.sh
+Exec=dbus-run-session dwl -s /home/jozan/.config/wayland/init.sh
Type=Application