Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed runorraise, scratchpad

  • Loading branch information...
commit fe2948330b2d066822c091fd7a51a2e64a92c44f 1 parent d2d1f08
ok100 authored
View
78 02-dwm-6.0-scratchpad-stay.diff
@@ -1,78 +0,0 @@
---- dwm.c.orig 2012-11-19 18:25:51.463494022 +0100
-+++ dwm.c 2012-11-19 18:27:51.557394350 +0100
-@@ -231,6 +231,7 @@ static int textnw(const char *text, unsi
- static void tile(Monitor *);
- static void togglebar(const Arg *arg);
- static void togglefloating(const Arg *arg);
-+static void togglescratch(const Arg *arg);
- static void toggletag(const Arg *arg);
- static void toggleview(const Arg *arg);
- static void unfocus(Client *c, Bool setfocus);
-@@ -288,6 +289,8 @@ static Window root;
- /* configuration, allows nested code to access above variables */
- #include "config.h"
-
-+static unsigned int scratchpadtag = 1 << LENGTH(tags); /* This tag specially for you, Scratchpad. */
-+
- /* compile-time check if all tags fit into an unsigned int bit array. */
- struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
-
-@@ -1171,6 +1174,16 @@ manage(Window w, XWindowAttributes *wa)
- && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my);
- c->bw = borderpx;
-
-+ if(strcmp(c->name, scratchpadname) == 0) {
-+ c->tags = scratchpadtag;
-+ c->isfloating = True;
-+ c->x = (c->mon->mw - c->w) - 10;
-+ c->y = 20;
-+ c->mon->tagset[c->mon->seltags] |= c->tags;
-+ } else { /* make sure non-scratchpads stay out of scratchpadtag */
-+ c->tags &= TAGMASK;
-+ }
-+
- wc.border_width = c->bw;
- XConfigureWindow(dpy, w, CWBorderWidth, &wc);
- XSetWindowBorder(dpy, w, dc.colors[0][ColBorder]);
-@@ -1775,6 +1788,25 @@ togglefloating(const Arg *arg) {
- }
-
- void
-+togglescratch(const Arg *arg) {
-+ Client *c = NULL;
-+ unsigned int found = 0;
-+ /* check if a scratchpad is already there in scratchpadtag */
-+ for(c = selmon->clients; c && !(found = c->tags & scratchpadtag); c = c->next);
-+ if(!found) { /* not found: launch it and put it in its tag (see manage()) */
-+ spawn(arg);
-+ return;
-+ }
-+ unsigned int newtagset = selmon->tagset[selmon->seltags] ^ scratchpadtag;
-+ if(newtagset) {
-+ selmon->tagset[selmon->seltags] = newtagset;
-+ arrange(selmon);
-+ }
-+ focus(c);
-+}
-+
-+
-+void
- toggletag(const Arg *arg) {
- unsigned int newtags;
-
-@@ -2071,11 +2103,14 @@ updatewmhints(Client *c) {
-
- void
- view(const Arg *arg) {
-- if((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
-+ unsigned int stag = selmon->tagset[selmon->seltags] & scratchpadtag;
-+
-+ if((arg->ui & TAGMASK) == (selmon->tagset[selmon->seltags] & TAGMASK))
- return;
- selmon->seltags ^= 1; /* toggle sel tagset */
- if(arg->ui & TAGMASK)
- selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
-+ selmon->tagset[selmon->seltags] |= stag;
- focus(NULL);
- arrange(selmon);
- }
View
0  03-dwm-6.0-single_window_no_border.diff → 02-dwm-6.0-single_window_no_border.diff
File renamed without changes
View
0  04-dwm-6.0-centred-floating.diff → 03-dwm-6.0-centred-floating.diff
File renamed without changes
View
0  05-dwm-6.0-save_floats.diff → 04-dwm-6.0-save_floats.diff
File renamed without changes
View
0  06-dwm-6.0-no_title.diff → 05-dwm-6.0-no_title.diff
File renamed without changes
View
13 PKGBUILD
@@ -16,15 +16,13 @@ install=dwm.install
source=(http://dl.suckless.org/dwm/dwm-$pkgver.tar.gz
config.h
push.c
- runorraise.c
bstack.c
dwm.desktop)
_patches=(01-dwm-$pkgver-statuscolors.diff
- 02-dwm-$pkgver-scratchpad-stay.diff
- 03-dwm-$pkgver-single_window_no_border.diff
- 04-dwm-$pkgver-centred-floating.diff
- 05-dwm-$pkgver-save_floats.diff
- 06-dwm-$pkgver-no_title.diff)
+ 02-dwm-$pkgver-single_window_no_border.diff
+ 03-dwm-$pkgver-centred-floating.diff
+ 04-dwm-$pkgver-save_floats.diff
+ 05-dwm-$pkgver-no_title.diff)
source=(${source[@]} ${_patches[@]})
build() {
@@ -37,13 +35,14 @@ build() {
cp $srcdir/config.h config.h
cp $srcdir/push.c push.c
- cp $srcdir/runorraise.c runorraise.c
cp $srcdir/bstack.c bstack.c
+
sed -i 's/CPPFLAGS =/CPPFLAGS +=/g' config.mk
sed -i 's/^CFLAGS = -g/#CFLAGS += -g/g' config.mk
sed -i 's/^#CFLAGS = -std/CFLAGS += -std/g' config.mk
sed -i 's/^LDFLAGS = -g/#LDFLAGS += -g/g' config.mk
sed -i 's/^#LDFLAGS = -s/LDFLAGS += -s/g' config.mk
+
make X11INC=/usr/include/X11 X11LIB=/usr/lib/X11
}
View
10 config.h
@@ -2,7 +2,6 @@
#include <X11/XF86keysym.h>
#include <bstack.c>
#include <push.c>
-#include <runorraise.c>
/* appearance */
static const char font[] = "-*-tamsyn-medium-*-*-*-14-*-*-*-*-*-*-*";
@@ -10,7 +9,7 @@ static const char font[] = "-*-tamsyn-medium-*-*-*-14-*-*-*-*-*-*-*";
#define NUMCOLORS 20
static const char colors[NUMCOLORS][ColLast][20] = {
/* border fg bg */
- { "#403F3E", "#94928F", "#140C0B" }, /* 01 - normal */
+ { "#403F3E", "#877A70", "#140C0B" }, /* 01 - normal */
{ "#666362", "#CDCDCD", "#140C0B" }, /* 02 - selected */
{ "#91444D", "#91444D", "#140C0B" }, /* 03 - urgent */
@@ -37,7 +36,6 @@ static const unsigned int borderpx = 1; /* border pixel of windows *
static const unsigned int snap = 8; /* snap pixel */
static const Bool showbar = True; /* False means no bar */
static const Bool topbar = True; /* False means bottom bar */
-static const char scratchpadname[] = "Scratchpad"; /* scratchpad window title */
/* layout(s) */
static const float mfact = 0.50; /* factor of master area size [0.05..0.95] */
@@ -111,7 +109,6 @@ static const char *menu[] = { "mygtkmenu", "/home/ok/.menu", NULL };
static const char *music[] = { "urxvtc", "-title", "music", "-e", "/home/ok/bin/music", NULL };
static const char *pass[] = { "qpass", NULL };
static const char *reload[] = { "systemctl", "--user", "restart", "dwm", NULL };
-static const char *scratchpad[] = { "urxvtc", "-title", scratchpadname, "-geometry", "70x9+400+10", NULL };
static const char *screenoff[] = { "xset", "dpms", "force", "off", NULL };
static const char *shutdown[] = { "/home/ok/bin/dmenu-powerbutton", NULL };
static const char *term[] = { "urxvtc", NULL };
@@ -127,16 +124,15 @@ static const char *prev[] = { "mpc", "-h", "/home/ok/.mpd/socket", "prev",
static Key keys[] = {
/* modifier key function argument */
- { Mod4Mask, XK_b, runorraise, {.v = browser } },
+ { Mod4Mask, XK_b, spawn, {.v = browser } },
{ Mod4Mask, XK_c, spawn, {.v = cliphist } },
{ Mod4Mask, XK_s, spawn, {.v = clipsync } },
- { Mod4Mask, XK_d, runorraise, {.v = dict } },
+ { Mod4Mask, XK_d, spawn, {.v = dict } },
{ 0, XK_Menu, spawn, {.v = dmenu } },
{ Mod4Mask, XK_space, spawn, {.v = menu } },
{ Mod4Mask, XK_m, spawn, {.v = music } },
{ Mod4Mask, XK_h, spawn, {.v = pass } },
{ MODKEY|ShiftMask, XK_r, spawn, {.v = reload } },
- { 0, XK_F12, togglescratch, {.v = scratchpad } },
{ 0, XF86XK_Launch1, spawn, {.v = screenoff } },
{ 0, XF86XK_PowerOff, spawn, {.v = shutdown } },
{ MODKEY, XK_Return, spawn, {.v = term } },
View
23 runorraise.c
@@ -1,23 +0,0 @@
-void
-runorraise(const Arg *arg) {
- const char **app = arg->v;
- Arg a = { .ui = ~0 };
- Monitor *mon;
- Client *c;
- XClassHint hint = { NULL, NULL };
-
- /* Tries to find the client */
- for (mon = mons; mon; mon = mon->next) {
- for (c = mon->clients; c; c = c->next) {
- XGetClassHint(dpy, c->win, &hint);
- if (hint.res_class && strcmp(app[2], hint.res_class) == 0) {
- a.ui = c->tags;
- view(&a);
- focus(c);
- return;
- }
- }
- }
- /* Client not found: spawn it */
- spawn(arg);
-}
Please sign in to comment.
Something went wrong with that request. Please try again.