summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbd <bdunahu@colostate.edu>2024-05-18 01:42:03 -0600
committerbd <bdunahu@colostate.edu>2024-05-18 01:42:03 -0600
commit8c4d353a989d44d7c95758ef3b5e21342783913a (patch)
tree480072f8ca45932c4cb64abaeb8e19f91ee7cdf1
parent7104dd0563171b8f6797dd5d803023c4d4cdbacf (diff)
Improve dwm/emacs integration bindings
-rw-r--r--.config/emacs/modules/bd--tabs.el10
-rw-r--r--.config/guix/modules/dwm/config.def.h15
-rw-r--r--.config/guix/modules/shell.scm8
3 files changed, 23 insertions, 10 deletions
diff --git a/.config/emacs/modules/bd--tabs.el b/.config/emacs/modules/bd--tabs.el
index f85c226..e5e11f9 100644
--- a/.config/emacs/modules/bd--tabs.el
+++ b/.config/emacs/modules/bd--tabs.el
@@ -41,6 +41,16 @@
(keymap-global-set "C-x p v" 'magit-project-status)
+(defun bd/contextual-shell ()
+ "Opens the current project's shell,
+or a default shell if no project is open."
+ (interactive)
+ (let ((project (project-current)))
+ (if project
+ (project-shell)
+ (shell))))
+
+
(setq tab-bar-tab-name-function #'bd/tab-bar-name-function)
diff --git a/.config/guix/modules/dwm/config.def.h b/.config/guix/modules/dwm/config.def.h
index 3ee81ee..657ed7f 100644
--- a/.config/guix/modules/dwm/config.def.h
+++ b/.config/guix/modules/dwm/config.def.h
@@ -2,7 +2,7 @@
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
-static const unsigned int gappx = 8; /* gaps between windows */
+static const unsigned int gappx = 60; /* gaps between windows */
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
@@ -74,7 +74,7 @@ static const Layout layouts[] = {
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
/* tools */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_black, "-sf", col_gray4, NULL };
-static const char *termcmd[] = { "st", NULL };
+static const char *termcmd[] = { "emacsclient", "-nce", "(bd/contextual-shell)", NULL };
static const char *slockcmd[] = { "slock", NULL };
/* sound control */
static const char *togmute[] = { "pactl", "set-sink-mute", "@DEFAULT_SINK@", "toggle", NULL };
@@ -87,17 +87,18 @@ static const char *mpcnext[] = { "mpc", "next", NULL };
static const char *flameselect[] = { "flameshot", "launcher", NULL };
static const char *flameall[] = { "flameshot", "full", NULL };
/* other applications */
-static const char *icecatcmd[] = { "icecat", NULL };
-static const char *wolfcmd[] = { "librewolf", NULL };
-static const char *emacscmd[] = { "emacsclient", "-nc", NULL };
+static const char *icecmd[] = { "icecat", NULL };
+static const char *wolfcmd[] = { "librewolf", NULL };
+static const char *emacscmd[] = { "emacsclient", "-nce", "(switch-to-buffer nil)", NULL };
static const Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_x, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_l, spawn, {.v = slockcmd } },
- { MODKEY|ShiftMask, XK_Return, spawn, {.v = emacscmd } },
- { MODKEY|ShiftMask, XK_b, spawn, {.v = icecatcmd } },
+ { MODKEY, XK_Return, spawn, {.v = emacscmd } },
+ { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
+ { MODKEY|ShiftMask, XK_b, spawn, {.v = icecmd } },
{ MODKEY|ShiftMask, XK_c, spawn, {.v = wolfcmd } },
{ MODKEY|ShiftMask, XK_o, spawn, SHCMD("xdotool type $(grep -v '^#' /home/bdunahu/Personal/scripts/bookmarks.txt | dmenu -i -l 4 | awk '{print $NF}')") },
{ MODKEY|ShiftMask, XK_p, spawn, SHCMD("passmenu --type") },
diff --git a/.config/guix/modules/shell.scm b/.config/guix/modules/shell.scm
index 23acb41..1381c24 100644
--- a/.config/guix/modules/shell.scm
+++ b/.config/guix/modules/shell.scm
@@ -10,17 +10,19 @@
(list
(service home-bash-service-type
(home-bash-configuration
- (aliases '(("suspend" . "sudo bash -c 'echo mem > /sys/power/state'")
+ (aliases '(("cp" . "cp -i")
+ ("grep" . "grep --color=auto")
("guix-home" . "RUNNING_GUIX_HOME=1 guix home -L ${HOME}/.config/guix/modules/ reconfigure ${HOME}/.config/guix/${HOSTNAME}.scm")
("guix-system" . "RUNNING_GUIX_HOME=0 sudo guix system -L ${HOME}/.config/guix/modules/ reconfigure ${HOME}/.config/guix/${HOSTNAME}.scm")
- ("cp" . "cp -i")
- ("grep" . "grep --color=auto")
("ll" . "ls -l")
("ls" . "ls -p --color=auto")
("mkd" . "mkdir -pv")
("mv" . "mv -i")
("rm" . "rm -i")
+ ("suspend" . "sudo bash -c 'echo mem > /sys/power/state'")
("vi" . "vim")
+ ("xeb" . "emacsclient -nce '(switch-to-buffer nil)'")
+ ("xet" . "emacsclient -nce '(bd/contextual-shell)'")
("ytta" . "yt-dlp --extract-audio --format bestaudio/best")
("yttv" . "yt-dlp -f b")))