Compare commits

..

1 Commits

Author SHA1 Message Date
Sravan Balaji
980cada075 Update Window Rules
- Add automatic tagging for Logseq, Gamescope, Syncthing, and Nyrna
- Remove auto tagging for specific gaming related apps since they
  should be running inside gamescope anyways
2023-11-14 19:18:42 -05:00
37 changed files with 354 additions and 1374 deletions

View File

@@ -1,4 +1,4 @@
This dwm 6.5 (5687f46, 2024-06-08) side project has a different take on dwm patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more. Due to the complexity of some of the patches dwm-flexipatch has diverged from mainstream dwm by making some core patches non-optional for maintenance reasons. For the classic dwm-flexipatch build refer to branch [dwm-flexipatch-1.0](https://github.com/bakkeby/dwm-flexipatch/tree/dwm-flexipatch-1.0). This dwm 6.4 (9f88553, 2023-09-22) side project has a different take on dwm patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more. Due to the complexity of some of the patches dwm-flexipatch has diverged from mainstream dwm by making some core patches non-optional for maintenance reasons. For the classic dwm-flexipatch build refer to branch [dwm-flexipatch-1.0](https://github.com/bakkeby/dwm-flexipatch/tree/dwm-flexipatch-1.0).
For example to include the `alpha` patch then you would only need to flip this setting from 0 to 1 in [patches.h](https://github.com/bakkeby/dwm-flexipatch/blob/master/patches.def.h): For example to include the `alpha` patch then you would only need to flip this setting from 0 to 1 in [patches.h](https://github.com/bakkeby/dwm-flexipatch/blob/master/patches.def.h):
```c ```c
@@ -19,14 +19,6 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6
### Changelog: ### Changelog:
2024-07-11 - Added variant of the launcher patch
2024-01-31 - Added the placedir patch
2023-12-22 - Added the do-not-die-on-color-allocation-failure patch
2023-12-01 - Added the sendmoncenter patch
2023-11-12 - Added the focusmaster-return patch variant 2023-11-12 - Added the focusmaster-return patch variant
2023-06-27 - Added the focusfollowmouse and unmanaged patches 2023-06-27 - Added the focusfollowmouse and unmanaged patches
@@ -365,10 +357,6 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6
- i.e. if topbar is 0 then dmenu will appear at the bottom and if 1 then dmenu will appear at - i.e. if topbar is 0 then dmenu will appear at the bottom and if 1 then dmenu will appear at
the top the top
- do-not-die-on-color-allocation-failure
- avoids dwm terminating (dying) on color allocation failures
- useful for the xrdb (xresources) and status2d patches
- [dragcfact](https://github.com/bakkeby/patches/wiki/dragcfact/) - [dragcfact](https://github.com/bakkeby/patches/wiki/dragcfact/)
- lets you resize clients' size (i.e. modify cfact) by holding modkey + shift + right-click - lets you resize clients' size (i.e. modify cfact) by holding modkey + shift + right-click
and dragging the mouse and dragging the mouse
@@ -524,9 +512,6 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6
- [killunsel](https://dwm.suckless.org/patches/killunsel/) - [killunsel](https://dwm.suckless.org/patches/killunsel/)
- kills all visible clients that are not selected (only the selected client will remain) - kills all visible clients that are not selected (only the selected client will remain)
- [launcher](https://dwm.suckless.org/patches/launcher/)
- adds buttons to the bar that can be used to launch applications
- [~leftlayout~](http://dwm.suckless.org/patches/leftlayout/) - [~leftlayout~](http://dwm.suckless.org/patches/leftlayout/)
- ~moves the layout symbol in the status bar to the left hand side~ - ~moves the layout symbol in the status bar to the left hand side~
@@ -608,9 +593,6 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6
- [pertag](https://dwm.suckless.org/patches/pertag/) - [pertag](https://dwm.suckless.org/patches/pertag/)
- adds nmaster, mfact, layouts and more per tag rather than per monitor - adds nmaster, mfact, layouts and more per tag rather than per monitor
- [placedir](https://github.com/bakkeby/patches/wiki/placedir)
- allows tiled windows to be moved in any direction (up, down, left, right)
- [placemouse](https://github.com/bakkeby/patches/wiki/placemouse) - [placemouse](https://github.com/bakkeby/patches/wiki/placemouse)
- lets the user change the position of a client in the stack using the mouse. - lets the user change the position of a client in the stack using the mouse.
@@ -668,9 +650,6 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6
- [selfrestart](https://dwm.suckless.org/patches/selfrestart/) - [selfrestart](https://dwm.suckless.org/patches/selfrestart/)
- restart dwm without the unnecessary dependency of an external script - restart dwm without the unnecessary dependency of an external script
- [sendmoncenter](https://dwm.suckless.org/patches/sendmoncenter/)
- floating windows being sent to another monitor will be centered
- [sendmon\_keepfocus](https://github.com/bakkeby/patches/wiki/sendmon_keepfocus/) - [sendmon\_keepfocus](https://github.com/bakkeby/patches/wiki/sendmon_keepfocus/)
- minor patch that allow clients to keep focus when being sent to another monitor - minor patch that allow clients to keep focus when being sent to another monitor

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,3 @@
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
#define CMD(...) { .v = (const char*[]){ __VA_ARGS__, NULL } }
#if ROUNDED_CORNERS_PATCH #if ROUNDED_CORNERS_PATCH
static const unsigned int borderpx = 0; /* border pixel of windows */ static const unsigned int borderpx = 0; /* border pixel of windows */
static const int corner_radius = 10; static const int corner_radius = 10;
@@ -428,13 +425,6 @@ static char *statuscolors[][ColCount] = {
static const char *layoutmenu_cmd = "layoutmenu.sh"; static const char *layoutmenu_cmd = "layoutmenu.sh";
#endif #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 #if COOL_AUTOSTART_PATCH
static const char *const autostart[] = { static const char *const autostart[] = {
"st", NULL, "st", NULL,
@@ -459,7 +449,7 @@ static char *tagicons[][NUMTAGS] =
#endif // NAMETAG_PATCH #endif // NAMETAG_PATCH
{ {
/* [DEFAULT_TAGS] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }, */ /* [DEFAULT_TAGS] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }, */
[DEFAULT_TAGS] = { "󰍩 ₁", "󰠮", "", "󰿎", "󰖟 ₅", " ₆", "󰊢 ₇", "󰊖", "" }, [DEFAULT_TAGS] = { "󰍩 ₁", "󰗚", "", "", "󰖟 ₅", " ₆", "󰊢 ₇", "", "" },
[ALTERNATIVE_TAGS] = { "A", "B", "C", "D", "E", "F", "G", "H", "I" }, [ALTERNATIVE_TAGS] = { "A", "B", "C", "D", "E", "F", "G", "H", "I" },
[ALT_TAGS_DECORATION] = { "<1>", "<2>", "<3>", "<4>", "<5>", "<6>", "<7>", "<8>", "<9>" }, [ALT_TAGS_DECORATION] = { "<1>", "<2>", "<3>", "<4>", "<5>", "<6>", "<7>", "<8>", "<9>" },
}; };
@@ -483,33 +473,16 @@ static const Rule rules[] = {
RULE(.wintype = WTYPE "UTILITY", .isfloating = 1) RULE(.wintype = WTYPE "UTILITY", .isfloating = 1)
RULE(.wintype = WTYPE "TOOLBAR", .isfloating = 1) RULE(.wintype = WTYPE "TOOLBAR", .isfloating = 1)
RULE(.wintype = WTYPE "SPLASH", .isfloating = 1) RULE(.wintype = WTYPE "SPLASH", .isfloating = 1)
RULE(.wintype = WTYPE "NOTIFICATION", .unmanaged = 1) // 1 - the window will be placed above all other windows
RULE(.title = "notificationtoasts_11_desktop", .unmanaged = 1) // 1 - the window will be placed above all other windows
RULE(.title = "Picture in picture", .isfloating = 1) RULE(.title = "Picture in picture", .isfloating = 1)
RULE(.class = "Ferdium", .tags = 1 << 0)
RULE(.class = "Beeper", .tags = 1 << 0) RULE(.class = "Beeper", .tags = 1 << 0)
RULE(.class = "Signal", .tags = 1 << 0) RULE(.class = "Signal", .tags = 1 << 0)
RULE(.class = "discord", .tags = 1 << 0) RULE(.class = "discord", .tags = 1 << 0)
RULE(.class = "zoom", .tags = 1 << 0) RULE(.class = "notion-app-enhanced", .tags = 1 << 1)
RULE(.class = "Logseq", .tags = 1 << 1) RULE(.class = "Logseq", .tags = 1 << 1)
RULE(.class = "obsidian", .tags = 1 << 1)
RULE(.class = "anytype", .tags = 1 << 1)
RULE(.class = "pocket-casts-linux", .tags = 1 << 2) RULE(.class = "pocket-casts-linux", .tags = 1 << 2)
RULE(.class = "Spotify", .tags = 1 << 2) RULE(.class = "Spotify", .tags = 1 << 3)
RULE(.class = "Pavucontrol", .tags = 1 << 2)
RULE(.class = "easyeffects", .tags = 1 << 2)
RULE(.class = "NoiseTorch", .tags = 1 << 2)
RULE(.class = "Audacity", .tags = 1 << 2)
RULE(.class = "mpv", .tags = 1 << 3)
RULE(.class = "vlc", .tags = 1 << 3)
RULE(.class = "Ristretto", .tags = 1 << 3)
RULE(.class = "trackma-qt", .tags = 1 << 3)
RULE(.class = "Trackma-gtk", .tags = 1 << 3)
RULE(.class = "obs", .tags = 1 << 3)
RULE(.class = "kdenlive", .tags = 1 << 3)
RULE(.class = "Blender", .tags = 1 << 3)
RULE(.title = "GNU Image Manipulation Program", .tags = 1 << 3)
RULE(.class = "Vivaldi-stable", .tags = 1 << 4) RULE(.class = "Vivaldi-stable", .tags = 1 << 4)
RULE(.class = "Links", .tags = 1 << 4)
RULE(.class = "kitty", .tags = 1 << 5, .isterminal = 1) RULE(.class = "kitty", .tags = 1 << 5, .isterminal = 1)
RULE(.class = "Emacs", .tags = 1 << 6) RULE(.class = "Emacs", .tags = 1 << 6)
RULE(.class = "Code", .tags = 1 << 6) RULE(.class = "Code", .tags = 1 << 6)
@@ -517,15 +490,14 @@ static const Rule rules[] = {
RULE(.title = "Steam", .tags = 1 << 7) RULE(.title = "Steam", .tags = 1 << 7)
RULE(.class = "Lutris", .tags = 1 << 7) RULE(.class = "Lutris", .tags = 1 << 7)
RULE(.class = "gamescope", .tags = 1 << 7) RULE(.class = "gamescope", .tags = 1 << 7)
RULE(.class = "Oversteer", .tags = 1 << 7)
RULE(.class = "PrismLauncher", .tags = 1 << 7)
RULE(.class = "antimicrox", .tags = 1 << 7)
RULE(.class = "ProtonUp-Qt", .tags = 1 << 7)
RULE(.class = "heroic", .tags = 1 << 7)
RULE(.class = "Thunar", .tags = 1 << 8) RULE(.class = "Thunar", .tags = 1 << 8)
RULE(.class = "trackma", .tags = 1 << 8)
RULE(.class = "Trackma-gtk", .tags = 1 << 8)
RULE(.class = "obs", .tags = 1 << 8)
RULE(.class = "NoiseTorch", .tags = 1 << 8)
RULE(.class = "kdenlive", .tags = 1 << 8)
RULE(.class = "Syncthing GTK", .tags = 1 << 8) RULE(.class = "Syncthing GTK", .tags = 1 << 8)
RULE(.class = "Nyrna", .tags = 1 << 8) RULE(.class = "Nyrna", .tags = 1 << 8)
RULE(.class = "openrgb", .tags = 1 << 8)
#if RENAMED_SCRATCHPADS_PATCH #if RENAMED_SCRATCHPADS_PATCH
RULE(.instance = "spterm", .scratchkey = 's', .isfloating = 1) RULE(.instance = "spterm", .scratchkey = 's', .isfloating = 1)
#elif SCRATCHPADS_PATCH #elif SCRATCHPADS_PATCH
@@ -564,9 +536,6 @@ static const BarRule barrules[] = {
#if BAR_STATUSBUTTON_PATCH #if BAR_STATUSBUTTON_PATCH
{ -1, 0, BAR_ALIGN_LEFT, width_stbutton, draw_stbutton, click_stbutton, NULL, "statusbutton" }, { -1, 0, BAR_ALIGN_LEFT, width_stbutton, draw_stbutton, click_stbutton, NULL, "statusbutton" },
#endif // BAR_STATUSBUTTON_PATCH #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 #if BAR_POWERLINE_TAGS_PATCH
{ 0, 0, BAR_ALIGN_LEFT, width_pwrl_tags, draw_pwrl_tags, click_pwrl_tags, hover_pwrl_tags, "powerline_tags" }, { 0, 0, BAR_ALIGN_LEFT, width_pwrl_tags, draw_pwrl_tags, click_pwrl_tags, hover_pwrl_tags, "powerline_tags" },
#endif // BAR_POWERLINE_TAGS_PATCH #endif // BAR_POWERLINE_TAGS_PATCH
@@ -874,6 +843,9 @@ static const char *xkb_layouts[] = {
#define HOLDKEY 0 // replace 0 with the keysym to activate holdbar #define HOLDKEY 0 // replace 0 with the keysym to activate holdbar
#endif // BAR_HOLDBAR_PATCH #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 } }
#if !NODMENU_PATCH #if !NODMENU_PATCH
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
#endif // NODMENU_PATCH #endif // NODMENU_PATCH
@@ -900,7 +872,7 @@ static const char *clipboardcmd[] = { "rofi", "-show", "clipboard", NULL
static const char *rbwcmd[] = { "rofi-rbw", NULL }; static const char *rbwcmd[] = { "rofi-rbw", NULL };
static const char *volumecmd[] = { "/home/sravan/.scripts/pactl.sh", "--rofi", NULL }; static const char *volumecmd[] = { "/home/sravan/.scripts/pactl.sh", "--rofi", NULL };
static const char *mediacmd[] = { "/home/sravan/.scripts/playerctl.sh", "--rofi", NULL }; static const char *mediacmd[] = { "/home/sravan/.scripts/playerctl.sh", "--rofi", NULL };
static const char *notificationcmd[] = { "/home/sravan/.scripts/dunst.sh", "--rofi", NULL }; static const char *notificationcmd[] = { "/home/sravan/.scripts/deadd.sh", "--rofi", NULL };
static const char *sessioncmd[] = { "/home/sravan/.scripts/session.sh", "--rofi", NULL }; static const char *sessioncmd[] = { "/home/sravan/.scripts/session.sh", "--rofi", NULL };
static const char *compositorcmd[] = { "/home/sravan/.scripts/picom.sh", "--rofi", NULL }; static const char *compositorcmd[] = { "/home/sravan/.scripts/picom.sh", "--rofi", NULL };
static const char *lowervolumecmd[] = { "/home/sravan/.scripts/pactl.sh", "--lower", NULL }; static const char *lowervolumecmd[] = { "/home/sravan/.scripts/pactl.sh", "--lower", NULL };
@@ -1000,13 +972,6 @@ static const Key keys[] = {
{ MODKEY, XK_Down, focusdir, {.i = 3 } }, // down { MODKEY, XK_Down, focusdir, {.i = 3 } }, // down
#endif // FOCUSDIR_PATCH #endif // FOCUSDIR_PATCH
#if PLACEDIR_PATCH
{ MODKEY|ControlMask, XK_Left, placedir, {.i = 0 } }, // left
{ MODKEY|ControlMask, XK_Right, placedir, {.i = 1 } }, // right
{ MODKEY|ControlMask, XK_Up, placedir, {.i = 2 } }, // up
{ MODKEY|ControlMask, XK_Down, placedir, {.i = 3 } }, // down
#endif // PLACEDIR_PATCH
#if SWAPFOCUS_PATCH && PERTAG_PATCH #if SWAPFOCUS_PATCH && PERTAG_PATCH
{ MODKEY, XK_s, swapfocus, {.i = -1 } }, { MODKEY, XK_s, swapfocus, {.i = -1 } },
#endif // SWAPFOCUS_PATCH #endif // SWAPFOCUS_PATCH
@@ -1137,8 +1102,8 @@ static const Key keys[] = {
#endif // SHIFTVIEW_CLIENTS_PATCH #endif // SHIFTVIEW_CLIENTS_PATCH
#if SHIFTBOTH_PATCH #if SHIFTBOTH_PATCH
{ MODKEY|ControlMask, XK_Left, shiftboth, { .i = -1 } }, // note keybinding conflict with focusadjacenttag tagandviewtoleft placedir { MODKEY|ControlMask, XK_Left, shiftboth, { .i = -1 } }, // note keybinding conflict with focusadjacenttag tagandviewtoleft
{ MODKEY|ControlMask, XK_Right, shiftboth, { .i = +1 } }, // note keybinding conflict with focusadjacenttag tagandviewtoright placedir { MODKEY|ControlMask, XK_Right, shiftboth, { .i = +1 } }, // note keybinding conflict with focusadjacenttag tagandviewtoright
#endif // SHIFTBOTH_PATCH #endif // SHIFTBOTH_PATCH
#if SHIFTSWAPTAGS_PATCH && SWAPTAGS_PATCH #if SHIFTSWAPTAGS_PATCH && SWAPTAGS_PATCH
@@ -1276,8 +1241,8 @@ static const Key keys[] = {
{ MODKEY, XK_Right, viewtoright, {0} }, // note keybinding conflict with focusdir { MODKEY, XK_Right, viewtoright, {0} }, // note keybinding conflict with focusdir
{ MODKEY|ShiftMask, XK_Left, tagtoleft, {0} }, // note keybinding conflict with shifttag { MODKEY|ShiftMask, XK_Left, tagtoleft, {0} }, // note keybinding conflict with shifttag
{ MODKEY|ShiftMask, XK_Right, tagtoright, {0} }, // note keybinding conflict with shifttag { MODKEY|ShiftMask, XK_Right, tagtoright, {0} }, // note keybinding conflict with shifttag
{ MODKEY|ControlMask, XK_Left, tagandviewtoleft, {0} }, // note keybinding conflict with placedir { MODKEY|ControlMask, XK_Left, tagandviewtoleft, {0} },
{ MODKEY|ControlMask, XK_Right, tagandviewtoright, {0} }, // note keybinding conflict with placedir { MODKEY|ControlMask, XK_Right, tagandviewtoright, {0} },
#endif // FOCUSADJACENTTAG_PATCH #endif // FOCUSADJACENTTAG_PATCH
#if TAGALL_PATCH #if TAGALL_PATCH
@@ -1322,8 +1287,8 @@ static const Key keys[] = {
#if BAR_TAGGRID_PATCH #if BAR_TAGGRID_PATCH
{ MODKEY|ControlMask, XK_Up, switchtag, { .ui = SWITCHTAG_UP | SWITCHTAG_VIEW } }, { MODKEY|ControlMask, XK_Up, switchtag, { .ui = SWITCHTAG_UP | SWITCHTAG_VIEW } },
{ MODKEY|ControlMask, XK_Down, switchtag, { .ui = SWITCHTAG_DOWN | SWITCHTAG_VIEW } }, { MODKEY|ControlMask, XK_Down, switchtag, { .ui = SWITCHTAG_DOWN | SWITCHTAG_VIEW } },
{ MODKEY|ControlMask, XK_Right, switchtag, { .ui = SWITCHTAG_RIGHT | SWITCHTAG_VIEW } }, // note keybinding conflict with placedir { MODKEY|ControlMask, XK_Right, switchtag, { .ui = SWITCHTAG_RIGHT | SWITCHTAG_VIEW } },
{ MODKEY|ControlMask, XK_Left, switchtag, { .ui = SWITCHTAG_LEFT | SWITCHTAG_VIEW } }, // note keybinding conflict with placedir { MODKEY|ControlMask, XK_Left, switchtag, { .ui = SWITCHTAG_LEFT | SWITCHTAG_VIEW } },
{ MODKEY|Mod1Mask, XK_Up, switchtag, { .ui = SWITCHTAG_UP | SWITCHTAG_TAG | SWITCHTAG_VIEW } }, { MODKEY|Mod1Mask, XK_Up, switchtag, { .ui = SWITCHTAG_UP | SWITCHTAG_TAG | SWITCHTAG_VIEW } },
{ MODKEY|Mod1Mask, XK_Down, switchtag, { .ui = SWITCHTAG_DOWN | SWITCHTAG_TAG | SWITCHTAG_VIEW } }, { MODKEY|Mod1Mask, XK_Down, switchtag, { .ui = SWITCHTAG_DOWN | SWITCHTAG_TAG | SWITCHTAG_VIEW } },
{ MODKEY|Mod1Mask, XK_Right, switchtag, { .ui = SWITCHTAG_RIGHT | SWITCHTAG_TAG | SWITCHTAG_VIEW } }, { MODKEY|Mod1Mask, XK_Right, switchtag, { .ui = SWITCHTAG_RIGHT | SWITCHTAG_TAG | SWITCHTAG_VIEW } },

View File

@@ -1,5 +1,5 @@
# dwm version # dwm version
VERSION = 6.5 VERSION = 6.4
# Customize below to fit your system # Customize below to fit your system
@@ -29,7 +29,7 @@ FREETYPEINC = /usr/include/freetype2
#KVMLIB = -lkvm #KVMLIB = -lkvm
# Uncomment this for the alpha patch and the winicon patch (BAR_ALPHA_PATCH, BAR_WINICON_PATCH) # Uncomment this for the alpha patch and the winicon patch (BAR_ALPHA_PATCH, BAR_WINICON_PATCH)
#XRENDER = -lXrender XRENDER = -lXrender
# Uncomment this for the mdpcontrol patch / MDPCONTROL_PATCH # Uncomment this for the mdpcontrol patch / MDPCONTROL_PATCH
#MPDCLIENT = -lmpdclient #MPDCLIENT = -lmpdclient

28
drw.c
View File

@@ -337,22 +337,14 @@ drw_clr_create(
#if BAR_ALPHA_PATCH #if BAR_ALPHA_PATCH
if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap, if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap,
clrname, dest)) clrname, dest))
#if DO_NOT_DIE_ON_COLOR_ALLOCATION_FAILURE_PATCH
fprintf(stderr, "warning, cannot allocate color '%s'", clrname);
#else
die("error, cannot allocate color '%s'", clrname); die("error, cannot allocate color '%s'", clrname);
#endif // DO_NOT_DIE_ON_COLOR_ALLOCATION_FAILURE_PATCH
dest->pixel = (dest->pixel & 0x00ffffffU) | (alpha << 24); dest->pixel = (dest->pixel & 0x00ffffffU) | (alpha << 24);
#else #else
if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen), if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen),
DefaultColormap(drw->dpy, drw->screen), DefaultColormap(drw->dpy, drw->screen),
clrname, dest)) clrname, dest))
#if DO_NOT_DIE_ON_COLOR_ALLOCATION_FAILURE_PATCH
fprintf(stderr, "warning, cannot allocate color '%s'", clrname);
#else
die("error, cannot allocate color '%s'", clrname); die("error, cannot allocate color '%s'", clrname);
#endif // DO_NOT_DIE_ON_COLOR_ALLOCATION_FAILURE_PATCH
#if NO_TRANSPARENT_BORDERS_PATCH #if NO_TRANSPARENT_BORDERS_PATCH
dest->pixel |= 0xff << 24; dest->pixel |= 0xff << 24;
@@ -436,10 +428,10 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
{ {
#if BAR_PANGO_PATCH #if BAR_PANGO_PATCH
char buf[1024]; char buf[1024];
int i, ty, th; int ty;
unsigned int ew, eh; unsigned int ew;
XftDraw *d = NULL; XftDraw *d = NULL;
size_t len; size_t i, len;
int render = x || y || w || h; int render = x || y || w || h;
if (!drw || (render && !drw->scheme) || !text || !drw->fonts) if (!drw || (render && !drw->scheme) || !text || !drw->fonts)
@@ -464,14 +456,10 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
len = strlen(text); len = strlen(text);
if (len) { if (len) {
drw_font_getexts(drw->fonts, text, len, &ew, &eh, markup); drw_font_getexts(drw->fonts, text, len, &ew, NULL, markup);
th = eh;
/* shorten text if necessary */ /* shorten text if necessary */
for (len = MIN(len, sizeof(buf) - 1); len && ew > w; len--) { for (len = MIN(len, sizeof(buf) - 1); len && ew > w; len--)
drw_font_getexts(drw->fonts, text, len, &ew, &eh, markup); drw_font_getexts(drw->fonts, text, len, &ew, NULL, markup);
if (eh > th)
th = eh;
}
if (len) { if (len) {
memcpy(buf, text, len); memcpy(buf, text, len);
@@ -481,7 +469,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
; /* NOP */ ; /* NOP */
if (render) { if (render) {
ty = y + (h - th) / 2; ty = y + (h - drw->fonts->h) / 2;
if (markup) if (markup)
pango_layout_set_markup(drw->fonts->layout, buf, len); pango_layout_set_markup(drw->fonts->layout, buf, len);
else else
@@ -713,7 +701,7 @@ drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w,
if (w) if (w)
*w = r.width / PANGO_SCALE; *w = r.width / PANGO_SCALE;
if (h) if (h)
*h = r.height / PANGO_SCALE; *h = font->h;
} }
#else #else
void void

145
dwm.c
View File

@@ -482,9 +482,6 @@ struct Monitor {
int gappiv; /* vertical gap between windows */ int gappiv; /* vertical gap between windows */
int gappoh; /* horizontal outer gaps */ int gappoh; /* horizontal outer gaps */
int gappov; /* vertical outer gaps */ int gappov; /* vertical outer gaps */
#if PERMON_VANITYGAPS_PATCH
int enablegaps; /* whether gaps are enabled */
#endif // PERMON_VANITYGAPS_PATCH
#endif // VANITYGAPS_PATCH #endif // VANITYGAPS_PATCH
#if SETBORDERPX_PATCH #if SETBORDERPX_PATCH
int borderpx; int borderpx;
@@ -688,9 +685,6 @@ static void maprequest(XEvent *e);
static void motionnotify(XEvent *e); static void motionnotify(XEvent *e);
static void movemouse(const Arg *arg); static void movemouse(const Arg *arg);
static Client *nexttiled(Client *c); static Client *nexttiled(Client *c);
#if NOBORDER_PATCH
static int noborder(Client *c);
#endif // NOBORDER_PATCH
#if !ZOOMSWAP_PATCH || TAGINTOSTACK_ALLMASTER_PATCH || TAGINTOSTACK_ONEMASTER_PATCH #if !ZOOMSWAP_PATCH || TAGINTOSTACK_ALLMASTER_PATCH || TAGINTOSTACK_ONEMASTER_PATCH
static void pop(Client *c); static void pop(Client *c);
#endif // !ZOOMSWAP_PATCH / TAGINTOSTACK_ALLMASTER_PATCH / TAGINTOSTACK_ONEMASTER_PATCH #endif // !ZOOMSWAP_PATCH / TAGINTOSTACK_ALLMASTER_PATCH / TAGINTOSTACK_ONEMASTER_PATCH
@@ -968,7 +962,6 @@ applyrules(Client *c)
if (r->switchtag) if (r->switchtag)
#endif // SWALLOW_PATCH #endif // SWALLOW_PATCH
{ {
unfocus(selmon->sel, 1, NULL);
selmon = c->mon; selmon = c->mon;
if (r->switchtag == 2 || r->switchtag == 4) if (r->switchtag == 2 || r->switchtag == 4)
newtagset = c->mon->tagset[c->mon->seltags] ^ c->tags; newtagset = c->mon->tagset[c->mon->seltags] ^ c->tags;
@@ -1112,11 +1105,6 @@ arrange(Monitor *m)
void void
arrangemon(Monitor *m) arrangemon(Monitor *m)
{ {
#if BAR_PADDING_SMART_PATCH
updatebarpos(selmon);
for (Bar *bar = selmon->bar; bar; bar = bar->next)
XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
#endif // BAR_PADDING_SMART_PATCH
#if TAB_PATCH #if TAB_PATCH
updatebarpos(m); updatebarpos(m);
XMoveResizeWindow(dpy, m->tabwin, m->wx, m->ty, m->ww, th); XMoveResizeWindow(dpy, m->tabwin, m->wx, m->ty, m->ww, th);
@@ -1470,15 +1458,6 @@ configure(Client *c)
ce.width = c->w; ce.width = c->w;
ce.height = c->h; ce.height = c->h;
ce.border_width = c->bw; ce.border_width = c->bw;
#if NOBORDER_PATCH
if (noborder(c)) {
ce.width += c->bw * 2;
ce.height += c->bw * 2;
ce.border_width = 0;
}
#endif // NOBORDER_PATCH
ce.above = None; ce.above = None;
ce.override_redirect = False; ce.override_redirect = False;
XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce); XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce);
@@ -1790,10 +1769,6 @@ createmon(void)
} }
#endif // PERTAG_PATCH #endif // PERTAG_PATCH
#if PERMON_VANITYGAPS_PATCH
m->enablegaps = 1;
#endif // PERMON_VANITYGAPS_PATCH
#if SEAMLESS_RESTART_PATCH #if SEAMLESS_RESTART_PATCH
restoremonitorstate(m); restoremonitorstate(m);
#endif // SEAMLESS_RESTART_PATCH #endif // SEAMLESS_RESTART_PATCH
@@ -2517,10 +2492,8 @@ manage(Window w, XWindowAttributes *wa)
#endif // CENTER_TRANSIENT_WINDOWS_PATCH | CENTER_TRANSIENT_WINDOWS_BY_PARENT_PATCH | CENTER_PATCH #endif // CENTER_TRANSIENT_WINDOWS_PATCH | CENTER_TRANSIENT_WINDOWS_BY_PARENT_PATCH | CENTER_PATCH
} else { } else {
#if SEAMLESS_RESTART_PATCH #if SEAMLESS_RESTART_PATCH
if (!settings_restored || c->mon == NULL) { if (!settings_restored)
c->mon = selmon; c->mon = selmon;
settings_restored = 0;
}
#else #else
c->mon = selmon; c->mon = selmon;
#endif // SEAMLESS_RESTART_PATCH #endif // SEAMLESS_RESTART_PATCH
@@ -2877,52 +2850,6 @@ nexttiled(Client *c)
return c; return c;
} }
#if NOBORDER_PATCH
int
noborder(Client *c)
{
int monocle_layout = 0;
#if MONOCLE_LAYOUT
if (&monocle == c->mon->lt[c->mon->sellt]->arrange)
monocle_layout = 1;
#endif // MONOCLE_LAYOUT
#if DECK_LAYOUT
if (&deck == c->mon->lt[c->mon->sellt]->arrange && c->mon->nmaster == 0)
monocle_layout = 1;
#endif // DECK_LAYOUT
#if FLEXTILE_DELUXE_LAYOUT
if (&flextile == c->mon->lt[c->mon->sellt]->arrange && (
(c->mon->ltaxis[LAYOUT] == NO_SPLIT && c->mon->ltaxis[MASTER] == MONOCLE) ||
(c->mon->ltaxis[STACK] == MONOCLE && c->mon->nmaster == 0)
)) {
monocle_layout = 1;
}
#endif //FLEXTILE_DELUXE_LAYOUT
if (!monocle_layout && (nexttiled(c->mon->clients) != c || nexttiled(c->next)))
return 0;
if (c->isfloating)
return 0;
if (!c->mon->lt[c->mon->sellt]->arrange)
return 0;
#if FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH
if (c->fakefullscreen != 1 && c->isfullscreen)
return 0;
#elif !FAKEFULLSCREEN_PATCH
if (c->isfullscreen)
return 0;
#endif // FAKEFULLSCREEN_CLIENT_PATCH
return 1;
}
#endif // NOBORDER_PATCH
#if !ZOOMSWAP_PATCH || TAGINTOSTACK_ALLMASTER_PATCH || TAGINTOSTACK_ONEMASTER_PATCH #if !ZOOMSWAP_PATCH || TAGINTOSTACK_ALLMASTER_PATCH || TAGINTOSTACK_ONEMASTER_PATCH
void void
pop(Client *c) pop(Client *c)
@@ -3077,9 +3004,31 @@ resizeclient(Client *c, int x, int y, int w, int h)
drawroundedcorners(c); drawroundedcorners(c);
#endif // ROUNDED_CORNERS_PATCH #endif // ROUNDED_CORNERS_PATCH
#if NOBORDER_PATCH #if NOBORDER_PATCH
if (noborder(c)) { if (((nexttiled(c->mon->clients) == c && !nexttiled(c->next))
wc.width += c->bw * 2; #if MONOCLE_LAYOUT
wc.height += c->bw * 2; || &monocle == c->mon->lt[c->mon->sellt]->arrange
#endif // MONOCLE_LAYOUT
#if DECK_LAYOUT
|| (&deck == c->mon->lt[c->mon->sellt]->arrange &&
c->mon->nmaster == 0)
#endif // DECK_LAYOUT
#if FLEXTILE_DELUXE_LAYOUT
|| (&flextile == c->mon->lt[c->mon->sellt]->arrange && (
(c->mon->ltaxis[LAYOUT] == NO_SPLIT &&
c->mon->ltaxis[MASTER] == MONOCLE) ||
(c->mon->ltaxis[STACK] == MONOCLE &&
c->mon->nmaster == 0)))
#endif //FLEXTILE_DELUXE_LAYOUT
)
#if FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH
&& (c->fakefullscreen == 1 || !c->isfullscreen)
#else
&& !c->isfullscreen
#endif // FAKEFULLSCREEN_CLIENT_PATCH
&& !c->isfloating
&& c->mon->lt[c->mon->sellt]->arrange) {
c->w = wc.width += c->bw * 2;
c->h = wc.height += c->bw * 2;
wc.border_width = 0; wc.border_width = 0;
} }
#endif // NOBORDER_PATCH #endif // NOBORDER_PATCH
@@ -3313,6 +3262,7 @@ run(void)
event_fd, events[i].data.ptr, events[i].data.u32, event_fd, events[i].data.ptr, events[i].data.u32,
events[i].data.u64); events[i].data.u64);
fprintf(stderr, " with events %d\n", events[i].events); fprintf(stderr, " with events %d\n", events[i].events);
return;
} }
} }
} }
@@ -3433,14 +3383,6 @@ sendmon(Client *c, Monitor *m)
#else #else
c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
#endif // EMPTYVIEW_PATCH #endif // EMPTYVIEW_PATCH
#if SENDMON_CENTER_PATCH
c->x = m->mx + (m->mw - WIDTH(c)) / 2;
c->y = m->my + (m->mh - HEIGHT(c)) / 2;
#if SAVEFLOATS_PATCH
c->sfx = m->mx + (m->mw - c->sfw - 2 * c->bw) / 2;
c->sfy = m->my + (m->mh - c->sfh - 2 * c->bw) / 2;
#endif // SAVEFLOATS_PATCH
#endif // SENDMON_CENTER_PATCH
#if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH #if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH
attachx(c); attachx(c);
#else #else
@@ -4283,21 +4225,10 @@ togglefloating(const Arg *arg)
#endif // !FAKEFULLSCREEN_PATCH #endif // !FAKEFULLSCREEN_PATCH
c->isfloating = !c->isfloating || c->isfixed; c->isfloating = !c->isfloating || c->isfixed;
#if !BAR_FLEXWINTITLE_PATCH #if !BAR_FLEXWINTITLE_PATCH
#if RENAMED_SCRATCHPADS_PATCH
if (c->scratchkey != 0 && c->isfloating)
XSetWindowBorder(dpy, c->win, scheme[SchemeScratchSel][ColFloat].pixel);
else if (c->scratchkey != 0)
XSetWindowBorder(dpy, c->win, scheme[SchemeScratchSel][ColBorder].pixel);
else if (c->isfloating)
XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColFloat].pixel);
else
XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel);
#else
if (c->isfloating) if (c->isfloating)
XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColFloat].pixel); XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColFloat].pixel);
else else
XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel); XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel);
#endif // RENAMED_SCRATCHPADS_PATCH
#endif // BAR_FLEXWINTITLE_PATCH #endif // BAR_FLEXWINTITLE_PATCH
if (c->isfloating) { if (c->isfloating) {
#if SAVEFLOATS_PATCH || EXRESIZE_PATCH #if SAVEFLOATS_PATCH || EXRESIZE_PATCH
@@ -4712,36 +4643,16 @@ updatebarpos(Monitor *m)
#if BAR_PADDING_VANITYGAPS_PATCH && VANITYGAPS_PATCH #if BAR_PADDING_VANITYGAPS_PATCH && VANITYGAPS_PATCH
#if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH #if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH
if (!selmon || selmon->pertag->enablegaps[selmon->pertag->curtag]) if (!selmon || selmon->pertag->enablegaps[selmon->pertag->curtag])
#elif PERMON_VANITYGAPS_PATCH
if (!selmon || selmon->enablegaps)
#else #else
if (enablegaps) if (enablegaps)
#endif // PERTAG_VANITYGAPS_PATCH #endif // PERTAG_VANITYGAPS_PATCH
{ {
#if BAR_PADDING_SMART_PATCH
unsigned int n; Client *c;
for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
if (n > 1) {
y_pad = gappoh;
x_pad = gappov;
}
#else
y_pad = gappoh; y_pad = gappoh;
x_pad = gappov; x_pad = gappov;
#endif // BAR_PADDING_SMART_PATCH
} }
#elif BAR_PADDING_PATCH #elif BAR_PADDING_PATCH
#if BAR_PADDING_SMART_PATCH
unsigned int n; Client *c;
for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
if (n > 1) {
y_pad = vertpad;
x_pad = sidepad;
}
#else
y_pad = vertpad; y_pad = vertpad;
x_pad = sidepad; x_pad = sidepad;
#endif // BAR_PADDING_SMART_PATCH
#endif // BAR_PADDING_PATCH | BAR_PADDING_VANITYGAPS_PATCH #endif // BAR_PADDING_PATCH | BAR_PADDING_VANITYGAPS_PATCH
#if INSETS_PATCH #if INSETS_PATCH
@@ -4796,7 +4707,7 @@ updatebarpos(Monitor *m)
} }
void void
updateclientlist(void) updateclientlist()
{ {
Client *c; Client *c;
Monitor *m; Monitor *m;

View File

@@ -1,13 +0,0 @@
set shell := ["bash", "-c"]
# List just commands by default
default:
@just --list
# Update doom emacs and sync config
dwm-rebuild:
sudo make clean install
# Run polybar launch script
dwm-launch-polybar:
./polybar/launch.sh

View File

@@ -21,7 +21,7 @@ alttab()
/* redraw tab */ /* redraw tab */
XRaiseWindow(dpy, alttabwin); XRaiseWindow(dpy, alttabwin);
drawalttab(ntabs, 0, m); drawtab(ntabs, 0, m);
} }
void void
@@ -66,7 +66,7 @@ alttabend()
} }
void void
drawalttab(int nwins, int first, Monitor *m) drawtab(int nwins, int first, Monitor *m)
{ {
Client *c; Client *c;
int i, h; int i, h;
@@ -178,7 +178,7 @@ alttabstart(const Arg *arg)
i++; i++;
} }
drawalttab(ntabs, 1, m); drawtab(ntabs, 1, m);
struct timespec ts = { .tv_sec = 0, .tv_nsec = 1000000 }; struct timespec ts = { .tv_sec = 0, .tv_nsec = 1000000 };

View File

@@ -1,5 +1,5 @@
#include <time.h> #include <time.h>
static void drawalttab(int nwins, int first, Monitor *m); static void drawtab(int nwins, int first, Monitor *m);
static void alttabstart(const Arg *arg); static void alttabstart(const Arg *arg);
static void alttabend(); static void alttabend();

View File

@@ -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

View File

@@ -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);

