mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
Compare commits
No commits in common. "64162db4b90df6edf6b536e5ecfcaa426bd28877" and "46e5c3812f917194ae6150817aa1be11c77c75e5" have entirely different histories.
64162db4b9
...
46e5c3812f
17
config.def.h
17
config.def.h
@ -1,9 +1,5 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
/* Helper macros for spawning commands */
|
||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||
#define CMD(...) { .v = (const char*[]){ __VA_ARGS__, NULL } }
|
||||
|
||||
/* appearance */
|
||||
#if ROUNDED_CORNERS_PATCH
|
||||
static const unsigned int borderpx = 0; /* border pixel of windows */
|
||||
@ -403,13 +399,6 @@ static char *statuscolors[][ColCount] = {
|
||||
static const char *layoutmenu_cmd = "layoutmenu.sh";
|
||||
#endif
|
||||
|
||||
#if BAR_LAUNCHER_PATCH
|
||||
static const Launcher launchers[] = {
|
||||
/* icon to display command */
|
||||
{ "surf", CMD("surf", "duckduckgo.com") },
|
||||
};
|
||||
#endif // BAR_LAUNCHER_PATCH
|
||||
|
||||
#if COOL_AUTOSTART_PATCH
|
||||
static const char *const autostart[] = {
|
||||
"st", NULL,
|
||||
@ -559,9 +548,6 @@ static const BarRule barrules[] = {
|
||||
#if BAR_STATUSBUTTON_PATCH
|
||||
{ -1, 0, BAR_ALIGN_LEFT, width_stbutton, draw_stbutton, click_stbutton, NULL, "statusbutton" },
|
||||
#endif // BAR_STATUSBUTTON_PATCH
|
||||
#if BAR_LAUNCHER_PATCH
|
||||
{ -1, 0, BAR_ALIGN_LEFT, width_launcher, draw_launcher, click_launcher, NULL, "launcher" },
|
||||
#endif // BAR_LAUNCHER_PATCH
|
||||
#if BAR_POWERLINE_TAGS_PATCH
|
||||
{ 0, 0, BAR_ALIGN_LEFT, width_pwrl_tags, draw_pwrl_tags, click_pwrl_tags, hover_pwrl_tags, "powerline_tags" },
|
||||
#endif // BAR_POWERLINE_TAGS_PATCH
|
||||
@ -861,6 +847,9 @@ static const char *xkb_layouts[] = {
|
||||
#define HOLDKEY 0 // replace 0 with the keysym to activate holdbar
|
||||
#endif // BAR_HOLDBAR_PATCH
|
||||
|
||||
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||
|
||||
/* commands */
|
||||
#if !NODMENU_PATCH
|
||||
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
||||
|
22
config.h
22
config.h
@ -1,10 +1,6 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
#include <X11/XF86keysym.h>
|
||||
|
||||
/* Helper macros for spawning commands */
|
||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||
#define CMD(...) { .v = (const char*[]){ __VA_ARGS__, NULL } }
|
||||
|
||||
/* appearance */
|
||||
#if ROUNDED_CORNERS_PATCH
|
||||
static const unsigned int borderpx = 0; /* border pixel of windows */
|
||||
@ -404,13 +400,6 @@ static char *statuscolors[][ColCount] = {
|
||||
static const char *layoutmenu_cmd = "layoutmenu.sh";
|
||||
#endif
|
||||
|
||||
#if BAR_LAUNCHER_PATCH
|
||||
static const Launcher launchers[] = {
|
||||
/* icon to display command */
|
||||
{ "firefox", CMD("firefox", "duckduckgo.com") },
|
||||
};
|
||||
#endif // BAR_LAUNCHER_PATCH
|
||||
|
||||
#if COOL_AUTOSTART_PATCH
|
||||
static const char *const autostart[] = {
|
||||
"dwmblocks", NULL,
|
||||
@ -533,6 +522,7 @@ static const Rule rules[] = {
|
||||
RULE(.class = "Qalculate-gtk", .tags = SPTAG(2), .isfloating = 1)
|
||||
RULE(.instance = "spmusic", .tags = SPTAG(3), .isfloating = 1)
|
||||
RULE(.instance = "spnotes", .tags = SPTAG(4), .isfloating = 1)
|
||||
RULE(.instance = "spterm", .tags = SPTAG(0), .isfloating = 1)
|
||||
|
||||
RULE(.instance = "dictionary", .isfloating = 1)
|
||||
RULE(.class = "volume-ui", .isfloating = 1)
|
||||
@ -588,9 +578,6 @@ static const BarRule barrules[] = {
|
||||
#if BAR_STATUSBUTTON_PATCH
|
||||
{ -1, 0, BAR_ALIGN_LEFT, width_stbutton, draw_stbutton, click_stbutton, NULL, "statusbutton" },
|
||||
#endif // BAR_STATUSBUTTON_PATCH
|
||||
#if BAR_LAUNCHER_PATCH
|
||||
{ -1, 0, BAR_ALIGN_LEFT, width_launcher, draw_launcher, click_launcher, NULL, "launcher" },
|
||||
#endif // BAR_LAUNCHER_PATCH
|
||||
#if BAR_POWERLINE_TAGS_PATCH
|
||||
{ 0, 0, BAR_ALIGN_LEFT, width_pwrl_tags, draw_pwrl_tags, click_pwrl_tags, hover_pwrl_tags, "powerline_tags" },
|
||||
#endif // BAR_POWERLINE_TAGS_PATCH
|
||||
@ -891,6 +878,9 @@ static const char *xkb_layouts[] = {
|
||||
#define HOLDKEY 0 // replace 0 with the keysym to activate holdbar
|
||||
#endif // BAR_HOLDBAR_PATCH
|
||||
|
||||
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||
|
||||
/* commands */
|
||||
#if !NODMENU_PATCH
|
||||
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
||||
@ -985,8 +975,7 @@ static const Key keys[] = {
|
||||
{ ALTKEY, XK_h, spawn, {.v = (const char*[]){ "dmenuhandler" , NULL} } },
|
||||
{ ALTKEY, XK_l, spawn, {.v = (const char*[]){"dictionary", NULL } } },
|
||||
{ MODKEY, XK_Return, spawn, {.v = (const char *[]){"st", NULL}}},
|
||||
// { ALTKEY, XK_Return, spawn, {.v = (const char *[]){"kitty", "-d", "~/projects/videos/fzf", NULL}}},
|
||||
{ ALTKEY, XK_Return, spawn, {.v = (const char*[]){"kitty", NULL}}},
|
||||
{ ALTKEY, XK_Return, spawn, {.v = (const char *[]){"kitty", "-d", "~/projects/videos/fzf", NULL}}},
|
||||
{ MODKEY, XK_v, spawn, {.v = (const char*[]){"st", "men", NULL } } },
|
||||
{ MODKEY|ShiftMask, XK_b, spawn, {.v = (const char*[]){ "dmenu_web", "--add" , NULL } } },
|
||||
{ MODKEY, XK_n, spawn, {.v = (const char*[]){ "st", "-e", "nvim", NULL } } },
|
||||
@ -1429,6 +1418,7 @@ static const Command commands[] = {
|
||||
#else
|
||||
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
|
||||
#endif //
|
||||
|
||||
static const Button buttons[] = {
|
||||
/* click event mask button function argument */
|
||||
{ ClkRootWin, 0, Button1, spawn, SHCMD("dunstctl close-all; killall dmenu") },
|
||||
|
1
dwm.c
1
dwm.c
@ -4102,7 +4102,6 @@ spawn(const Arg *arg)
|
||||
if (arg->v == dmenucmd)
|
||||
dmenumon[0] = '0' + selmon->num;
|
||||
#endif // NODMENU_PATCH
|
||||
fprintf(stderr, "spawn running cmd:\n");
|
||||
|
||||
#if RIODRAW_PATCH
|
||||
if ((pid = fork()) == 0)
|
||||
|
@ -1,81 +0,0 @@
|
||||
#if BAR_STATUS2D_PATCH
|
||||
int
|
||||
width_launcher(Bar *bar, BarArg *a)
|
||||
{
|
||||
int i, x = 0;
|
||||
|
||||
for (i = 0; i < LENGTH(launchers); i++) {
|
||||
x += status2dtextlength(launchers[i].name) + lrpad;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
int
|
||||
draw_launcher(Bar *bar, BarArg *a)
|
||||
{
|
||||
int i, w = 0;;
|
||||
|
||||
for (i = 0; i < LENGTH(launchers); i++) {
|
||||
w = status2dtextlength(launchers[i].name);
|
||||
drawstatusbar(a, launchers[i].name);
|
||||
a->x += w + lrpad;
|
||||
}
|
||||
|
||||
return a->x ;
|
||||
}
|
||||
|
||||
int
|
||||
click_launcher(Bar *bar, Arg *arg, BarArg *a)
|
||||
{
|
||||
int i, x = 0;
|
||||
|
||||
for (i = 0; i < LENGTH(launchers); i++) {
|
||||
x += status2dtextlength(launchers[i].name) + lrpad;
|
||||
if (a->x < x) {
|
||||
spawn(&launchers[i].command);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
int
|
||||
width_launcher(Bar *bar, BarArg *a)
|
||||
{
|
||||
int i, x = 0;
|
||||
|
||||
for (i = 0; i < LENGTH(launchers); i++) {
|
||||
x += TEXTW(launchers[i].name);
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
int
|
||||
draw_launcher(Bar *bar, BarArg *a)
|
||||
{
|
||||
int i, x = 0, w = 0;;
|
||||
|
||||
for (i = 0; i < LENGTH(launchers); i++) {
|
||||
w = TEXTW(launchers[i].name);
|
||||
drw_text(drw, x, 0, w, bh, lrpad / 2, launchers[i].name, 0, True);
|
||||
x += w;
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
int
|
||||
click_launcher(Bar *bar, Arg *arg, BarArg *a)
|
||||
{
|
||||
int i, x = 0;
|
||||
|
||||
for (i = 0; i < LENGTH(launchers); i++) {
|
||||
x += TEXTW(launchers[i].name);
|
||||
if (a->x < x) {
|
||||
spawn(&launchers[i].command);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
#endif // BAR_STATUS2D_PATCH
|
@ -1,8 +0,0 @@
|
||||
typedef struct {
|
||||
char* name;
|
||||
const Arg command;
|
||||
} Launcher;
|
||||
|
||||
static int width_launcher(Bar *bar, BarArg *a);
|
||||
static int draw_launcher(Bar *bar, BarArg *a);
|
||||
static int click_launcher(Bar *bar, Arg *arg, BarArg *a);
|
@ -15,3 +15,4 @@ click_ltsymbol(Bar *bar, Arg *arg, BarArg *a)
|
||||
{
|
||||
return ClkLtSymbol;
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
static int width_ltsymbol(Bar *bar, BarArg *a);
|
||||
static int draw_ltsymbol(Bar *bar, BarArg *a);
|
||||
static int click_ltsymbol(Bar *bar, Arg *arg, BarArg *a);
|
||||
|
||||
|
@ -96,7 +96,6 @@ drawstatusbar(BarArg *a, char* stext)
|
||||
#else
|
||||
memcpy(text, stext, len);
|
||||
#endif // BAR_STATUSCMD_PATCH
|
||||
text[len] = '\0';
|
||||
|
||||
x += lrpad / 2;
|
||||
drw_setscheme(drw, scheme[LENGTH(colors)]);
|
||||
|
@ -21,9 +21,6 @@
|
||||
#if COMBO_PATCH
|
||||
#include "combo.c"
|
||||
#endif
|
||||
#if BAR_LAUNCHER_PATCH
|
||||
#include "bar_launcher.c"
|
||||
#endif
|
||||
#if BAR_LTSYMBOL_PATCH
|
||||
#include "bar_ltsymbol.c"
|
||||
#endif
|
||||
|
@ -24,9 +24,6 @@
|
||||
#if BAR_HOLDBAR_PATCH
|
||||
#include "bar_holdbar.h"
|
||||
#endif
|
||||
#if BAR_LAUNCHER_PATCH
|
||||
#include "bar_launcher.h"
|
||||
#endif
|
||||
#if BAR_LTSYMBOL_PATCH
|
||||
#include "bar_ltsymbol.h"
|
||||
#endif
|
||||
|
@ -67,11 +67,6 @@
|
||||
*/
|
||||
#define BAR_FLEXWINTITLE_PATCH 0
|
||||
|
||||
/* Adds buttons to the bar that can be used to launch applications.
|
||||
* https://dwm.suckless.org/patches/launcher/
|
||||
*/
|
||||
#define BAR_LAUNCHER_PATCH 0
|
||||
|
||||
/* This patch adds a context menu for layout switching.
|
||||
* - xmenu needs to be installed.
|
||||
* - Edit layoutmenu.sh with the installed layouts and with correct indexes.
|
||||
|
@ -67,11 +67,6 @@
|
||||
*/
|
||||
#define BAR_FLEXWINTITLE_PATCH 0
|
||||
|
||||
/* Adds buttons to the bar that can be used to launch applications.
|
||||
* https://dwm.suckless.org/patches/launcher/
|
||||
*/
|
||||
#define BAR_LAUNCHER_PATCH 0
|
||||
|
||||
/* This patch adds a context menu for layout switching.
|
||||
* - xmenu needs to be installed.
|
||||
* - Edit layoutmenu.sh with the installed layouts and with correct indexes.
|
||||
|
Loading…
Reference in New Issue
Block a user