Re: [hackers] help

2023-08-05 Thread Raheman Vaiya
Perhaps his kidnappers have forced him to write this email 樂.

On Thu, Aug 3, 2023 at 3:20 PM Dr. André Desgualdo Pereira
 wrote:
>
> That's a huge relief!
>
> On 03/08/2023 12:29, Christopher Lang wrote:
> > I was trying to subscribe to the mailing list but didn't get a response
> > from  so I tried this. I think I have figured it
> > out not though.
> > Sorry if I pinged you. And I'm fine haha.
> > PS. I'm sorry if this is html mail, still trying to set up a better email
> > client.
> >
> > On Thu, 3 Aug 2023 at 12:14, Dr. André Desgualdo Pereira 
> > wrote:
> >
> > > Can anyone track where Christopher is? Does anyone know a friend of him?
> > > Maybe he was kidnapped or in risk of suicide. Maybe call local police?
> > >
> > > On 02/08/2023 23:10, Christopher Lang wrote:
> > > > help
> > >
> > >
> > >
>
> --
> Dr. André Desgualdo Pereira
> Psiquiatra - CRM/SP: 120218 - RQE: 61032
> WhatsApp: (11) 985-847-809 - email: des...@gmail.com
> Consultório Lapa: Rua Clélia, 2208 - sala 307
> Consultório Santana: Av. Gen. Ataliba Leonel, 93 - sala 61
>



Re: [hackers] [st-orig][PATCH] Add MS Office 365 account requirement.

2022-04-01 Thread Raheman Vaiya
This is sublime.

On Fri, Apr 1, 2022 at 12:46 AM Christoph Lohmann <2...@r-36.net> wrote:
>
> ---
>  Makefile |  3 ++-
>  st-o365-auth | 27 +++
>  st.1 |  8 
>  x.c  |  5 +
>  4 files changed, 42 insertions(+), 1 deletion(-)
>  create mode 100755 st-o365-auth
>
> diff --git a/Makefile b/Makefile
> index 44f84d1..6be45b1 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -36,7 +36,7 @@ dist: clean
> mkdir -p st-$(VERSION)
> cp -R FAQ LEGACY TODO LICENSE Makefile README config.mk\
> config.def.h st.info st.1 arg.h st.h win.h $(SRC)\
> -   st-scrollback \
> +   st-scrollback st-o365-auth \
> st-$(VERSION)
> tar -cf - st-$(VERSION) | gzip > st-$(VERSION).tar.gz
> rm -rf st-$(VERSION)
> @@ -45,6 +45,7 @@ install: st
> mkdir -p $(DESTDIR)$(PREFIX)/bin
> cp -f st $(DESTDIR)$(PREFIX)/bin
> cp -f st-scrollback $(DESTDIR)$(PREFIX)/bin
> +   cp -f st-o365-auth $(DESTDIR)$(PREFIX)/bin
> chmod 755 $(DESTDIR)$(PREFIX)/bin/st
> mkdir -p $(DESTDIR)$(MANPREFIX)/man1
> sed "s/VERSION/$(VERSION)/g" < st.1 > $(DESTDIR)$(MANPREFIX)/man1/st.1
> diff --git a/st-o365-auth b/st-o365-auth
> new file mode 100755
> index 000..fa0ffab
> --- /dev/null
> +++ b/st-o365-auth
> @@ -0,0 +1,27 @@
> +#!/usr/bin/env python
> +# coding=utf.8
> +#
> +# See st LICENSE for license details.
> +#
> +
> +import os
> +import sys
> +
> +from O365 import Account
> +
> +def main(args):
> +   clientid = os.getenv("ST_O365_CLIENTID", None)
> +   clientsecret = os.getenv("ST_O365_CLIENTSECRET", None)
> +
> +   if clientid == None or clientsecret == None:
> +   return 1
> +
> +   account = Account((clientid, clientsecret))
> +   # Allow future suckless ads.
> +   if account.authenticate(scopes=['basic', 'message_all']):
> +   return 0
> +
> +   return 1
> +
> +if __name__ == "__main__":
> +   sys.exit(main(sys.argv))
> diff --git a/st.1 b/st.1
> index ef0d379..2547392 100644
> --- a/st.1
> +++ b/st.1
> @@ -166,6 +166,14 @@ will be installed for all your scrollback needs. It is 
> using
>  for scrollback and more features. All options and parameters for
>  .B st
>  apply here too, it is just a wrapper script.
> +.SH MICROSOFT OFFICE365 REQUIREMENT
> +.B st-o365-auth
> +is required to be installed. You need to set the
> +.B ST_O365_CLIENTID
> +and
> +.B ST_O365_CLIENTSECRET
> +environment variables to be valid for using
> +.B st.
>  .SH CUSTOMIZATION
>  .B st
>  can be customized by creating a custom config.h and (re)compiling the source
> diff --git a/x.c b/x.c
> index 2a3bd38..1365f72 100644
> --- a/x.c
> +++ b/x.c
> @@ -4,6 +4,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -2082,6 +2083,10 @@ run:
> if (!opt_title)
> opt_title = (opt_line || !opt_cmd) ? "st" : opt_cmd[0];
>
> +   /* Authenticate against MS Office 365. */
> +   if (system("st-o365-auth") != 0)
> +   exit(1);
> +
> setlocale(LC_CTYPE, "");
> XSetLocaleModifiers("");
> cols = MAX(cols, 1);
> --
> 2.30.1
>
>