View File

@@ -15,3 +15,4 @@ click_ltsymbol(Bar *bar, Arg *arg, BarArg *a)
{ {
return ClkLtSymbol; return ClkLtSymbol;
} }

View File

@@ -1,3 +1,4 @@
static int width_ltsymbol(Bar *bar, BarArg *a); static int width_ltsymbol(Bar *bar, BarArg *a);
static int draw_ltsymbol(Bar *bar, BarArg *a); static int draw_ltsymbol(Bar *bar, BarArg *a);
static int click_ltsymbol(Bar *bar, Arg *arg, BarArg *a); static int click_ltsymbol(Bar *bar, Arg *arg, BarArg *a);

View File

@@ -102,11 +102,6 @@ click_pwrl_tags(Bar *bar, Arg *arg, BarArg *a)
if (i < NUMTAGS) { if (i < NUMTAGS) {
arg->ui = 1 << i; arg->ui = 1 << i;
} }
#if BAR_TAGPREVIEW_PATCH
if (selmon->previewshow != 0) {
hidetagpreview(selmon);
}
#endif // BAR_TAGPREVIEW_PATCH
return ClkTagBar; return ClkTagBar;
} }

View File

@@ -96,7 +96,6 @@ drawstatusbar(BarArg *a, char* stext)
#else #else
memcpy(text, stext, len); memcpy(text, stext, len);
#endif // BAR_STATUSCMD_PATCH #endif // BAR_STATUSCMD_PATCH
text[len] = '\0';
x += lrpad / 2; x += lrpad / 2;
drw_setscheme(drw, scheme[LENGTH(colors)]); drw_setscheme(drw, scheme[LENGTH(colors)]);

