diff options
author | Julian T <julian@jtle.dk> | 2022-12-15 16:07:56 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2022-12-15 16:07:56 +0100 |
commit | c318f302aa9be6e7c63fcf6d09dcbc853c18169c (patch) | |
tree | 84554f163b97613cdce10d9e924af6292b926c00 | |
parent | 0c45f03b0b9f348a6eb0460bf8215929a69bf35c (diff) |
2bwm add last workspace command
-rw-r--r-- | 2bwm/resc/2bwm/PKGBUILD | 9 | ||||
-rw-r--r-- | 2bwm/resc/2bwm/config.h | 2 | ||||
-rw-r--r-- | 2bwm/resc/2bwm/lastws.patch | 40 |
3 files changed, 48 insertions, 3 deletions
diff --git a/2bwm/resc/2bwm/PKGBUILD b/2bwm/resc/2bwm/PKGBUILD index 5d2376b..4dcdbac 100644 --- a/2bwm/resc/2bwm/PKGBUILD +++ b/2bwm/resc/2bwm/PKGBUILD @@ -9,14 +9,17 @@ license=('ISC') depends=('xcb-util-wm' 'xcb-util-keysyms' 'xcb-util-xrm') conflicts=('2bwm-git' 'mcwm' 'mcwm-git') # due to /usr/bin/hidden program makedepends=('git' 'xcb-util') -source=("$pkgname::git+https://github.com/bbidulock/2bwm.git#tag=v${pkgver}" '2bwm.desktop' '2bwm.copying' 'config.h') +source=("$pkgname::git+https://github.com/bbidulock/2bwm.git#tag=v${pkgver}" '2bwm.desktop' '2bwm.copying' 'config.h' 'lastws.patch') md5sums=('SKIP' '4342d9210effbe4bfb58722f4275aa5c' 'adaee5c7e455ba15e0ca9a2692464253' - 'SKIP') + 'SKIP' + 'e553c0ed17e19743305358ba50139b05') prepare() { - cp $srcdir/config.h $pkgname/config.h -v + cd "$pkgname" + patch < $srcdir/lastws.patch + cp $srcdir/config.h config.h -v } build() { diff --git a/2bwm/resc/2bwm/config.h b/2bwm/resc/2bwm/config.h index 7d4340b..b587cd5 100644 --- a/2bwm/resc/2bwm/config.h +++ b/2bwm/resc/2bwm/config.h @@ -149,6 +149,8 @@ static key keys[] = { // Next/Previous workspace { MOD , XK_v, nextworkspace, {}}, { MOD , XK_c, prevworkspace, {}}, + // Last visisted workspace + { MOD , XK_space, lastworkspace, {}}, // Move to Next/Previous workspace { MOD |SHIFT , XK_v, sendtonextworkspace,{}}, { MOD |SHIFT , XK_c, sendtoprevworkspace,{}}, diff --git a/2bwm/resc/2bwm/lastws.patch b/2bwm/resc/2bwm/lastws.patch new file mode 100644 index 0000000..6ebd557 --- /dev/null +++ b/2bwm/resc/2bwm/lastws.patch @@ -0,0 +1,40 @@ +diff '--color=auto' --unified --recursive --text --color 2bwm.orig/2bwm.c 2bwm.new/2bwm.c +--- 2bwm.orig/2bwm.c 2022-12-15 15:59:21.739548339 +0100 ++++ 2bwm.new/2bwm.c 2022-12-15 15:59:15.602734354 +0100 +@@ -42,6 +42,7 @@ + xcb_screen_t *screen = NULL; // Our current screen. + int randrbase = 0; // Beginning of RANDR extension events. + static uint8_t curws = 0; // Current workspace. ++static uint8_t lstws = 0; // Last workspace + struct client *focuswin = NULL; // Current focus window. + static xcb_drawable_t top_win=0; // Window always on top. + static struct item *winlist = NULL; // Global list of all client windows. +@@ -86,6 +87,7 @@ + static void arrangewindows(void); + static void prevworkspace(); + static void nextworkspace(); ++static void lastworkspace(); + static void getrandr(void); + static void raise_current_window(void); + static void raiseorlower(); +@@ -214,6 +216,12 @@ + : changeworkspace_helper(WORKSPACES-1);} + + void ++lastworkspace() ++{ ++ changeworkspace_helper(lstws); ++} ++ ++void + twobwm_exit() + { + exit(EXIT_SUCCESS); +@@ -503,6 +511,7 @@ + xcb_map_window(conn, client->id); + } + ++ lstws = curws; + curws = ws; + pointer = xcb_query_pointer_reply(conn, xcb_query_pointer(conn, + screen->root), 0); |