sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

dwm-launchers-colors-20231221-81aca1b.diff (3573B)


      1 From 81aca1b1533076fe353bee2d29d169adfca55b44 Mon Sep 17 00:00:00 2001
      2 From: fennec <xovo6six@gmail.com>
      3 Date: Thu, 21 Dec 2023 13:53:18 +0000
      4 Subject: [PATCH] Patch for launcher icon colors
      5 
      6 ---
      7  chadwm/config.def.h | 17 +++++++++++++++++
      8  chadwm/dwm.c        | 32 +++++++++++++++++++++++++++++++-
      9  2 files changed, 48 insertions(+), 1 deletion(-)
     10 
     11 diff --git a/chadwm/config.def.h b/chadwm/config.def.h
     12 index 45e60b2..fbaf85c 100644
     13 --- a/chadwm/config.def.h
     14 +++ b/chadwm/config.def.h
     15 @@ -59,16 +59,32 @@ static const char *colors[][3]      = {
     16      [SchemeBtnPrev]    = { green,   black,  black },
     17      [SchemeBtnNext]    = { yellow,  black,  black },
     18      [SchemeBtnClose]   = { red,     black,  black },
     19 +    [SchemeColorEW]    = { orange,   black,  black }, // color ewww launcher icon
     20 +    [SchemeColorFF]    = { pink,   black,  black }, // color firefox launcher icon
     21 +    [SchemeColorDS]    = { red,   black,  black }, // color discord launcher icon
     22 +    [SchemeColorTG]    = { green,   black,  black }, // color telegram launcher icon
     23 +    [SchemeColorMS]    = { blue,   black,  black }, // color mintstick launcher icon
     24 +    [SchemeColorPC]    = { yellow,   black,  black }, // color pavucontrol launcher icon
     25  };
     26  
     27  /* tagging */
     28  static char *tags[] = {"", "", "", "", ""};
     29  
     30  static const char* eww[] = { "eww", "open" , "eww", NULL };
     31 +static const char* firefox[] = { "firefox", "open", "firefox", NULL };
     32 +static const char* discord[] = { "discord", "open" , "discord", NULL };
     33 +static const char* telegram[] = { "telegram-desktop", "open" , "telegram-desktop", NULL };
     34 +static const char* mintstick[] = { "mintstick", "-m", "iso", NULL};
     35 +static const char* pavucontrol[] = { "pavucontrol", NULL };
     36  
     37  static const Launcher launchers[] = {
     38      /* command     name to display */
     39      { eww,         "" },
     40 +    { firefox,         "" },
     41 +    { discord,       "ﱲ" },
     42 +    { telegram,      "" },
     43 +    { mintstick,     "虜" },
     44 +    { pavucontrol,   "墳" },
     45  };
     46  
     47  static const int tagschemes[] = {
     48 @@ -287,3 +303,4 @@ static const Button buttons[] = {
     49      { ClkTabNext,           0,              Button1,        movestack,      { .i = +1 } },
     50      { ClkTabClose,          0,              Button1,        killclient,     {0} },
     51  };
     52 +
     53 diff --git a/chadwm/dwm.c b/chadwm/dwm.c
     54 index ddb7e0c..84639cc 100644
     55 --- a/chadwm/dwm.c
     56 +++ b/chadwm/dwm.c
     57 @@ -108,7 +108,13 @@ enum {
     58    TabNorm,
     59    SchemeBtnPrev,
     60    SchemeBtnNext,
     61 -  SchemeBtnClose
     62 +  SchemeBtnClose,
     63 +  SchemeColorEW,
     64 +  SchemeColorFF,
     65 +  SchemeColorDS,
     66 +  SchemeColorTG,
     67 +  SchemeColorMS,
     68 +  SchemeColorPC
     69  }; /* color schemes */
     70  enum {
     71    NetSupported,
     72 @@ -1519,6 +1525,30 @@ void drawbar(Monitor *m) {
     73  
     74    	for (i = 0; i < LENGTH(launchers); i++)
     75  	{
     76 +        if (launchers[i].command == eww){
     77 +            drw_setscheme(drw, scheme[SchemeColorEW]);
     78 +        }
     79 +
     80 +        if (launchers[i].command == firefox){
     81 +          drw_setscheme(drw, scheme[SchemeColorFF]);
     82 +        }
     83 +
     84 +        if (launchers[i].command == discord){
     85 +          drw_setscheme(drw, scheme[SchemeColorDS]);
     86 +        }
     87 +
     88 +        if (launchers[i].command == telegram){
     89 +          drw_setscheme(drw, scheme[SchemeColorTG]);
     90 +        }
     91 +
     92 +        if (launchers[i].command == mintstick){
     93 +          drw_setscheme(drw, scheme[SchemeColorMS]);
     94 +        }
     95 +
     96 +        if (launchers[i].command == pavucontrol){
     97 +          drw_setscheme(drw, scheme[SchemeColorPC]);
     98 +        }
     99 +
    100  		w = TEXTW(launchers[i].name);
    101  		drw_text(drw, x, 0, w, bh, lrpad / 2, launchers[i].name, urg & 1 << i);
    102  		x += w;
    103 -- 
    104 2.43.0
    105