View File

@@ -94,12 +94,6 @@ draw_systray(Bar *bar, BarArg *a)
i->mon = bar->mon; i->mon = bar->mon;
} }
#if !BAR_ALPHA_PATCH
wa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
XChangeWindowAttributes(dpy, systray->win, CWBackPixel, &wa);
XClearWindow(dpy, systray->win);
#endif // BAR_ALPHA_PATCH
XMoveResizeWindow(dpy, systray->win, bar->bx + a->x + lrpad / 2, (w ? bar->by + a->y + (a->h - systray->h) / 2: -systray->h), MAX(w, 1), systray->h); XMoveResizeWindow(dpy, systray->win, bar->bx + a->x + lrpad / 2, (w ? bar->by + a->y + (a->h - systray->h) / 2: -systray->h), MAX(w, 1), systray->h);
return w; return w;
} }

View File

@@ -87,11 +87,6 @@ click_taglabels(Bar *bar, Arg *arg, BarArg *a)
if (i < NUMTAGS) { if (i < NUMTAGS) {
arg->ui = 1 << i; arg->ui = 1 << i;
} }
#if BAR_TAGPREVIEW_PATCH
if (selmon->previewshow != 0) {
hidetagpreview(selmon);
}
#endif // BAR_TAGPREVIEW_PATCH
return ClkTagBar; return ClkTagBar;
} }