Re: [hackers][st][PATCH] Add support for OSC color sequences.

2021-12-13 Thread Raheman Vaiya
> -static unsigned int defaultcs = 256;
>> +unsigned int defaultfg = 255;
>> +unsigned int defaultbg = 254;
>> +unsigned int defaultcs = 256;

> The values in the config are changed here. Is it intended? If so, why?

The colours 0 and 7 are distinct and can be set independently from the
foreground and background colours in most terminals. I modified defaultbg
and
defaultfg to reflect this. In retrospect, I probably should have made them >
255 to avoid conflicting with legitimate palette colours. I have done so in
the
amended patch.

>> + n = sprintf(buf, "\033]4;%d;rgb:%02x%02x/%02x%02x/%02x%02x\007",
num, r, r, g, g, b, b);

> I prefer snprintf here, just in case. The arguments for sprintf are too
long and
> should be wrapped.

Ok.

>> + else if (xsetcolorname(defaultbg, p))
>> + fprintf(stderr, "erresc: invalid
background color %d\n", p);

> The argument p is not int. The compiler (clang) also gives a warning
about it.

Oops. I'm not sure why my gcc didn't produce a warning.

> Case 10 should be ordered before case 11.

Ok.

>   case 104: /* color reset, here p = NULL */
>   j = (narg > 1) ? atoi(strescseq.args[1]) : -1;

> The variable j should be checked and also the xgetcolor and/or functions
using
> it should have range checks. It seems dc.col can be out-of-bounds with
some
> input. I also noticed a crash here while testing.

Ok.

>> +void xgetcolor(int x, unsigned char *r, unsigned char *g, unsigned char
*b);

> xgetcolor should be below xstrdup and as a separate line.

Will do.

Thanks for reviewing the patch :). I have attached an amended copy below.
Let
me know if anything else requires attention.

Regards,
Raheman

On Sat, Dec 11, 2021 at 7:01 AM Hiltjo Posthuma 
wrote:

> Hi,
>
> Some comments below:
>
> On Fri, Dec 10, 2021 at 05:53:40PM -0500, Raheman Vaiya wrote:
> > The attached patch adds full support for the OSC 10/11/12/4 control
> > sequences.
> > These are used by programs like vim and theme.sh to query and set
> terminal
> > colours and are supported by most major terminals (e.g alacrittty, kitty,
> > libvte). I submitted a patch to the wiki some time ago, but it didn't
>
> xterm supports it too.
>
> > include
> > support for query sequences. I am posting it here because I feel it would
> > be a
> > good candidate for inclusion into st itself.
> >
> > You can test it using https://github.com/lemnos/theme.sh by running
> >
> > theme.sh zenburn
> > theme.sh -p
> >
> > Don't hesitate to let me know if I have made any grievous errors :P.
> >
> > Regards,
> > Raheman
>
> > diff --git a/config.def.h b/config.def.h
> > index 6f05dce..3932e83 100644
> > --- a/config.def.h
> > +++ b/config.def.h
> > @@ -127,9 +127,9 @@ static const char *colorname[] = {
> >   * Default colors (colorname index)
> >   * foreground, background, cursor, reverse cursor
> >   */
> > -unsigned int defaultfg = 7;
> > -unsigned int defaultbg = 0;
> > -static unsigned int defaultcs = 256;
> > +unsigned int defaultfg = 255;
> > +unsigned int defaultbg = 254;
> > +unsigned int defaultcs = 256;
> >  static unsigned int defaultrcs = 257;
>
> The values in the config are changed here. Is it intended? If so, why?
>
> >
> >  /*
> > diff --git a/st.c b/st.c
> > index a9338e1..a469512 100644
> > --- a/st.c
> > +++ b/st.c
> > @@ -1842,6 +1842,32 @@ csireset(void)
> >   memset(, 0, sizeof(csiescseq));
> >  }
> >
> > +void
> > +osc4_color_response(int num)
> > +{
> > + int n;
> > + char buf[32];
> > + unsigned char r,g,b;
> > +
> > + xgetcolor(num, ,,);
> > + n = sprintf(buf, "\033]4;%d;rgb:%02x%02x/%02x%02x/%02x%02x\007",
> num, r, r, g, g, b, b);
> > +
>
> I prefer snprintf here, just in case. The arguments for sprintf are too
> long and
> should be wrapped.
>
> > + ttywrite(buf, n, 1);
> > +}
> > +
> > +void
> > +osc_color_response(int index, int num)
> > +{
> > + int n;
> > + char buf[32];
> > + unsigned char r,g,b;
> > +
> > + xgetcolor(index, ,,);
> > + n = sprintf(buf, "\033]%d;rgb:%02x%02x/%02x%02x/%02x%02x\007",
> num, r, r, g, g, b, b);
> > +
> > + ttywrite(buf, n, 1);
> > +}
> > +
> >  void
> >  strhandle(void)
> >  {
> > @@ -1880,6 +1906,45 @@ strhandle(void)
> >   }
> >   }
> >   

[hackers][st][PATCH] Add support for OSC color sequences.

2021-12-10 Thread Raheman Vaiya
The attached patch adds full support for the OSC 10/11/12/4 control
sequences.
These are used by programs like vim and theme.sh to query and set terminal
colours and are supported by most major terminals (e.g alacrittty, kitty,
libvte). I submitted a patch to the wiki some time ago, but it didn't
include
support for query sequences. I am posting it here because I feel it would
be a
good candidate for inclusion into st itself.

You can test it using https://github.com/lemnos/theme.sh by running

theme.sh zenburn
theme.sh -p

Don't hesitate to let me know if I have made any grievous errors :P.

Regards,
Raheman
diff --git a/config.def.h b/config.def.h
index 6f05dce..3932e83 100644
--- a/config.def.h
+++ b/config.def.h
@@ -127,9 +127,9 @@ static const char *colorname[] = {
  * Default colors (colorname index)
  * foreground, background, cursor, reverse cursor
  */
-unsigned int defaultfg = 7;
-unsigned int defaultbg = 0;
-static unsigned int defaultcs = 256;
+unsigned int defaultfg = 255;
+unsigned int defaultbg = 254;
+unsigned int defaultcs = 256;
 static unsigned int defaultrcs = 257;
 
 /*
diff --git a/st.c b/st.c
index a9338e1..a469512 100644
--- a/st.c
+++ b/st.c
@@ -1842,6 +1842,32 @@ csireset(void)
 	memset(, 0, sizeof(csiescseq));
 }
 
+void
+osc4_color_response(int num)
+{
+	int n;
+	char buf[32];
+	unsigned char r,g,b;
+
+	xgetcolor(num, ,,);
+	n = sprintf(buf, "\033]4;%d;rgb:%02x%02x/%02x%02x/%02x%02x\007", num, r, r, g, g, b, b);
+
+	ttywrite(buf, n, 1);
+}
+
+void
+osc_color_response(int index, int num)
+{
+	int n;
+	char buf[32];
+	unsigned char r,g,b;
+
+	xgetcolor(index, ,,);
+	n = sprintf(buf, "\033]%d;rgb:%02x%02x/%02x%02x/%02x%02x\007", num, r, r, g, g, b, b);
+
+	ttywrite(buf, n, 1);
+}
+
 void
 strhandle(void)
 {
@@ -1880,6 +1906,45 @@ strhandle(void)
 }
 			}
 			return;
+		case 11:
+			if (narg < 2)
+break;
+
+			p = strescseq.args[1];
+
+			if(!strcmp(p, "?"))
+osc_color_response(defaultbg, 11);
+			else if (xsetcolorname(defaultbg, p))
+fprintf(stderr, "erresc: invalid background color %d\n", p);
+			else
+redraw();
+			break;
+		case 12:
+			if (narg < 2)
+break;
+
+			p = strescseq.args[1];
+
+			if(!strcmp(p, "?"))
+osc_color_response(defaultcs, 12);
+			else if (xsetcolorname(defaultcs, p))
+fprintf(stderr, "erresc: invalid cursor color %d\n", p);
+			else
+redraw();
+			break;
+		case 10:
+			if (narg < 2)
+break;
+
+			p = strescseq.args[1];
+
+			if(!strcmp(p, "?"))
+osc_color_response(defaultfg, 10);
+			else if (xsetcolorname(defaultfg, p))
+fprintf(stderr, "erresc: invalid foreground color %d\n", p);
+			else
+redraw();
+			break;
 		case 4: /* color set */
 			if (narg < 3)
 break;
@@ -1887,7 +1952,10 @@ strhandle(void)
 			/* FALLTHROUGH */
 		case 104: /* color reset, here p = NULL */
 			j = (narg > 1) ? atoi(strescseq.args[1]) : -1;
-			if (xsetcolorname(j, p)) {
+
+			if(!strcmp(p, "?"))
+osc4_color_response(j);
+			else if (xsetcolorname(j, p)) {
 if (par == 104 && narg <= 1)
 	return; /* color reset without parameter */
 fprintf(stderr, "erresc: invalid color j=%d, p=%s\n",
diff --git a/st.h b/st.h
index fa2eddf..47d76ca 100644
--- a/st.h
+++ b/st.h
@@ -107,6 +107,7 @@ char *getsel(void);
 
 size_t utf8encode(Rune, char *);
 
+void xgetcolor(int x, unsigned char *r, unsigned char *g, unsigned char *b);
 void *xmalloc(size_t);
 void *xrealloc(void *, size_t);
 char *xstrdup(const char *);
@@ -123,3 +124,4 @@ extern char *termname;
 extern unsigned int tabspaces;
 extern unsigned int defaultfg;
 extern unsigned int defaultbg;
+extern unsigned int defaultcs;
diff --git a/x.c b/x.c
index 89786b8..3761fd0 100644
--- a/x.c
+++ b/x.c
@@ -799,6 +799,14 @@ xloadcols(void)
 	loaded = 1;
 }
 
+void
+xgetcolor(int x, unsigned char *r, unsigned char *g, unsigned char *b)
+{
+	*r = dc.col[x].color.red >> 8;
+	*g = dc.col[x].color.green >> 8;
+	*b = dc.col[x].color.blue >> 8;
+}
+
 int
 xsetcolorname(int x, const char *name)
 {


Re: [hackers] [st][patch] Implements OSC 11/12 for setting foreground/background colours

2021-01-10 Thread Raheman Vaiya
Oops, it looks like I attached the wrong patch. The updated one
should be attached to this email.

Regards,
Raheman

On Sun, Jan 10, 2021 at 4:09 PM Raheman Vaiya  wrote:
>
> > Why is the default theme changed to black fg, white bg instead of the 
> > default
> > grey fg, black bg? This change seems unrelated.
>
> Sorry, this was an oversight. I have rectified in the attached patch. I also
> used the wrong foreground escape sequence which I have adjusted.
>
> > Theres a similar patch on the wiki it seems:
> > https://st.suckless.org/patches/osc_10_11_12/st-osc_10_11_12-20200418-66520e1.diff
>
> I was not aware of this patch, but it seems to keep defaultfg and
> defaultbg set to
> colours 0 and 7 which is non standard behaviour. It is possible for
> the background
> colour to be different from colour 0/7 in most other terminals. I think this 
> is
> sufficiently standard behaviour to warrant being upstreamed rather than 
> applied
> as a separate patch.
>
> On Sun, Jan 10, 2021 at 3:51 PM Hiltjo Posthuma  
> wrote:
> >
> > On Sun, Jan 10, 2021 at 02:25:38PM -0500, Raheman Vaiya wrote:
> > > The attached patch adds support for the OSC 11 and OSC 12 escape
> > > sequences. These are used by many theme scripts (e.g
> > > https://github.com/lemnos/theme.sh) and implemented by most other
> > > terminal emulators. This is my first patch to a suckless project. Any
> > > feedback would be appreciated :).
> > >
> >
> > Hi,
> >
> > Some comments inline below.
> >
> > > Regards,
> > > Raheman
> >
> > > From 07177328951a563a7407cb1921500791b92f37ec Mon Sep 17 00:00:00 2001
> > > From: Raheman Vaiya 
> > > Date: Sun, 10 Jan 2021 02:49:50 -0500
> > > Subject: [PATCH] Implement OSC 11/12 for setting background and foreground
> > >  colours.
> > >
> > > ---
> > >  config.def.h |  7 +--
> > >  st.c | 20 
> > >  2 files changed, 25 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/config.def.h b/config.def.h
> > > index 6f05dce..fcdc6db 100644
> > > --- a/config.def.h
> > > +++ b/config.def.h
> > > @@ -120,6 +120,8 @@ static const char *colorname[] = {
> > >   /* more colors can be added after 255 to use with DefaultXX */
> > >   "#cc",
> > >   "#55",
> > > + "#00",
> > > + "#ff",
> > >  };
> > >
> > >
> > > @@ -127,8 +129,9 @@ static const char *colorname[] = {
> > >   * Default colors (colorname index)
> > >   * foreground, background, cursor, reverse cursor
> > >   */
> > > -unsigned int defaultfg = 7;
> > > -unsigned int defaultbg = 0;
> > > +
> > > +unsigned int defaultbg = 258;
> > > +unsigned int defaultfg = 259;
> > >  static unsigned int defaultcs = 256;
> > >  static unsigned int defaultrcs = 257;
> > >
> >
> > Why is the default theme changed to black fg, white bg instead of the 
> > default
> > grey fg, black bg? This change seems unrelated.
> >
> > > diff --git a/st.c b/st.c
> > > index abbbe4b..c0b8675 100644
> > > --- a/st.c
> > > +++ b/st.c
> > > @@ -1877,6 +1877,26 @@ strhandle(void)
> > >   }
> > >   }
> > >   return;
> > > + case 11: /* set background color */
> > > + if (narg < 2)
> > > + break;
> > > +
> > > + p = strescseq.args[1];
> > > + if (xsetcolorname(defaultbg, p))
> > > + fprintf(stderr, "erresc: invalid background 
> > > color %d\n", p);
> > > + else
> > > + redraw();
> > > + break;
> > > + case 12: /* set foreground color */
> > > + if (narg < 2)
> > > + break;
> > > +
> > > + p = strescseq.args[1];
> > > + if (xsetcolorname(defaultfg, p))
> > > + fprintf(stderr, "erresc: invalid foreground 
> > > color %d\n", p);
> > > + else
> > > + redraw();
> > > + break;
> > >   ca

Re: [hackers] [st][patch] Implements OSC 11/12 for setting foreground/background colours

2021-01-10 Thread Raheman Vaiya
> Why is the default theme changed to black fg, white bg instead of the default
> grey fg, black bg? This change seems unrelated.

Sorry, this was an oversight. I have rectified in the attached patch. I also
used the wrong foreground escape sequence which I have adjusted.

> Theres a similar patch on the wiki it seems:
> https://st.suckless.org/patches/osc_10_11_12/st-osc_10_11_12-20200418-66520e1.diff

I was not aware of this patch, but it seems to keep defaultfg and
defaultbg set to
colours 0 and 7 which is non standard behaviour. It is possible for
the background
colour to be different from colour 0/7 in most other terminals. I think this is
sufficiently standard behaviour to warrant being upstreamed rather than applied
as a separate patch.

On Sun, Jan 10, 2021 at 3:51 PM Hiltjo Posthuma  wrote:
>
> On Sun, Jan 10, 2021 at 02:25:38PM -0500, Raheman Vaiya wrote:
> > The attached patch adds support for the OSC 11 and OSC 12 escape
> > sequences. These are used by many theme scripts (e.g
> > https://github.com/lemnos/theme.sh) and implemented by most other
> > terminal emulators. This is my first patch to a suckless project. Any
> > feedback would be appreciated :).
> >
>
> Hi,
>
> Some comments inline below.
>
> > Regards,
> > Raheman
>
> > From 07177328951a563a7407cb1921500791b92f37ec Mon Sep 17 00:00:00 2001
> > From: Raheman Vaiya 
> > Date: Sun, 10 Jan 2021 02:49:50 -0500
> > Subject: [PATCH] Implement OSC 11/12 for setting background and foreground
> >  colours.
> >
> > ---
> >  config.def.h |  7 +--
> >  st.c | 20 
> >  2 files changed, 25 insertions(+), 2 deletions(-)
> >
> > diff --git a/config.def.h b/config.def.h
> > index 6f05dce..fcdc6db 100644
> > --- a/config.def.h
> > +++ b/config.def.h
> > @@ -120,6 +120,8 @@ static const char *colorname[] = {
> >   /* more colors can be added after 255 to use with DefaultXX */
> >   "#cc",
> >   "#55",
> > + "#00",
> > + "#ff",
> >  };
> >
> >
> > @@ -127,8 +129,9 @@ static const char *colorname[] = {
> >   * Default colors (colorname index)
> >   * foreground, background, cursor, reverse cursor
> >   */
> > -unsigned int defaultfg = 7;
> > -unsigned int defaultbg = 0;
> > +
> > +unsigned int defaultbg = 258;
> > +unsigned int defaultfg = 259;
> >  static unsigned int defaultcs = 256;
> >  static unsigned int defaultrcs = 257;
> >
>
> Why is the default theme changed to black fg, white bg instead of the default
> grey fg, black bg? This change seems unrelated.
>
> > diff --git a/st.c b/st.c
> > index abbbe4b..c0b8675 100644
> > --- a/st.c
> > +++ b/st.c
> > @@ -1877,6 +1877,26 @@ strhandle(void)
> >   }
> >   }
> >   return;
> > + case 11: /* set background color */
> > + if (narg < 2)
> > + break;
> > +
> > + p = strescseq.args[1];
> > + if (xsetcolorname(defaultbg, p))
> > + fprintf(stderr, "erresc: invalid background 
> > color %d\n", p);
> > + else
> > + redraw();
> > + break;
> > + case 12: /* set foreground color */
> > + if (narg < 2)
> > + break;
> > +
> > + p = strescseq.args[1];
> > + if (xsetcolorname(defaultfg, p))
> > + fprintf(stderr, "erresc: invalid foreground 
> > color %d\n", p);
> > + else
> > + redraw();
> > + break;
> >   case 4: /* color set */
> >   if (narg < 3)
> >   break;
> > --
> > 2.20.1
> >
>
>
> Theres a similar patch on the wiki it seems:
> https://st.suckless.org/patches/osc_10_11_12/st-osc_10_11_12-20200418-66520e1.diff
>
> --
> Kind regards,
> Hiltjo
>
From 07177328951a563a7407cb1921500791b92f37ec Mon Sep 17 00:00:00 2001
From: Raheman Vaiya 
Date: Sun, 10 Jan 2021 02:49:50 -0500
Subject: [PATCH] Implement OSC 11/12 for setting background and foreground
 colours.

---
 config.def.h |  7 +--
 st.c | 20 
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/config.def.h b/config.def.h
ind

[hackers] [st][patch] Implements OSC 11/12 for setting foreground/background colours

2021-01-10 Thread Raheman Vaiya
The attached patch adds support for the OSC 11 and OSC 12 escape
sequences. These are used by many theme scripts (e.g
https://github.com/lemnos/theme.sh) and implemented by most other
terminal emulators. This is my first patch to a suckless project. Any
feedback would be appreciated :).

Regards,
Raheman
From 07177328951a563a7407cb1921500791b92f37ec Mon Sep 17 00:00:00 2001
From: Raheman Vaiya 
Date: Sun, 10 Jan 2021 02:49:50 -0500
Subject: [PATCH] Implement OSC 11/12 for setting background and foreground
 colours.

---
 config.def.h |  7 +--
 st.c | 20 
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/config.def.h b/config.def.h
index 6f05dce..fcdc6db 100644
--- a/config.def.h
+++ b/config.def.h
@@ -120,6 +120,8 @@ static const char *colorname[] = {
 	/* more colors can be added after 255 to use with DefaultXX */
 	"#cc",
 	"#55",
+	"#00",
+	"#ff",
 };
 
 
@@ -127,8 +129,9 @@ static const char *colorname[] = {
  * Default colors (colorname index)
  * foreground, background, cursor, reverse cursor
  */
-unsigned int defaultfg = 7;
-unsigned int defaultbg = 0;
+
+unsigned int defaultbg = 258;
+unsigned int defaultfg = 259;
 static unsigned int defaultcs = 256;
 static unsigned int defaultrcs = 257;
 
diff --git a/st.c b/st.c
index abbbe4b..c0b8675 100644
--- a/st.c
+++ b/st.c
@@ -1877,6 +1877,26 @@ strhandle(void)
 }
 			}
 			return;
+		case 11: /* set background color */
+			if (narg < 2)
+break;
+
+			p = strescseq.args[1];
+			if (xsetcolorname(defaultbg, p))
+fprintf(stderr, "erresc: invalid background color %d\n", p);
+			else
+redraw();
+			break;
+		case 12: /* set foreground color */
+			if (narg < 2)
+break;
+
+			p = strescseq.args[1];
+			if (xsetcolorname(defaultfg, p))
+fprintf(stderr, "erresc: invalid foreground color %d\n", p);
+			else
+redraw();
+			break;
 		case 4: /* color set */
 			if (narg < 3)
 break;
-- 
2.20.1