Re: [hackers] [slstatus][patch] Use ALSA for vol_perc on Linux

2020-05-22 Thread Ivan Tham
On Fri, May 22, 2020 at 11:58:23AM +0200, Thomas Vigouroux wrote: Quoting Ivan Tham (2020-05-22 10:52:21) I believe you may need to convert it to double before division and round the volume. My dwms have something similar: return smprintf("%d", (int) rint((double)

Re: [hackers] [slstatus][patch] Use ALSA for vol_perc on Linux

2020-05-22 Thread Ivan Tham
On Thu, May 21, 2020 at 10:39:22PM +0200, Thomas Vigouroux wrote: For linux only, use ALSA instead of OSS to get volume. Requires slstatus to be compiled with -lasound. diff --git a/components/volume.c b/components/volume.c index 61cec90..6a5f5a1 100644 --- a/components/volume.c +++

Re: [hackers] [nord][PATCH] Added nord colorscheme patch for dwm

2020-05-19 Thread Ivan Tham
, 2020 12:22 PM, depsterr wrote: That could be a good idea, though I am unsure of how to do so. I'll look into it. While I'm at it I could try to get st listed as well, since it also has a nord patch. ‐‐‐ Original Message ‐‐‐ On Monday, May 18, 2020 4:21 AM, Ivan Tham pickf

Re: [hackers] [nord][PATCH] Added nord colorscheme patch for dwm

2020-05-17 Thread Ivan Tham
Hi depsterr, Maybe you might want to add a screenshot to https://www.nordtheme.com/ports? On Sun, May 17, 2020 at 07:33:49PM +, depsterr wrote: From: depsterr --- .../nord/dwm-nord-20200517-f09418b.diff | 47 +++ .../patches/nord/dwm-nord-6.2.diff| 35

[hackers] [st][PATCH] Update XIM cursor position only if changed

2020-04-15 Thread Ivan Tham
Updating XIM cursor position is expensive, so only update it when cursor position changed. --- st.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git st.c st.c index 3e48410..4f7243f 100644 --- st.c +++ st.c @@ -2570,7 +2570,7 @@ drawregion(int x1, int y1, int x2, int y2)

[hackers] [libgrapheme][PATCH] Add example to man page

2020-03-31 Thread Ivan Tham
--- man/grapheme_len.3 | 19 +++ 1 file changed, 19 insertions(+) diff --git man/grapheme_len.3 man/grapheme_len.3 index b7f13b7..90951d0 100644 --- man/grapheme_len.3 +++ man/grapheme_len.3 @@ -12,6 +12,25 @@ .Nm returns the length (in bytes) of the grapheme cluster beginning

[hackers] [st][PATCH 2/3] Reuse deltatime to reduce calculation

2020-03-18 Thread Ivan Tham
The deltatime variable is not used later so it can be reused for calculations. --- x.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/x.c b/x.c index 03f397f..0d9f48f 100644 --- a/x.c +++ b/x.c @@ -1936,16 +1936,11 @@ run(void) xev--;

[hackers] [st][PATCH 1/3] Rearrange run with fast exit

2020-03-18 Thread Ivan Tham
Quickly swap out of loop to reduce indentation. --- x.c | 55 +++ 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/x.c b/x.c index 48a6676..03f397f 100644 --- a/x.c +++ b/x.c @@ -1919,37 +1919,36 @@ run(void)

[hackers] [st][PATCH 3/3] Assign dodraw at the end of block

2020-03-18 Thread Ivan Tham
Keep congruency with the previous block. --- x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x.c b/x.c index 0d9f48f..01fd62a 100644 --- a/x.c +++ b/x.c @@ -1915,8 +1915,8 @@ run(void) } deltatime = TIMEDIFF(now, last); if

Re: [hackers] [st][PATCH] Rearrange x run with fast exit

2020-03-18 Thread Ivan Tham
On Wed, Mar 18, 2020 at 02:10:36PM +0100, Quentin Rameau wrote: >> Quickly swap out of loop to reduce indentation needed. >> Reuse deltatime variable to reuse calculation. > >Don't be afraid to separate unrelated modifications into separate >commits! > On Wed, Mar 18, 2020 at 09:41:14PM +0100,

Re: [hackers] [st][PATCH] Rearrange x run with fast exit

2020-03-18 Thread Ivan Tham
I separate unrelated modifications into unrelated commits but this is still related, I think it also belongs under reorderings. On Wed, Mar 18, 2020 at 02:10:36PM +0100, Quentin Rameau wrote: Quickly swap out of loop to reduce indentation needed. Reuse deltatime variable to reuse calculation.

[hackers] [st][PATCH] Rearrange x run with fast exit

2020-03-17 Thread Ivan Tham
Quickly swap out of loop to reduce indentation needed. Reuse deltatime variable to reuse calculation. --- x.c | 56 +--- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/x.c b/x.c index 48a6676..01fd62a 100644 --- a/x.c +++ b/x.c

[hackers] [st][PATCH] Remove explicit XNFocusWindow

2020-02-18 Thread Ivan Tham
XCreateIC ICValues default XNFocusWindow to XNClientWindow if not specified, it can be omitted since it is the same. >From the documentation https://www.x.org/releases/current/doc/libX11/libX11/libX11.html > Focus Window > > The XNFocusWindow argument specifies the focus window. The primary >

[hackers] [st][PATCH] Remove explicit XNFocusWindow

2020-02-17 Thread Ivan Tham
XCreateIC ICValues default XNFocusWindow to XNClientWindow if not specified, it can be omitted since it is the same. --- x.c | 1 - 1 file changed, 1 deletion(-) diff --git a/x.c b/x.c index 1f62129..48a6676 100644 --- a/x.c +++ b/x.c @@ -1047,7 +1047,6 @@ ximopen(Display *dpy)

[hackers] [st][PATCH 3/3] Rearrange run with fast exit

2020-02-03 Thread Ivan Tham
Quickly swap out of loop to reduce indentation needed. Reuse deltatime variable to reuse calculation. --- x.c | 56 +--- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/x.c b/x.c index 76fa689..5f879fa 100644 --- a/x.c +++ b/x.c

[hackers] [st][PATCH 1/3] Update XIM spot location when needed

2020-02-03 Thread Ivan Tham
Reduce number of calls to update XIM only if cursor position was changed and user is not holding a key. In other words, send cursor position on the last key release which change cursor position. It also help reduce input lag problem with fcitx5 when holding keys. --- st.c | 7 +-- x.c | 15

[hackers] [st][PATCH 2/3] Rename spotlist to preedit

2020-02-03 Thread Ivan Tham
Input Context Values contains both preedit and status attributes which both takes in XVaNestedList type. It would be clearer to use preedit explains more of the preedit attributes compared to spotlist which may not only be used for spot. --- x.c | 9 - 1 file changed, 4 insertions(+), 5

[hackers] [st][PATCH 1/2] Update XIM spot location only when cursor moved

2020-02-02 Thread Ivan Tham
This patch reduces number of calls to update XIM cursor position and increases the input latency noticibly by updating XIM after term.c.x or term.c.y changed rather than in draw which updates cursor position whenever a redraw happens like focus changed or redraw block. It also help solve input lag

[hackers] [st][PATCH 2/2] Rename spotlist to preedit

2020-02-02 Thread Ivan Tham
Input Context Values contains both preedit and status attributes which both takes in XVaNestedList type. It would be clearer to use preedit explains more of the preedit attributes compared to spotlist which may not only be used for spot. --- x.c | 9 - 1 file changed, 4 insertions(+), 5

[hackers] [st][PATCH 4/4] Update cursor position along xdrawcursor

2020-02-02 Thread Ivan Tham
xdrawcursor keeps track of when the cursor is needed to be updated, so better to just update cursor position alongside rather than in draw. --- st.c | 1 - x.c | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/st.c b/st.c index 3e48410..06f267e 100644 --- a/st.c +++ b/st.c

[hackers] [st][PATCH 3/4] XNFocusWindow not needed for ximopen

2020-02-02 Thread Ivan Tham
XNFocusWindow defaults to XNClientWindow if not specified --- x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x.c b/x.c index 919a0ab..13194c6 100644 --- a/x.c +++ b/x.c @@ -1037,8 +1037,9 @@ ximopen() } if (XSetIMValues(xw.xim, XNDestroyCallback, , NULL)

[hackers] [st][PATCH 1/4] Use global Display for ximopen

2020-02-02 Thread Ivan Tham
--- x.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x.c b/x.c index e000894..9289a75 100644 --- a/x.c +++ b/x.c @@ -142,7 +142,7 @@ static void xdrawglyphfontspecs(const XftGlyphFontSpec *, Glyph, int, int, int); static void xdrawglyph(Glyph, int, int); static

[hackers] [st][PATCH 2/4] Comment over-the-spot method used

2020-02-02 Thread Ivan Tham
--- x.c | 1 + 1 file changed, 1 insertion(+) diff --git a/x.c b/x.c index 9289a75..919a0ab 100644 --- a/x.c +++ b/x.c @@ -1024,6 +1024,7 @@ xunloadfonts(void) void ximopen() { + /** Update cursor position using over-the-spot method */ XIMCallback destroy = { .client_data =

[hackers] [st][PATCH] Increase XmbLookupString buffer

2020-01-17 Thread Ivan Tham
Current buffer is too short to input medium to long sentences from IME. Input with longer text will show the wrong input, taking 64 instead of 32 bytes should be enough for most of the cases. Broken cases before, Chinese (taken from song 也可以) 可不可以轻轻的松开自己 Japanese (taken from bootleggers rom

[hackers] [dwm][PATCH] Invert urgent border for window hint

2019-09-19 Thread Ivan Tham
Feature parity for tags with urgent client. Tags are inversed but not window border. Window border now uses SchemeNorm ColFg, same as tags but for window. Prior art: https://dwm.suckless.org/patches/focusurgent/ --- dwm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dwm.c b/dwm.c index

[hackers] [dwm][PATCH] Invert urgent border for window hint

2019-09-02 Thread Ivan Tham
Feature parity for tags with urgent client. Tags are inversed but not window border. Window border now uses SchemeNorm ColFg, same as tags but for window. Prior art: https://dwm.suckless.org/patches/focusurgent/ --- dwm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[hackers] [dmenu][PATCH] Capture KeyRelease without processing

2019-02-16 Thread Ivan Tham
Most IME uses keyboard shortcuts to switch to next keyboard input such as LCTRL + LSHIFT, so need to unmask this event for processing by XIM. --- dmenu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dmenu.c b/dmenu.c index 3bfd74d..c21ca7a 100644 --- a/dmenu.c +++ b/dmenu.c

Re: [hackers] [st][PATCH] Fix crash on IME restart

2019-01-28 Thread Ivan Tham
Hiljto, sorry for the wait. I had sent a reply to the thread but somehow it does not appear on the list. I am not sure how to reply to an email that I have deleted so I just send a new patch with the description. On Tue, Jan 29, 2019 at 01:41:13PM +0800, Ivan Tham wrote: Register

[hackers] [st][PATCH] Fix crash on IME restart

2019-01-28 Thread Ivan Tham
Register XNDestroyCallback on IME to reinstatiate XIM. This does not solve: - IME not usable if st started before IME - st goes blank with two st in a dwm tag after restarting IME, might be dwm bug as it is happens to other terminal as well Steps to reproduce (using dwm): 1. Open `fcitx` 2.

Re: [hackers] [st][PATCH 00/24] odg patches - fix warnings/errors, plug leaks, tidying up

2019-01-23 Thread Ivan Tham
On Wed, Jan 23, 2019 at 03:54:35AM +0100, kais euchi wrote: Greetings ! What's the point of all this if you are treating others who try to participate this way ? I have never seen such lack of tact. This sucks. I am amazed that quinq even reviewed every single patch and give comments. I

Re: [hackers] [st][PATCH] Fix crash on IME restart

2019-01-23 Thread Ivan Tham
tart fcitx 4. Both `st` (or other terminal emulators) crashed on hover I will probably send another patch to set the IME input position. On Wed, Jan 23, 2019 at 09:33:36AM +0100, Hiltjo Posthuma wrote: On Wed, Jan 23, 2019 at 01:53:56AM +0800, Ivan Tham wrote: Register XNDestroyCallb

[hackers] [st][PATCH] Fix crash on IME restart

2019-01-22 Thread Ivan Tham
Register XNDestroyCallback on IME to reinstatiate XIM. This does not solve: - IME not usable if st started before IME - st goes blank with two st in a dwm tag after restarting IME, might be dwm bug as it is happens to other terminal as well --- x.c | 61

Re: [hackers] [st][PATCH] Follow text color only if exists

2018-07-15 Thread Ivan Tham
Yes, I was using fish shell on st. When when you insert a character, it will have syntax highlighting and change the color then it fails there. Maybe the color is true color? On Sat, Jul 14, 2018 at 11:21:46PM +0200, Jules Maselbas wrote: Hi, Fix crash when text color is not set and is out

[hackers] [st][PATCH] Remove comment for color

2018-07-14 Thread Ivan Tham
--- config.def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index ca6b0db..9368f50 100644 --- a/config.def.h +++ b/config.def.h @@ -114,7 +114,7 @@ static const char *colorname[] = { /* * Default colors (colorname index) - * foreground,

[hackers] [st][PATCH] Follow text color only if exists

2018-07-14 Thread Ivan Tham
Fix crash when text color is not set and is out of bound. --- x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x.c b/x.c index b51821d..4b7ffe6 100644 --- a/x.c +++ b/x.c @@ -1425,7 +1425,7 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)

[hackers] [[st][PATCH]] Move term_mode to st.h

2018-03-16 Thread Ivan Tham
This allows MODE_ALTSCREEN to be applied to scrollback patch in x.c --- st.c | 11 --- st.h | 11 +++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/st.c b/st.c index 65a0cb6..1eafc0e 100644 --- a/st.c +++ b/st.c @@ -47,17 +47,6 @@ /* constants */ #define

Re: Re: [hackers] [surf] Simplify DOWNLOAD macro || Quentin Rameau

2017-05-10 Thread Ivan Tham
s...@mailless.org wrote: > Hi, > > I chime in again: > > I think it's definitely the right thing to make it interactive, rather than > sleep. > > I found it very beneficial to go a step further: rather than just asking for > confirmation with `read`, I drop the user in a shell, after the

[hackers] [surf][PATCH] Match showcert key with man and surf pop-up

2017-05-01 Thread Ivan Tham
--- config.def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index 57cef76..9d16984 100644 --- a/config.def.h +++ b/config.def.h @@ -152,7 +152,7 @@ static Key keys[] = { { MODKEY|GDK_SHIFT_MASK, GDK_KEY_n, find, { .i = -1 }

[hackers] [surf-webkit2][PATCH] Add Forward/Back keys to navigate

2017-04-26 Thread Ivan Tham
Please ignore the previous patch with the wrong headers. --- config.def.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config.def.h b/config.def.h index dce76f8..e867ba3 100644 --- a/config.def.h +++ b/config.def.h @@ -115,7 +115,9 @@ static Key keys[] = { { MODKEY,

[hackers] [PATCH] Add Forward/Back keys to navigate

2017-04-26 Thread Ivan Tham
--- config.def.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config.def.h b/config.def.h index dce76f8..e867ba3 100644 --- a/config.def.h +++ b/config.def.h @@ -115,7 +115,9 @@ static Key keys[] = { { MODKEY,GDK_KEY_r, reload, { .b = 0 } }, {

[hackers] [dmenu][PATCH] Improve spacing in config.h

2016-07-26 Thread Ivan Tham
--- config.def.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config.def.h b/config.def.h index 1edb647..b53885b 100644 --- a/config.def.h +++ b/config.def.h @@ -8,10 +8,10 @@ static const char *fonts[] = { }; static const char *prompt = NULL; /* -p

[hackers] [st][PATCH] I don't like yellow, it arouses me too much

2016-01-05 Thread Ivan Tham
Let's put there the default foreground color. http://www.nickkolenda.com/wp-content/uploads/2015/10/color-arousal.png Thanks to voidead for the idea. --- config.def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index fd09d72..c11ed2f

[hackers] [st][PATCH] yellow italics everywhere is for colorblind people

2016-01-05 Thread Ivan Tham
Thanks to voidead: god of destroying "" --- config.def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index fd09d72..c11ed2f 100644 --- a/config.def.h +++ b/config.def.h @@ -127,7 +127,7 @@ static unsigned int mousebg = 0; * will reverse

[hackers] [PATCH] yellow italics everywhere is for colorblind people

2016-01-04 Thread Ivan Tham
Thanks to voidead: god of destroying faggot asscunts --- config.def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index fd09d72..1024766 100644 --- a/config.def.h +++ b/config.def.h @@ -127,7 +127,7 @@ static unsigned int mousebg = 0; *

[hackers] [PATCH] proxy-uri -> proxy-resolver for no_proxy; add #inc

2015-12-17 Thread Ivan Tham
--- surf.1 | 7 +++ surf.c | 17 - 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/surf.1 b/surf.1 index c1d339a..1715f93 100644 --- a/surf.1 +++ b/surf.1 @@ -283,6 +283,13 @@ string .TP .B http_proxy If this variable is set and not empty upon startup, surf

[hackers] [PATCH] proxy-uri -> proxy-resolver for no_proxy

2015-12-16 Thread Ivan Tham
--- surf.1 | 7 +++ surf.c | 15 ++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/surf.1 b/surf.1 index c1d339a..1715f93 100644 --- a/surf.1 +++ b/surf.1 @@ -283,6 +283,13 @@ string .TP .B http_proxy If this variable is set and not empty upon startup, surf

[hackers] [surf][PATCH] Fix title handling

2015-12-02 Thread Ivan Tham
1. file:/// stay the same when you navigate 2. Fix "http://~; to "file://~" in home dir 3. Expands "file://~" to "file://home/user" Thanks to quinq for fixing the issue #1 in commit 934705c in surf2. --- surf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/surf.c b/surf.c index

[hackers] [surf-webkit2][PATCH] Fix cookies wording

2015-12-01 Thread Ivan Tham
Signed-off-by: Christoph Lohmann <2...@r-36.net> --- config.def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index 1c18827..93a3d49 100644 --- a/config.def.h +++ b/config.def.h @@ -17,7 +17,7 @@ static gfloat zoomlevel = 1.0; /* Default

Re: [hackers] [st] startup options

2015-11-25 Thread Ivan Tham
I use st with the scrollback patch with mouse support. I hope that it can be without shift but I doesn't know how to do it. -- _ < Do what you like, like what you do. > - \ ^__^ \ (oo)\___

[hackers] [PATCH] Use right click as previous and enable scrolling to switch slides

2015-11-19 Thread Ivan Tham
--- config.def.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index 9aa6e08..0a56047 100644 --- a/config.def.h +++ b/config.def.h @@ -20,7 +20,9 @@ static const float usableheight = 0.75; static Mousekey mshortcuts[] = { /* button

[hackers] [PATCH] Fix cookies wording

2015-11-17 Thread Ivan Tham
--- config.def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index 1c18827..93a3d49 100644 --- a/config.def.h +++ b/config.def.h @@ -17,7 +17,7 @@ static gfloat zoomlevel = 1.0; /* Default zoom level */ /* Soup default features */ static