View File

@@ -88,11 +88,6 @@ click_tags(Bar *bar, Arg *arg, BarArg *a)
if (i < NUMTAGS) { if (i < NUMTAGS) {
arg->ui = 1 << i; arg->ui = 1 << i;
} }
#if BAR_TAGPREVIEW_PATCH
if (selmon->previewshow != 0) {
hidetagpreview(selmon);
}
#endif // BAR_TAGPREVIEW_PATCH
return ClkTagBar; return ClkTagBar;
} }

View File

@@ -21,9 +21,6 @@
#if COMBO_PATCH #if COMBO_PATCH
#include "combo.c" #include "combo.c"
#endif #endif
#if BAR_LAUNCHER_PATCH
#include "bar_launcher.c"
#endif
#if BAR_LTSYMBOL_PATCH #if BAR_LTSYMBOL_PATCH
#include "bar_ltsymbol.c" #include "bar_ltsymbol.c"
#endif #endif
@@ -211,9 +208,6 @@
#if PERTAG_PATCH #if PERTAG_PATCH
#include "pertag.c" #include "pertag.c"
#endif #endif
#if PLACEDIR_PATCH
#include "placedir.c"
#endif
#if PLACEMOUSE_PATCH #if PLACEMOUSE_PATCH
#include "placemouse.c" #include "placemouse.c"
#endif #endif

View File

@@ -24,9 +24,6 @@
#if BAR_HOLDBAR_PATCH #if BAR_HOLDBAR_PATCH
#include "bar_holdbar.h" #include "bar_holdbar.h"
#endif #endif
#if BAR_LAUNCHER_PATCH
#include "bar_launcher.h"
#endif
#if BAR_LTSYMBOL_PATCH #if BAR_LTSYMBOL_PATCH
#include "bar_ltsymbol.h" #include "bar_ltsymbol.h"
#endif #endif
@@ -210,9 +207,6 @@
#if PERTAG_PATCH #if PERTAG_PATCH
#include "pertag.h" #include "pertag.h"
#endif #endif
#if PLACEDIR_PATCH
#include "placedir.h"
#endif
#if PLACEMOUSE_PATCH #if PLACEMOUSE_PATCH
#include "placemouse.h" #include "placemouse.h"
#endif #endif

View File

