Skip to content

Commit

Permalink
Remove IPC, add shell.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaskallup committed Nov 20, 2023
1 parent af87be0 commit 8ba1cba
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 236 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
13 changes: 3 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CF
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS)

all: dwl
dwl: dwl.o util.o dwl-ipc-unstable-v2-protocol.o
$(CC) dwl.o util.o dwl-ipc-unstable-v2-protocol.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
dwl.o: dwl.c config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h dwl-ipc-unstable-v2-protocol.h
dwl: dwl.o util.o
$(CC) dwl.o util.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
dwl.o: dwl.c config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h
util.o: util.c util.h
dwl-ipc-unstable-v2-protocol.o: dwl-ipc-unstable-v2-protocol.h

# wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up
Expand All @@ -32,12 +31,6 @@ xdg-shell-protocol.h:
wlr-layer-shell-unstable-v1-protocol.h:
$(WAYLAND_SCANNER) server-header \
protocols/wlr-layer-shell-unstable-v1.xml $@
dwl-ipc-unstable-v2-protocol.h:
$(WAYLAND_SCANNER) server-header \
protocols/dwl-ipc-unstable-v2.xml $@
dwl-ipc-unstable-v2-protocol.c:
$(WAYLAND_SCANNER) private-code \
protocols/dwl-ipc-unstable-v2.xml $@

config.h:
cp config.def.h $@
Expand Down
18 changes: 12 additions & 6 deletions config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ static const char *const autostart[] = {
"dbus-sway-environment", NULL,
"configure-gtk", NULL,
"systemctl", "--user", "--import-environment", NULL,
"waybar", NULL,
"dwl-post-start.sh", NULL,
NULL /* terminate */
};
Expand All @@ -33,12 +32,13 @@ static const char *const autostart[] = {
static int log_level = WLR_ERROR;

static const Rule rules[] = {
/* app_id title tags mask isfloating monitor */
/* app_id title tags mask isfloating monitor */
/* examples:
{ "Gimp", NULL, 0, 1, -1 },
*/
/*{ "firefox", NULL, 1 << 1, 0, -1 },*/
{ "flameshot", NULL, 0, 1, -1 },
{ "firefox", NULL, 1 << 1, 0, -1 },
{ "Slack", NULL, 1 << 8, 0, -1 },
{ "flameshot", NULL, 0, 1, -1 },
};

/* layout(s) */
Expand All @@ -65,7 +65,7 @@ static const struct xkb_rule_names xkb_rules = {
/* example:
.options = "ctrl:nocaps",
*/
.options = NULL,
.options = "compose:ralt",
};

static const int repeat_rate = 25;
Expand Down Expand Up @@ -135,13 +135,15 @@ static const char *downvol[] = { "wpctl", "set-volume", "@DEFAULT_AUDIO_SIN
static const char *mutevol[] = { "wpctl", "set-mute", "@DEFAULT_AUDIO_SINK@", "toggle", NULL };
static const char *brightup[] = { "light", "-A", "10", NULL };
static const char *brightdown[] = { "light", "-U", "10", NULL };
static const char *fnottdismiss[] = { "fnottctl", "dismiss", NULL };
static const char *fnottdismissall[] = { "fnottctl", "dismiss", "all", NULL };
static const char *lockcmd[] = { "lock.sh", 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|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
{ MODKEY, XKB_KEY_b, togglebar, {0}},
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
Expand All @@ -163,6 +165,10 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less, tagmon, {.i = WLR_DIRECTION_LEFT} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} },

{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_l, spawn, {.v = lockcmd } },
{ WLR_MODIFIER_CTRL, XKB_KEY_space, spawn, {.v = fnottdismiss } },
{ WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT, XKB_KEY_space, spawn, {.v = fnottdismissall } },

{ 0, XKB_KEY_XF86AudioLowerVolume, spawn, {.v = downvol } },
{ 0, XKB_KEY_XF86AudioMute, spawn, {.v = mutevol } },
Expand Down
Loading

0 comments on commit 8ba1cba

Please sign in to comment.