@@ -1,96 +0,0 @@
void
placedir(const Arg *arg)
{
Client *s = selmon->sel, *f = NULL, *c, *next, *fprior, *sprior;
if (!s || s->isfloating)
return;
unsigned int score = -1;
unsigned int client_score;
int dist;
int dirweight = 20;
next = s->next;
if (!next)
next = s->mon->clients;
for (c = next; c != s; c = next) {
next = c->next;
if (!next)
next = s->mon->clients;
if (!ISVISIBLE(c)) // || HIDDEN(c)
continue;
switch (arg->i) {
case 0: // left
dist = s->x - c->x - c->w;
client_score =
dirweight * MIN(abs(dist), abs(dist + s->mon->ww)) +
abs(s->y - c->y);
break;
case 1: // right
dist = c->x - s->x - s->w;
client_score =
dirweight * MIN(abs(dist), abs(dist + s->mon->ww)) +
abs(c->y - s->y);
break;
case 2: // up
dist = s->y - c->y - c->h;
client_score =
dirweight * MIN(abs(dist), abs(dist + s->mon->wh)) +
abs(s->x - c->x);
break;
default:
case 3: // down
dist = c->y - s->y - s->h;
client_score =
dirweight * MIN(abs(dist), abs(dist + s->mon->wh)) +
abs(c->x - s->x);
break;
}
if (((arg->i == 0 || arg->i == 2) && client_score <= score) || client_score < score) {
score = client_score;
f = c;
}
}
if (f && f != s) {
for (fprior = f->mon->clients; fprior && fprior->next != f; fprior = fprior->next);
for (sprior = s->mon->clients; sprior && sprior->next != s; sprior = sprior->next);
if (s == fprior) {
next = f->next;
if (sprior)
sprior->next = f;
else
f->mon->clients = f;
f->next = s;
s->next = next;
} else if (f == sprior) {
next = s->next;
if (fprior)
fprior->next = s;
else
s->mon->clients = s;
s->next = f;
f->next = next;
} else { // clients are not adjacent to each other
next = f->next;
f->next = s->next;
s->next = next;
if (fprior)
fprior->next = s;
else
s->mon->clients = s;
if (sprior)
sprior->next = f;
else
f->mon->clients = f;
}
arrange(f->mon);
}
}

View File

@@ -1 +0,0 @@
static void placedir(const Arg *arg);

View File

@@ -39,12 +39,12 @@ persistclientstate(Client *c)
int int
restoreclientstate(Client *c) restoreclientstate(Client *c)
{ {
int restored = getclientfields(c); return getclienttags(c)
getclienttags(c); | getclientfields(c)
#if SAVEFLOATS_PATCH #if SAVEFLOATS_PATCH
restorewindowfloatposition(c, c->mon ? c->mon : selmon); | restorewindowfloatposition(c, c->mon ? c->mon : selmon)
#endif // SAVEFLOATS_PATCH #endif // SAVEFLOATS_PATCH
return restored; ;
} }
void setmonitorfields(Monitor *m) void setmonitorfields(Monitor *m)

View File

@@ -13,9 +13,6 @@ swallow(Client *p, Client *c)
{ {
Client *s; Client *s;
XWindowChanges wc; XWindowChanges wc;
#if NOBORDER_PATCH
int border_padding = 0;
#endif // NOBORDER_PATCH
if (c->noswallow > 0 || c->isterminal) if (c->noswallow > 0 || c->isterminal)
return 0; return 0;
@@ -49,21 +46,9 @@ swallow(Client *p, Client *c)
setfloatinghint(s); setfloatinghint(s);
#endif // BAR_EWMHTAGS_PATCH #endif // BAR_EWMHTAGS_PATCH
#if NOBORDER_PATCH
wc.border_width = p->bw;
if (noborder(p)) {
wc.border_width = 0;
border_padding = p->bw * 2;
}
XConfigureWindow(dpy, p->win, CWBorderWidth, &wc);
XMoveResizeWindow(dpy, p->win, s->x, s->y, s->w + border_padding, s->h + border_padding);
#else
wc.border_width = p->bw; wc.border_width = p->bw;
XConfigureWindow(dpy, p->win, CWBorderWidth, &wc); XConfigureWindow(dpy, p->win, CWBorderWidth, &wc);
XMoveResizeWindow(dpy, p->win, s->x, s->y, s->w, s->h); XMoveResizeWindow(dpy, p->win, s->x, s->y, s->w, s->h);
#endif // NOBORDER_PATCH
#if !BAR_FLEXWINTITLE_PATCH #if !BAR_FLEXWINTITLE_PATCH
XSetWindowBorder(dpy, p->win, scheme[SchemeNorm][ColBorder].pixel); XSetWindowBorder(dpy, p->win, scheme[SchemeNorm][ColBorder].pixel);
#endif // BAR_FLEXWINTITLE_PATCH #endif // BAR_FLEXWINTITLE_PATCH
@@ -80,9 +65,6 @@ unswallow(Client *c)
{ {
XWindowChanges wc; XWindowChanges wc;
c->win = c->swallowing->win; c->win = c->swallowing->win;
#if NOBORDER_PATCH
int border_padding = 0;
#endif // NOBORDER_PATCH
free(c->swallowing); free(c->swallowing);
c->swallowing = NULL; c->swallowing = NULL;
@@ -98,20 +80,9 @@ unswallow(Client *c)
arrange(c->mon); arrange(c->mon);
XMapWindow(dpy, c->win); XMapWindow(dpy, c->win);
#if NOBORDER_PATCH
wc.border_width = c->bw;
if (noborder(c)) {
wc.border_width = 0;
border_padding = c->bw * 2;
}
XConfigureWindow(dpy, c->win, CWBorderWidth, &wc);
XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w + border_padding, c->h + border_padding);
#else
wc.border_width = c->bw; wc.border_width = c->bw;
XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); XConfigureWindow(dpy, c->win, CWBorderWidth, &wc);
XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
#endif // NOBORDER_PATCH
#if !BAR_FLEXWINTITLE_PATCH #if !BAR_FLEXWINTITLE_PATCH
XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel); XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel);
#endif // BAR_FLEXWINTITLE_PATCH #endif // BAR_FLEXWINTITLE_PATCH

View File

@@ -1,5 +1,5 @@
/* Settings */ /* Settings */
#if !(PERTAG_VANITYGAPS_PATCH || PERMON_VANITYGAPS_PATCH) #if !PERTAG_VANITYGAPS_PATCH
static int enablegaps = 1; static int enablegaps = 1;
#endif // PERTAG_VANITYGAPS_PATCH #endif // PERTAG_VANITYGAPS_PATCH
@@ -69,12 +69,10 @@ setgapsex(const Arg *arg)
#if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH #if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH
if (!selmon->pertag->enablegaps[selmon->pertag->curtag]) if (!selmon->pertag->enablegaps[selmon->pertag->curtag])
selmon->pertag->enablegaps[selmon->pertag->curtag] = 1; selmon->pertag->enablegaps[selmon->pertag->curtag] = 1;
#elif PERMON_VANITYGAPS_PATCH
selmon->enablegaps = 1;
#else #else
if (!enablegaps) if (!enablegaps)
enablegaps = 1; enablegaps = 1;
#endif // PERTAG_VANITYGAPS_PATCH | PERMON_VANITYGAPS_PATCH #endif // PERTAG_VANITYGAPS_PATCH
setgaps(oh, ov, ih, iv); setgaps(oh, ov, ih, iv);
} }
@@ -85,35 +83,24 @@ togglegaps(const Arg *arg)
{ {
#if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH #if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH
selmon->pertag->enablegaps[selmon->pertag->curtag] = !selmon->pertag->enablegaps[selmon->pertag->curtag]; selmon->pertag->enablegaps[selmon->pertag->curtag] = !selmon->pertag->enablegaps[selmon->pertag->curtag];
#elif PERMON_VANITYGAPS_PATCH
selmon->enablegaps = !selmon->enablegaps;
#else #else
enablegaps = !enablegaps; enablegaps = !enablegaps;
#endif // PERTAG_VANITYGAPS_PATCH | PERMON_VANITYGAPS_PATCH #endif // PERTAG_VANITYGAPS_PATCH
#if BAR_PADDING_VANITYGAPS_PATCH #if BAR_PADDING_VANITYGAPS_PATCH
#if PERMON_VANITYGAPS_PATCH
updatebarpos(selmon); updatebarpos(selmon);
for (Bar *bar = selmon->bar; bar; bar = bar->next) for (Bar *bar = selmon->bar; bar; bar = bar->next)
XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
#else
for (Monitor *m = mons; m; m = m->next) {
updatebarpos(m);
for (Bar *bar = m->bar; bar; bar = bar->next)
XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
}
#endif // PERMON_VANITYGAPS_PATCH
#if BAR_SYSTRAY_PATCH #if BAR_SYSTRAY_PATCH
drawbarwin(systray->bar); drawbarwin(systray->bar);
#endif // BAR_SYSTRAY_PATCH #endif // BAR_SYSTRAY_PATCH
#endif // BAR_PADDING_VANITYGAPS_PATCH #endif // BAR_PADDING_VANITYGAPS_PATCH
#if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH
#if (PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH) || PERMON_VANITYGAPS_PATCH
arrange(selmon); arrange(selmon);
#else #else
arrange(NULL); arrange(NULL);
#endif // PERTAG_VANITYGAPS_PATCH | PERMON_VANITYGAPS_PATCH #endif // PERTAG_VANITYGAPS_PATCH
} }
static void static void
@@ -206,11 +193,9 @@ getgaps(Monitor *m, int *oh, int *ov, int *ih, int *iv, unsigned int *nc)
unsigned int n, oe, ie; unsigned int n, oe, ie;
#if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH #if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH
oe = ie = m->pertag->enablegaps[m->pertag->curtag]; oe = ie = m->pertag->enablegaps[m->pertag->curtag];
#elif PERMON_VANITYGAPS_PATCH
oe = ie = m->enablegaps;
#else #else
oe = ie = enablegaps; oe = ie = enablegaps;
#endif // PERTAG_VANITYGAPS_PATCH | PERMON_VANITYGAPS_PATCH #endif // PERTAG_VANITYGAPS_PATCH
Client *c; Client *c;
for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);

View File

@@ -132,11 +132,6 @@ xrdb(const Arg *arg)
#endif // BAR_ALPHA_PATCH #endif // BAR_ALPHA_PATCH
ColCount ColCount
); );
#if BAR_SYSTRAY_PATCH && !BAR_ALPHA_PATCH
if (systray) {
XMoveWindow(dpy, systray->win, -32000, -32000);
}
#endif // BAR_SYSTRAY_PATCH
arrange(NULL); arrange(NULL);
focus(NULL); focus(NULL);
} }

View File

@@ -8,8 +8,6 @@
#define BAR_FLEXWINTITLE_PATCH 0 #define BAR_FLEXWINTITLE_PATCH 0
#define BAR_LAUNCHER_PATCH 0
#define BAR_LAYOUTMENU_PATCH 0 #define BAR_LAYOUTMENU_PATCH 0
#define BAR_LTSYMBOL_PATCH 0 #define BAR_LTSYMBOL_PATCH 0
@@ -53,9 +51,9 @@
#define BAR_TITLE_RIGHT_PAD_PATCH 0 #define BAR_TITLE_RIGHT_PAD_PATCH 0
#define BAR_TITLE_LEFT_PAD_PATCH 0 #define BAR_TITLE_LEFT_PAD_PATCH 0
#define BAR_ACTIVETAGINDICATORBAR_PATCH 0 #define BAR_ACTIVETAGINDICATORBAR_PATCH N/A
#define BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH 0 #define BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH N/A
#define BAR_ALPHA_PATCH 0 #define BAR_ALPHA_PATCH 0
@@ -73,7 +71,7 @@
#define BAR_CENTEREDWINDOWNAME_PATCH 0 #define BAR_CENTEREDWINDOWNAME_PATCH 0
#define BAR_CLIENTINDICATOR_PATCH 0 #define BAR_CLIENTINDICATOR_PATCH N/A
#define BAR_DMENUMATCHTOP_PATCH 0 #define BAR_DMENUMATCHTOP_PATCH 0
@@ -93,10 +91,6 @@
#define BAR_PADDING_PATCH 0 #define BAR_PADDING_PATCH 0
#define BAR_PADDING_VANITYGAPS_PATCH 0
#define BAR_PADDING_SMART_PATCH 0
#define BAR_PANGO_PATCH 0 #define BAR_PANGO_PATCH 0
#define BAR_STATICSTATUS_PATCH 0 #define BAR_STATICSTATUS_PATCH 0
@@ -151,8 +145,6 @@
#define DISTRIBUTETAGS_PATCH 0 #define DISTRIBUTETAGS_PATCH 0
#define DO_NOT_DIE_ON_COLOR_ALLOCATION_FAILURE_PATCH 0
#define DRAGCFACT_PATCH 0 #define DRAGCFACT_PATCH 0
#define DRAGMFACT_PATCH 0 #define DRAGMFACT_PATCH 0
@@ -247,10 +239,6 @@
#define PERTAGBAR_PATCH 0 #define PERTAGBAR_PATCH 0
#define PERMON_VANITYGAPS_PATCH 0
#define PLACEDIR_PATCH 0
#define PLACEMOUSE_PATCH 1 #define PLACEMOUSE_PATCH 1
#define PUSH_PATCH 0 #define PUSH_PATCH 0
@@ -289,8 +277,6 @@
#define SELFRESTART_PATCH 0 #define SELFRESTART_PATCH 0
#define SENDMON_CENTER_PATCH 0
#define SENDMON_KEEPFOCUS_PATCH 0 #define SENDMON_KEEPFOCUS_PATCH 0
#define SETBORDERPX_PATCH 0 #define SETBORDERPX_PATCH 0
@@ -363,7 +349,7 @@
#define UNFLOATVISIBLE_PATCH 1 #define UNFLOATVISIBLE_PATCH 1
#define UNMANAGED_PATCH 1 #define UNMANAGED_PATCH 0
#define VANITYGAPS_PATCH 1 #define VANITYGAPS_PATCH 1

View File

@@ -11,7 +11,7 @@ yellow = ${xrdb:color3:#F1FA8C}
green = ${xrdb:color2:#50FA7B} green = ${xrdb:color2:#50FA7B}
orange = ${xrdb:color16:#FFB86C} orange = ${xrdb:color16:#FFB86C}
background = #CC282A36 background = ${self.dark-gray}
background-alt = ${self.light-gray} background-alt = ${self.light-gray}
foreground = ${self.white} foreground = ${self.white}
foreground-alt = ${self.lighter-gray} foreground-alt = ${self.lighter-gray}
@@ -20,8 +20,8 @@ secondary = ${self.blue}
alert = ${self.red} alert = ${self.red}
; left ; left
powermenu-foreground = ${self.blue} powermenu-foreground = ${self.background}
powermenu-background = ${self.background} powermenu-background = ${self.blue}
powermenu-underline = ${self.background} powermenu-underline = ${self.background}
powermenu-overline = ${self.background} powermenu-overline = ${self.background}
@@ -65,67 +65,49 @@ dwm-empty-background = ${self.background}
dwm-empty-underline = ${self.background} dwm-empty-underline = ${self.background}
dwm-empty-overline = ${self.background} dwm-empty-overline = ${self.background}
media-playing-foreground = ${self.green} media-playing-foreground = ${self.background}
media-playing-background = ${self.background} media-playing-background = ${self.green}
media-playing-underline = ${self.background} media-playing-underline = ${self.background}
media-playing-overline = ${self.background} media-playing-overline = ${self.background}
; center
tray-background = ${self.background}
; right ; right
system76-power-foreground = ${self.green} kernel-foreground = ${self.background}
system76-power-background = ${self.background} kernel-background = ${self.orange}
system76-power-underline = ${self.background}
system76-power-overline = ${self.background}
kernel-foreground = ${self.orange}
kernel-background = ${self.background}
kernel-underline = ${self.background} kernel-underline = ${self.background}
kernel-overline = ${self.background} kernel-overline = ${self.background}
cpu-foreground = ${self.purple} cpu-foreground = ${self.background}
cpu-background = ${self.background} cpu-background = ${self.purple}
cpu-underline = ${self.background} cpu-underline = ${self.background}
cpu-overline = ${self.background} cpu-overline = ${self.background}
memory-foreground = ${self.blue} memory-foreground = ${self.background}
memory-background = ${self.background} memory-background = ${self.blue}
memory-underline = ${self.background} memory-underline = ${self.background}
memory-overline = ${self.background} memory-overline = ${self.background}
filesystem-foreground = ${self.pink} filesystem-foreground = ${self.background}
filesystem-background = ${self.background} filesystem-background = ${self.pink}
filesystem-underline = ${self.background} filesystem-underline = ${self.background}
filesystem-overline = ${self.background} filesystem-overline = ${self.background}
date-foreground = ${self.yellow} date-foreground = ${self.background}
date-background = ${self.background} date-background = ${self.yellow}
date-underline = ${self.background} date-underline = ${self.background}
date-overline = ${self.background} date-overline = ${self.background}
time-foreground = ${self.purple} time-foreground = ${self.background}
time-background = ${self.background} time-background = ${self.purple}
time-underline = ${self.background} time-underline = ${self.background}
time-overline = ${self.background} time-overline = ${self.background}
deadd-notification-center-foreground = ${self.green} deadd-notification-center-foreground = ${self.background}
deadd-notification-center-background = ${self.background} deadd-notification-center-background = ${self.green}
deadd-notification-center-underline = ${self.background} deadd-notification-center-underline = ${self.background}
deadd-notification-center-overline = ${self.background} deadd-notification-center-overline = ${self.background}
dunst-foreground = ${self.green} volume-foreground = ${self.background}
dunst-background = ${self.background} volume-background = ${self.red}
dunst-underline = ${self.background}
dunst-overline = ${self.background}
xfce4-notifyd-foreground = ${self.green}
xfce4-notifyd-background = ${self.background}
xfce4-notifyd-underline = ${self.background}
xfce4-notifyd-overline = ${self.background}
volume-foreground = ${self.red}
volume-background = ${self.background}
volume-underline = ${self.background} volume-underline = ${self.background}
volume-overline = ${self.background} volume-overline = ${self.background}
@@ -139,15 +121,13 @@ tray-scale = ${xrdb:polybar.tray-scale:1}
maxlen = ${xrdb:polybar.maxlen:50} maxlen = ${xrdb:polybar.maxlen:50}
[intervals] [intervals]
media-playing = 1 cpu = 1
system76-power = 86400 date = 1
kernel = 86400 time = 1
cpu = 1 filesystem = 900
memory = 1 memory = 1
filesystem = 600 media-playing = 1
date = 1 kernel = 86400
time = 1
dunst = 1
[global/wm] [global/wm]
; Adjust the _NET_WM_STRUT_PARTIAL top value ; Adjust the _NET_WM_STRUT_PARTIAL top value
@@ -230,8 +210,8 @@ radius = 10.0
; Individual values can be defined using: ; Individual values can be defined using:
; {overline,underline}-size ; {overline,underline}-size
; {overline,underline}-color ; {overline,underline}-color
overline-size = 0 overline-size = 4
underline-size = 0 underline-size = 4
; Values applied to all borders ; Values applied to all borders
; Individual side values can be defined using: ; Individual side values can be defined using:
@@ -270,14 +250,11 @@ module-margin = ${sizes.module-margin}
; font-3 = FontAwesome:size=10 ; font-3 = FontAwesome:size=10
; See the Fonts wiki page for more details ; See the Fonts wiki page for more details
font-0 = "Ubuntu Nerd Font:style=Medium:size=11;3" font-0 = "Ubuntu Nerd Font:style=Medium:size=11;3"
font-1 = "MonaspiceNe NF:size=11;3" font-1 = "FiraCode Nerd Font:size=11;3"
font-2 = "DroidSansM Nerd Font:size=11;3" font-2 = "DroidSansM Nerd Font:size=11;3"
font-3 = "IPAPGothic:size=11;3" font-3 = "IPAPGothic:size=11;3"
font-4 = "Baekmuk Dotum:size=11;3" font-4 = "Baekmuk Dotum:size=11;3"
font-5 = "IPAPGothic:size=11;3" font-5 = "IPAPGothic:size=11;3"
font-6 = "NotoSansNerdFont:size=11;3"
font-7 = "NotoSansCJK:size=11;3"
font-8 = "NotoSansYi:size=11;3"
; Modules are added to one of the available blocks ; Modules are added to one of the available blocks
; modules-left = cpu ram ; modules-left = cpu ram
@@ -285,7 +262,7 @@ font-8 = "NotoSansYi:size=11;3"
; modules-right = ipc clock ; modules-right = ipc clock
modules-left = powermenu-left powermenu powermenu-right dwm volume-left volume volume-right media-playing-left media-playing-change media-playing-prev media-playing-play-pause media-playing-next media-playing media-playing-right modules-left = powermenu-left powermenu powermenu-right dwm volume-left volume volume-right media-playing-left media-playing-change media-playing-prev media-playing-play-pause media-playing-next media-playing media-playing-right
; modules-center = ; modules-center =
modules-right = kernel-left kernel kernel-right system76-power-left system76-power system76-power-right cpu-left cpu cpu-right memory-left memory memory-right filesystem-left filesystem filesystem-right date-left date date-right time-left time time-right dunst-left dunst-status dunst-clear dunst-history-view dunst-history-clear dunst-history-length dunst-right modules-right = kernel-left kernel kernel-right cpu-left cpu cpu-right memory-left memory memory-right filesystem-left filesystem filesystem-right date-left date date-right time-left time time-right deadd-notification-center-left deadd-notification-center deadd-notification-center-right
; The separator will be inserted between the output of each module ; The separator will be inserted between the output of each module
separator = "" separator = ""
@@ -335,7 +312,7 @@ tray-maxsize = ${sizes.tray-maxsize}
; ARGB color (e.g. #f00, #ff992a, #ddff1023) ; ARGB color (e.g. #f00, #ff992a, #ddff1023)
; By default the tray container will use the bar ; By default the tray container will use the bar
; background color. ; background color.
tray-background = ${colors.tray-background} tray-background = ${colors.background}
; Tray offset defined as pixel value (e.g. 35) or percentage (e.g. 50%) ; Tray offset defined as pixel value (e.g. 35) or percentage (e.g. 50%)
tray-offset-x = 0 tray-offset-x = 0
@@ -388,7 +365,7 @@ cursor-scroll = ns-resize
[module/powermenu-left] [module/powermenu-left]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.powermenu-background} content-foreground = ${colors.powermenu-background}
content-underline = ${colors.powermenu-underline} content-underline = ${colors.powermenu-underline}
content-overline = ${colors.powermenu-overline} content-overline = ${colors.powermenu-overline}
@@ -396,7 +373,7 @@ content-padding = ${sizes.module-padding}
[module/powermenu-right] [module/powermenu-right]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.powermenu-background} content-foreground = ${colors.powermenu-background}
content-underline = ${colors.powermenu-underline} content-underline = ${colors.powermenu-underline}
content-overline = ${colors.powermenu-overline} content-overline = ${colors.powermenu-overline}
@@ -405,7 +382,7 @@ content-padding = ${sizes.module-padding}
[module/powermenu] [module/powermenu]
type = custom/text type = custom/text
; content = " Menu" ; content = " Menu"
content = "󰀻" content = ""
; content = "" ; content = ""
; "content" has the same properties as "format-NAME" ; "content" has the same properties as "format-NAME"
@@ -420,7 +397,7 @@ content-padding = ${sizes.module-padding}
; click-middle = notify-send middle ; click-middle = notify-send middle
; click-right = notify-send right ; click-right = notify-send right
click-left = "rofi -show combi" click-left = "rofi -show combi"
click-right = "~/.scripts/control-center.sh --rofi" click-right = "/home/sravan/.scripts/control-center.sh --rofi"
; "scroll-(up|down)" will be executed using "/bin/sh -c $COMMAND" ; "scroll-(up|down)" will be executed using "/bin/sh -c $COMMAND"
; scroll-up = notify-send scroll up ; scroll-up = notify-send scroll up
@@ -534,7 +511,7 @@ label-empty-padding = ${sizes.module-dwm-padding}
[module/media-playing-left] [module/media-playing-left]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.media-playing-background} content-foreground = ${colors.media-playing-background}
content-underline = ${colors.media-playing-underline} content-underline = ${colors.media-playing-underline}
content-overline = ${colors.media-playing-overline} content-overline = ${colors.media-playing-overline}
@@ -542,7 +519,7 @@ content-padding = ${sizes.module-padding}
[module/media-playing-right] [module/media-playing-right]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.media-playing-background} content-foreground = ${colors.media-playing-background}
content-underline = ${colors.media-playing-underline} content-underline = ${colors.media-playing-underline}
content-overline = ${colors.media-playing-overline} content-overline = ${colors.media-playing-overline}
@@ -564,7 +541,7 @@ label-padding = 1
[module/media-playing-change] [module/media-playing-change]
type = custom/script type = custom/script
exec = ~/.config/dwm-flexipatch/polybar/scripts/get-media-source-icon.sh exec = /home/sravan/.config/dwm-flexipatch/polybar/scripts/get-media-source-icon.sh
interval = ${intervals.media-playing} interval = ${intervals.media-playing}
format = <label> format = <label>
label = %output% label = %output%
@@ -574,22 +551,11 @@ label-underline = ${colors.media-playing-underline}
label-overline = ${colors.media-playing-overline} label-overline = ${colors.media-playing-overline}
label-maxlen = ${sizes.maxlen} label-maxlen = ${sizes.maxlen}
label-padding = 1 label-padding = 1
click-left = "~/.scripts/playerctl.sh --change" click-left = "/home/sravan/.scripts/playerctl.sh --change"
[module/media-playing-prev] [module/media-playing-prev]
type = custom/text
content = "󰒮"
content-foreground = ${colors.media-playing-foreground}
content-background = ${colors.media-playing-background}
content-underline = ${colors.media-playing-underline}
content-overline = ${colors.media-playing-overline}
content-maxlen = ${sizes.maxlen}
content-padding = 1
click-left = "~/.scripts/playerctl.sh --prev"
[module/media-playing-play-pause]
type = custom/script type = custom/script
exec = ~/.config/dwm-flexipatch/polybar/scripts/get-media-status-icon.sh exec = echo "󰒮"
format = <label> format = <label>
label = %output% label = %output%
label-foreground = ${colors.media-playing-foreground} label-foreground = ${colors.media-playing-foreground}
@@ -598,22 +564,37 @@ label-underline = ${colors.media-playing-underline}
label-overline = ${colors.media-playing-overline} label-overline = ${colors.media-playing-overline}
label-maxlen = ${sizes.maxlen} label-maxlen = ${sizes.maxlen}
label-padding = 1 label-padding = 1
click-left = "~/.scripts/playerctl.sh --play-pause" click-left = "/home/sravan/.scripts/playerctl.sh --prev"
[module/media-playing-play-pause]
type = custom/script
exec = /home/sravan/.config/dwm-flexipatch/polybar/scripts/get-media-status-icon.sh
format = <label>
label = %output%
label-foreground = ${colors.media-playing-foreground}
label-background = ${colors.media-playing-background}
label-underline = ${colors.media-playing-underline}
label-overline = ${colors.media-playing-overline}
label-maxlen = ${sizes.maxlen}
label-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --play-pause"
[module/media-playing-next] [module/media-playing-next]
type = custom/text type = custom/script
content = "󰒭" exec = echo "󰒭"
content-foreground = ${colors.media-playing-foreground} format = <label>
content-background = ${colors.media-playing-background} label = %output%
content-underline = ${colors.media-playing-underline} label-foreground = ${colors.media-playing-foreground}
content-overline = ${colors.media-playing-overline} label-background = ${colors.media-playing-background}
content-maxlen = ${sizes.maxlen} label-underline = ${colors.media-playing-underline}
content-padding = 1 label-overline = ${colors.media-playing-overline}
click-left = "~/.scripts/playerctl.sh --next" label-maxlen = ${sizes.maxlen}
label-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --next"
[module/date-left] [module/date-left]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.date-background} content-foreground = ${colors.date-background}
content-underline = ${colors.date-underline} content-underline = ${colors.date-underline}
content-overline = ${colors.date-overline} content-overline = ${colors.date-overline}
@@ -621,7 +602,7 @@ content-padding = ${sizes.module-padding}
[module/date-right] [module/date-right]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.date-background} content-foreground = ${colors.date-background}
content-underline = ${colors.date-underline} content-underline = ${colors.date-underline}
content-overline = ${colors.date-overline} content-overline = ${colors.date-overline}
@@ -654,7 +635,7 @@ format = <label>
; %date% ; %date%
; %time% ; %time%
; Default: %date% ; Default: %date%
label = " %date%" label = " %date%"
; label-font = 3 ; label-font = 3
label-foreground = ${colors.date-foreground} label-foreground = ${colors.date-foreground}
label-background = ${colors.date-background} label-background = ${colors.date-background}
@@ -664,7 +645,7 @@ label-padding = ${sizes.module-padding}
[module/time-left] [module/time-left]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.time-background} content-foreground = ${colors.time-background}
content-underline = ${colors.time-underline} content-underline = ${colors.time-underline}
content-overline = ${colors.time-overline} content-overline = ${colors.time-overline}
@@ -672,7 +653,7 @@ content-padding = ${sizes.module-padding}
[module/time-right] [module/time-right]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.time-background} content-foreground = ${colors.time-background}
content-underline = ${colors.time-underline} content-underline = ${colors.time-underline}
content-overline = ${colors.time-overline} content-overline = ${colors.time-overline}
@@ -715,7 +696,7 @@ label-padding = ${sizes.module-padding}
[module/kernel-left] [module/kernel-left]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.kernel-background} content-foreground = ${colors.kernel-background}
content-underline = ${colors.kernel-underline} content-underline = ${colors.kernel-underline}
content-overline = ${colors.kernel-overline} content-overline = ${colors.kernel-overline}
@@ -723,7 +704,7 @@ content-padding = ${sizes.module-padding}
[module/kernel-right] [module/kernel-right]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.kernel-background} content-foreground = ${colors.kernel-background}
content-underline = ${colors.kernel-underline} content-underline = ${colors.kernel-underline}
content-overline = ${colors.kernel-overline} content-overline = ${colors.kernel-overline}
@@ -753,7 +734,7 @@ interval = ${intervals.kernel}
; Available tags: ; Available tags:
; <output> - deprecated ; <output> - deprecated
; <label> (default) ; <label> (default)
format = %{A1:kitty bash -c "fastfetch && sleep 15":}<label>%{A} format = <label>
format-foreground = ${colors.kernel-foreground} format-foreground = ${colors.kernel-foreground}
format-background = ${colors.kernel-background} format-background = ${colors.kernel-background}
format-underline = ${colors.kernel-underline} format-underline = ${colors.kernel-underline}
@@ -785,81 +766,9 @@ label-padding = ${sizes.module-padding}
; scroll-up = echo scroll up %counter% ; scroll-up = echo scroll up %counter%
; scroll-down = echo scroll down %counter% ; scroll-down = echo scroll down %counter%
[module/system76-power-left]
type = custom/text
content = " "
content-foreground = ${colors.system76-power-background}
content-underline = ${colors.system76-power-underline}
content-overline = ${colors.system76-power-overline}
content-padding = ${sizes.module-padding}
[module/system76-power-right]
type = custom/text
content = " "
content-foreground = ${colors.system76-power-background}
content-underline = ${colors.system76-power-underline}
content-overline = ${colors.system76-power-overline}
content-padding = ${sizes.module-padding}
[module/system76-power]
type = custom/script
; Available tokens:
; %counter%
; Command to be executed (using "/bin/sh -c [command]")
exec = echo "󰢮 $(sudo system76-power graphics)"
; Conditional command that, if defined, needs to exit successfully
; before the main exec command is invoked.
; Default: ""
; exec-if = pgrep -x myservice
; Will the script output continous content?
; Default: false
tail = false
; Seconds to sleep between updates
; Default: 5 (0 if `tail = true`)
interval = ${intervals.system76-power}
; Available tags:
; <output> - deprecated
; <label> (default)
format = <label>
format-foreground = ${colors.system76-power-foreground}
format-background = ${colors.system76-power-background}
format-underline = ${colors.system76-power-underline}
format-overline = ${colors.system76-power-overline}
; Available tokens:
; %output%
; Default: %output%
label = %output%
label-padding = ${sizes.module-padding}
; Available tokens:
; %counter%
; %pid%
;
; "click-(left|middle|right)" will be executed using "/bin/sh -c [command]"
click-left = nvidia-settings
; click-middle = echo middle %counter%
click-right = ~/.scripts/cpu-gpu.sh --rofi
; double-click-left = echo double left %counter%
; double-click-middle = echo double middle %counter%
; double-click-right = echo double right %counter%
; Available tokens:
; %counter%
; %pid%
;
; "scroll-(up|down)" will be executed using "/bin/sh -c [command]"
; scroll-up = echo scroll up %counter%
; scroll-down = echo scroll down %counter%
[module/cpu-left] [module/cpu-left]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.cpu-background} content-foreground = ${colors.cpu-background}
content-underline = ${colors.cpu-underline} content-underline = ${colors.cpu-underline}
content-overline = ${colors.cpu-overline} content-overline = ${colors.cpu-overline}
@@ -867,7 +776,7 @@ content-padding = ${sizes.module-padding}
[module/cpu-right] [module/cpu-right]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.cpu-background} content-foreground = ${colors.cpu-background}
content-underline = ${colors.cpu-underline} content-underline = ${colors.cpu-underline}
content-overline = ${colors.cpu-overline} content-overline = ${colors.cpu-overline}
@@ -892,7 +801,7 @@ format = %{A1:kitty btop:}<label>%{A}
; %percentage-sum% - Cumulative load on all cores ; %percentage-sum% - Cumulative load on all cores
; %percentage-cores% - load percentage for each core ; %percentage-cores% - load percentage for each core
; %percentage-core[1-9]% - load percentage for specific core ; %percentage-core[1-9]% - load percentage for specific core
label = %percentage%% label = %percentage%%
label-padding = ${sizes.module-padding} label-padding = ${sizes.module-padding}
label-foreground = ${colors.cpu-foreground} label-foreground = ${colors.cpu-foreground}
label-background = ${colors.cpu-background} label-background = ${colors.cpu-background}
@@ -913,7 +822,7 @@ ramp-coreload-foreground = ${colors.cpu}
[module/memory-left] [module/memory-left]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.memory-background} content-foreground = ${colors.memory-background}
content-underline = ${colors.memory-underline} content-underline = ${colors.memory-underline}
content-overline = ${colors.memory-overline} content-overline = ${colors.memory-overline}
@@ -921,7 +830,7 @@ content-padding = ${sizes.module-padding}
[module/memory-right] [module/memory-right]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.memory-background} content-foreground = ${colors.memory-background}
content-underline = ${colors.memory-underline} content-underline = ${colors.memory-underline}
content-overline = ${colors.memory-overline} content-overline = ${colors.memory-overline}
@@ -964,7 +873,7 @@ format = %{A1:kitty btop:}<label>%{A}
; %gb_swap_free% ; %gb_swap_free%
; %gb_swap_used% ; %gb_swap_used%
label = %percentage_used%% label = 󰍛 %percentage_used%%
label-padding = ${sizes.module-padding} label-padding = ${sizes.module-padding}
label-foreground = ${colors.memory-foreground} label-foreground = ${colors.memory-foreground}
label-background = ${colors.memory-background} label-background = ${colors.memory-background}
@@ -1006,7 +915,7 @@ ramp-free-foreground = ${colors.memory}
[module/filesystem-left] [module/filesystem-left]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.filesystem-background} content-foreground = ${colors.filesystem-background}
content-underline = ${colors.filesystem-underline} content-underline = ${colors.filesystem-underline}
content-overline = ${colors.filesystem-overline} content-overline = ${colors.filesystem-overline}
@@ -1014,7 +923,7 @@ content-padding = ${sizes.module-padding}
[module/filesystem-right] [module/filesystem-right]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.filesystem-background} content-foreground = ${colors.filesystem-background}
content-underline = ${colors.filesystem-underline} content-underline = ${colors.filesystem-underline}
content-overline = ${colors.filesystem-overline} content-overline = ${colors.filesystem-overline}
@@ -1043,11 +952,11 @@ spacing = ${sizes.module-margin}
; <bar-free> ; <bar-free>
; <bar-used> ; <bar-used>
; <ramp-capacity> ; <ramp-capacity>
format-mounted = %{A1:qdirstat &:}<label-mounted>%{A} format-mounted = %{A1:filelight &:}<label-mounted>%{A}
; Available tags: ; Available tags:
; <label-unmounted> (default) ; <label-unmounted> (default)
format-unmounted = %{A1:gnome-disks &:}<label-unmounted>%{A} format-unmounted = %{A1:gnome-disks &:} <label-unmounted> %{A}
; Available tokens: ; Available tokens:
; %mountpoint% ; %mountpoint%
@@ -1078,7 +987,7 @@ label-unmounted-padding = ${sizes.module-padding}
[module/deadd-notification-center-left] [module/deadd-notification-center-left]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.deadd-notification-center-background} content-foreground = ${colors.deadd-notification-center-background}
content-underline = ${colors.deadd-notification-center-underline} content-underline = ${colors.deadd-notification-center-underline}
content-overline = ${colors.deadd-notification-center-overline} content-overline = ${colors.deadd-notification-center-overline}
@@ -1086,7 +995,7 @@ content-padding = ${sizes.module-padding}
[module/deadd-notification-center-right] [module/deadd-notification-center-right]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.deadd-notification-center-background} content-foreground = ${colors.deadd-notification-center-background}
content-underline = ${colors.deadd-notification-center-underline} content-underline = ${colors.deadd-notification-center-underline}
content-overline = ${colors.deadd-notification-center-overline} content-overline = ${colors.deadd-notification-center-overline}
@@ -1105,118 +1014,9 @@ content-overline = ${colors.deadd-notification-center-overline}
content-padding = ${sizes.module-padding} content-padding = ${sizes.module-padding}
; "click-(left|middle|right)" will be executed using "/bin/sh -c $COMMAND" ; "click-(left|middle|right)" will be executed using "/bin/sh -c $COMMAND"
click-left = "~/.scripts/deadd.sh --toggle-center" click-left = "/home/sravan/.scripts/deadd.sh --toggle-center"
; click-middle = notify-send middle ; click-middle = notify-send middle
click-right = "~/.scripts/deadd.sh --rofi" click-right = "/home/sravan/.scripts/deadd.sh --rofi"
; "scroll-(up|down)" will be executed using "/bin/sh -c $COMMAND"
; scroll-up = notify-send scroll up
; scroll-down = notify-send scroll down
[module/dunst-left]
type = custom/text
content = " "
content-foreground = ${colors.dunst-background}
content-underline = ${colors.dunst-underline}
content-overline = ${colors.dunst-overline}
content-padding = ${sizes.module-padding}
[module/dunst-right]
type = custom/text
content = " "
content-foreground = ${colors.dunst-background}
content-underline = ${colors.dunst-underline}
content-overline = ${colors.dunst-overline}
content-padding = ${sizes.module-padding}
[module/dunst-status]
type = custom/script
exec = ~/.config/dwm-flexipatch/polybar/scripts/dunst-status.sh
interval = ${intervals.dunst}
format = <label>
label = %output%
label-foreground = ${colors.dunst-foreground}
label-background = ${colors.dunst-background}
label-underline = ${colors.dunst-underline}
label-overline = ${colors.dunst-overline}
label-padding = ${sizes.module-padding}
click-left = "~/.scripts/dunst.sh --dnd"
click-right = "~/.scripts/dunst.sh --rofi"
[module/dunst-clear]
type = custom/text
content = ""
content-foreground = ${colors.dunst-foreground}
content-background = ${colors.dunst-background}
content-underline = ${colors.dunst-underline}
content-overline = ${colors.dunst-overline}
content-padding = 1
click-left = "~/.scripts/dunst.sh --close-all"
[module/dunst-history-view]
type = custom/text
content = "󰋚"
content-foreground = ${colors.dunst-foreground}
content-background = ${colors.dunst-background}
content-underline = ${colors.dunst-underline}
content-overline = ${colors.dunst-overline}
content-padding = 1
click-left = "~/.scripts/dunst.sh --history"
[module/dunst-history-clear]
type = custom/text
content = "󰎟"
content-foreground = ${colors.dunst-foreground}
content-background = ${colors.dunst-background}
content-underline = ${colors.dunst-underline}
content-overline = ${colors.dunst-overline}
content-padding = 1
click-left = "~/.scripts/dunst.sh --history-clear"
[module/dunst-history-length]
type = custom/script
exec = "dunstctl count history"
interval = ${intervals.dunst}
format = <label>
label = %output%
label-foreground = ${colors.dunst-foreground}
label-background = ${colors.dunst-background}
label-underline = ${colors.dunst-underline}
label-overline = ${colors.dunst-overline}
label-padding = 1
[module/xfce4-notifyd-left]
type = custom/text
content = " "
content-foreground = ${colors.xfce4-notifyd-background}
content-underline = ${colors.xfce4-notifyd-underline}
content-overline = ${colors.xfce4-notifyd-overline}
content-padding = ${sizes.module-padding}
[module/xfce4-notifyd-right]
type = custom/text
content = " "
content-foreground = ${colors.xfce4-notifyd-background}
content-underline = ${colors.xfce4-notifyd-underline}
content-overline = ${colors.xfce4-notifyd-overline}
content-padding = ${sizes.module-padding}
[module/xfce4-notifyd]
type = custom/text
content = "󰂚"
; "content" has the same properties as "format-NAME"
; content-background = #000
content-foreground = ${colors.xfce4-notifyd-foreground}
content-background = ${colors.xfce4-notifyd-background}
content-underline = ${colors.xfce4-notifyd-underline}
content-overline = ${colors.xfce4-notifyd-overline}
content-padding = ${sizes.module-padding}
; "click-(left|middle|right)" will be executed using "/bin/sh -c $COMMAND"
click-left = "~/.scripts/xfce4-notifyd.sh --toggle-center"
; click-middle = notify-send middle
click-right = "~/.scripts/xfce4-notifyd.sh --rofi"
; "scroll-(up|down)" will be executed using "/bin/sh -c $COMMAND" ; "scroll-(up|down)" will be executed using "/bin/sh -c $COMMAND"
; scroll-up = notify-send scroll up ; scroll-up = notify-send scroll up
@@ -1224,7 +1024,7 @@ click-right = "~/.scripts/xfce4-notifyd.sh --rofi"
[module/volume-left] [module/volume-left]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.volume-background} content-foreground = ${colors.volume-background}
content-underline = ${colors.volume-underline} content-underline = ${colors.volume-underline}
content-overline = ${colors.volume-overline} content-overline = ${colors.volume-overline}
@@ -1232,7 +1032,7 @@ content-padding = ${sizes.module-padding}
[module/volume-right] [module/volume-right]
type = custom/text type = custom/text
content = " " content = ""
content-foreground = ${colors.volume-background} content-foreground = ${colors.volume-background}
content-underline = ${colors.volume-underline} content-underline = ${colors.volume-underline}
content-overline = ${colors.volume-overline} content-overline = ${colors.volume-overline}

View File

@@ -1,11 +1,11 @@
#!/usr/bin/env bash #!/bin/bash
BAR="mybar" BAR="mybar"
CONFIG="~/.config/dwm-flexipatch/polybar/config.ini" CONFIG="~/.config/dwm-flexipatch/polybar/config.ini"
NUM_MONITORS=0 NUM_MONITORS=0
CONNECTED_MONITORS=$(xrandr --query | grep " connected" | cut -d" " -f1) CONNECTED_MONITORS=$(xrandr --query | grep " connected" | cut -d" " -f1)
TRAY_POS="center" TRAY_POS="center"
pkill polybar killall -q polybar
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
rm /tmp/polybar.pids rm /tmp/polybar.pids

View File

@@ -1,8 +0,0 @@
#!/usr/bin/env bash
isPaused=$(dunstctl is-paused)
if [[ "$isPaused" == "true" ]]; then
echo "󰂛"
else
echo "󰂚"
fi

View File

@@ -0,0 +1,19 @@
#!/bin/bash
mediaStatus=$(playerctl --player=playerctld metadata 2>&1)
if [[ "$mediaStatus" == "No player could handle this command" ]]; then
echo " N/A"
else
artist=$(playerctl --player=playerctld metadata --format '{{ artist }}')
title=$(playerctl --player=playerctld metadata --format '{{ title }}')
if [[ $artist == "" ]]; then
artist="N/A"
fi
if [[ $title == "" ]]; then
title="N/A"
fi
echo "$title - $artist"
fi

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/bash
mediaStatus=$(playerctl --player=playerctld metadata 2>&1) mediaStatus=$(playerctl --player=playerctld metadata 2>&1)
if [[ "$mediaStatus" == "No player could handle this command" ]]; then if [[ "$mediaStatus" == "No player could handle this command" ]]; then

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/bash
mediaStatus=$(playerctl --player=playerctld metadata 2>&1) mediaStatus=$(playerctl --player=playerctld metadata 2>&1)
if [[ "$mediaStatus" == "No player could handle this command" ]]; then if [[ "$mediaStatus" == "No player could handle this command" ]]; then

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/bin/bash
mediaStatus=$(~/.config/dwm-flexipatch/polybar/scripts/get-media-status.sh) mediaStatus=$(/home/sravan/.config/dwm-flexipatch/polybar/scripts/get-media-status.sh)
if [[ "$mediaStatus" == "N/A" ]]; then if [[ "$mediaStatus" == "N/A" ]]; then
echo "󰐎" echo "󰐎"

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/bash
mediaStatus=$(playerctl --player=playerctld metadata 2>&1) mediaStatus=$(playerctl --player=playerctld metadata 2>&1)
if [[ "$mediaStatus" == "No player could handle this command" ]]; then if [[ "$mediaStatus" == "No player could handle this command" ]]; then

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/bash
zscroll \ zscroll \
--length $(xrdb -get polybar.maxlen) \ --length $(xrdb -get polybar.maxlen) \
--delay 0.2 \ --delay 0.2 \

View File

@@ -0,0 +1,23 @@
#!/bin/bash
if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then
updates_arch=0
fi
# if ! updates_aur=$(yay -Qum 2> /dev/null | wc -l); then
if ! updates_aur=$(paru -Qum 2> /dev/null | wc -l); then
# if ! updates_aur=$(cower -u 2> /dev/null | wc -l); then
# if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then
# if ! updates_aur=$(pikaur -Qua 2> /dev/null | wc -l); then
# if ! updates_aur=$(rua upgrade --printonly 2> /dev/null | wc -l); then
updates_aur=0
fi
updates=$((updates_arch + updates_aur))
# if [ "$updates" -gt 0 ]; then
# echo "# $updates"
# else
# echo ""
# fi
echo "$updates"