Re: [dev] less keys for w3m

2024-04-17 Thread Greg Minshall
Greg Reagle  wrote:

> This took me a long time to do.  I made any key that has a function in
> less that is also available in w3m have the same key in w3m (2nd
> paragraph), with a few exceptions, that are in my 1st paragraph.  I am
> posting this here for feedback, suggestions, improvements, etc.  And
> in case anyone wants to try it.

awesome -- thanks!



Re: [dev] reading an epub book with less: adventures in text processing

2024-03-09 Thread Greg Minshall
Greg,

thanks for this!

for some personal tastes/usage cases, this, using pandoc's `-t`
option, might be minor-ly simpler:

man --local-file --pager 'less -ir' \
<(pandoc --standalone -t man \
 2015.31233.Arab-Geographers-Knowledge-Of-Southern-India.epub) | 
less


and, this deserves to be somewhere like fortune: "I already know and
love less.".  :)  maybe "fortune-mod-fles-pleh"?  :)

cheers, Greg




Re: [dev] dev

2024-02-03 Thread Greg Minshall
:)



Re: [dev] [edit] Introducing edit, a simple text editor

2023-10-23 Thread Greg Minshall
+1 on undo.  (but, i'm an emacs user, not likely to ever be part of your
customer base... :)



Re: [dev] Suckless DNS server

2023-07-19 Thread Greg Minshall
> I meant `ntohs`... and this further proves your point.
> Thank you for your insight & for the article.

+1 !



Re: [dev] Simpler WiFi alternatives

2023-05-21 Thread Greg Minshall
40+ years ago (working on the Illiac-IV!), i blew up at a co-worker,
accused him of being a thief, etc.  i was livid.

my boss, whom i respected a lot, called me in and basically said, "You
don't have to like so-and-so.  But, here at work, I expect you to treat
him with respect."

i changed my behavior.  and, that advice of my former boss has always
stayed with me, has always seemed very valuable.



Re: [dev] a terminal transformer, analogous to a unix filter

2023-01-07 Thread Greg Minshall
[other] Greg,

sorry, this is maybe too philosophical.  but, reading your thoughts,
what strikes me is, from the 1980s/90s (by [another] Greg[or] Kiczales)
a model of things (software modules, say, or programs, or computing
systems), where each "thing" has two sorts of interfaces: a *using*
interface and a *managing* interface.  envisioned as two sides of "the
box" holding the thing:

  using
|
V
/***/
/* */
managing -> /* */
/* */
/***/

then, what i vaguely see from your thought is that the "using" interface
for your terminal translator is transparent, as you describe.  but,
there is *some* path that accesses the "managing" interface, that either
sets parameters controlling the behavior (what, iirc, Kiczales was
thinking), or causes some momentary, transient, action by the thing
itself (terminal translator) or ?maybe? the emulator on top of which,
below which, the terminal is running.

anyway, those are the neurons that fired.  good luck figuring this out!

cheers, [third time's the charm] Greg



Re: [dev] json2tsv 1.0 release - a tool to convert JSON to TSV

2022-09-02 Thread Greg Minshall
Hiltjo,

looks nice.

here's my mini-effort; the jsonifycsv bit.

https://sr.ht/~minshall/csvedepli/


at the least, i should cross-advertise.

cheers, Greg



Re: [dev] Replace ranlib(1) calls?

2022-07-24 Thread Greg Minshall
Tom,

> The main "problem" here is that ranlib(1) isn't a standardized tool, so there
> is no guarantee on what its behaviour will be or whether it exists at all.
> We assume it's there because it always has been or GNU and LLVM include it.

an option might be to wait until the bug report comes in "Hey, ranlib
isn't available on my system!!!  How do i build ...?".

cheers, Greg



Re: [dev][st] Solution: UTF-8 needs IBus!

2022-04-28 Thread Greg Minshall
Robert,

i wonder if this SO exchange might be familiar:

https://unix.stackexchange.com/questions/368803/bash-seems-to-be-in-special-mode


i just ran into something similar, where typing into the shell gave odd
characters (or, the "(arg: 1)" prompt).  in this case, for *me*, (*)

bash apollo2 (master): {35664} bind -v | grep convert-meta
set convert-meta on

was an indicator of what was wrong.  in my ~/.inputrc i had

set convert-meta on

(for some reason lost in history.)  taking this line out fixed *my*
problem with (newly invoked) shells.

for completeness, i *also* had a problem with emacs, which seems to be
because in my .bashrc, i had

export XMODIFIERS=@im=ibus


changing that to

export XMODIFIERS=@im=none

made emacs happy.

cheers, Greg

(*) causing X11's "compose feature" (which, through keyd(8), is how i'm
generating these non-ASCII characters) to send characters like ó to,
e.g., cat(1), worked.  my problems seemed to be just with the shell and
emacs.



Re: [dev][st] Solution: UTF-8 needs IBus!

2022-04-27 Thread Greg Minshall
Robert,

i know you found a way of fixing your problem.  but, actually, when you
say "UTF-8 doesn't work", what does that mean?  what symptoms were you
seeing?  (i don't think i saw it described in the e-mail exchanges.)

cheers, Greg



Re: [dev] dwm oddity

2022-04-06 Thread Greg Minshall
Greg and N, thanks.  in fact, adding focusonclick, i no longer see the
problem (well, so far, but long enough to make me think it is resolved).
cheers, Greg



Re: [dev] sam/vis command language: how to go to line and column

2022-04-05 Thread Greg Minshall
Quentin,

> Command: 9#4
> This goes to column 5 of line 10, in vis.

and, for some reason, "normal" people think "we" are strange...  :)



[dev] dwm oddity

2022-04-03 Thread Greg Minshall
hi.  i'm using dwm v6.2 under Arch linux.  my own source build.  i'm
using the "taggrid" patch.  my laptop has a touch pad.

when i am in monocle mode (which i mostly am), every now and then when i
type a key, i end up in a situation where the application hasn't changed
(i.e., is what is showing on the screen), but the keyboard focus (and
the "title" on the bar, next to the tags) changes to one of the
non-visible apps.  likely, the heel of my palm is making some (light?)
contact with the touch pad.

i'm wondering if anyone has seen this, or has any thoughts?

cheers, Greg



Re: [dev] Is there a text editor following the UNIX philosophy?

2022-02-16 Thread Greg Minshall
Ismael,

> A simple way to deal with the problem is to make an extra commit
> (outside the main branch) per release to hold these files and tag it
> as the release, that makes it trivial for websites like github to make
> proper release tarballs.

ah.  thanks!

cheers, Greg



Re: [dev] Is there a text editor following the UNIX philosophy?

2022-02-15 Thread Greg Minshall
Ismael,

> These errors mean the named auxiliary build scripts (needed for
> portability) are not present and must be provided...

thank you for your explanation.  i have wondered.

> Technically, it's wrong to ask users to run autoreconf, projects must
> provide release tarballs with the pregenerated build system at
> releases, this is not just a convenience, first because that step is
> not repeatable and there's no way to fix it except by using the exact
> same autoconf environment, and because other actions might be part of
> the release process which make a snapshot different from a release
> tarball (e.g. bundling submodules, automated editing of some files to
> match the release, etc.).

but, when "users" (such as many of us, but now a growing number of
others) pick up a "release" via git, my sense is that the authors of the
package have no (convenient?) way of providing the auxiliary scripts.
so, the "user" must run autoreconf.  is that still true?  or, is there a
(convenient) way package authors can allow a simple "./configure && make
&& make install" to work?

cheers, Greg



Re: [dev] Is there a text editor following the UNIX philosophy?

2022-02-13 Thread Greg Minshall
Michael,

> You might like se[1]. It's a screen-oriented version of ed.  It can be
> helpful for certain editing tasks where visual feedback is wanted.
> ...
> 1: https://github.com/screen-editor/se/

very nice.  thanks for the pointer!

cheers, Greg



Re: [dev] cat -v

2022-01-30 Thread Greg Minshall
i think it was a Rob Pike paper, maybe Usenix, probably in the 1990s.
the idea, iirc, is that you can always pipe the output of cat(1) into
od(1), or into any other program you wanted, so keep cat simple.  good
paper (but, sometimes i do `cat -v`).



Re: [dev] Article in line with suckless.org

2021-08-08 Thread Greg Minshall
Martin,

there is much wisdom in what you write.  and, the text you cited (i
summarize as "write once, throw it away; write it again another day") is
also very powerful.  the problem, ultimately, is understanding what the
problem to be solved actually is, wrestling with that problem until you
really understand it.  (well, "imho". :)

> I've certainly noticed in the software I write that complexity tends to
> be a graph roughly like:
> 
>complexity
>  │
>  │---
>  │   /   \--
>  │/-/   \--
>  └─ time
> 
> 
> As my understanding of the problem and various solutions increases, I
> can reduce complexity.
> 
> The more complex solution(s) however, *do* usually work and are "good
> enough", in a way.

yeah.  there's a third dimension, something like "good enough (in a
way)".  i find that my software tends to get to somewhere with high
complexity (maybe not the highest, but, still), with a reasonable value
on the "good enough" axis.  then, the urgencies of time, other projects,
[boredom?], etc., tend to leave it there.  (maybe the "suckmore"
philosophy.)

one other thing i've noticed in my own large programs, fwiw, is a
tendency for most of the complexity (and so most of the bugs) to
concentrate in one small portion of the code (one or two "pages", back
in the days of using printers).

anyway, thanks for your e-mail.

cheers, Greg



Re: [dev] Why not use the -exec feature of find?

2021-07-02 Thread Greg Minshall
caóc,

> Yes, sir, and I think it was GNU who came up with this (see getopt(3) of
> glibc).  Guideline 10 of the Utility Conventions[0] states that "--"
> marks the end of options.
> 
> [0]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html

yeah, i think gnu came up with, or took into the fold, getopt_long()
(and _only(), i guess).  but, the "standardization" of using "--" for
"long options" may have pre-dated, or at least been contemporaneous
with, a more formal GNU.  i remember, anyway, at Berkeley, being
introduced to that idea in, maybe, the early 1980s.  (obviously, i'm not
the expert!)

cheers, Greg



Re: [dev] Why not use the -exec feature of find?

2021-06-30 Thread Greg Minshall
Cág,

> Slightly off-topic and moderately unpopular: find(1) doesn't quite well
> fit into the Unix userland.  It starts with the syntax: multiletter
> options (POSIX calls them operands though), the $program $option(s)
> $file(s) order (compare the find's "do where what" vs natural -- like
> sed's or grep's -- "do what where"), and the overall purpose of the
> utility: it should construct a list of files/directories and match the
> given pattern.

fwiw, the standards such as long options starting with "--", etc., came
out many years after 'find' (or, 'dd', for that matter) were released.

cheers, Greg



Re: [dev] Update outdated suckless website

2021-06-11 Thread Greg Minshall
i agree.  just run windows.



Re: [dev] Ada not Rust

2021-05-12 Thread Greg Minshall
Laslo,

thank you very much.

> I'm just glad that I, as a numerical mathematician, don't have to use
> MATLAB anymore. I initiated and finalized that the current lecture on
> numerical mathematics here in Cologne, which I co-supervise, is using
> Julia for the first time (instead of MATLAB), and I'm really happy
> about that.

congratulations!  :)

cheers, Greg



Re: [dev] Ada not Rust

2021-05-11 Thread Greg Minshall
Anders Damsgaard,

> However, I would *never* consider Julia a viable alternative to C/FORTRAN
> tasks, including numerical simulations and massively parallel deployment
> on HPC systems.

i'm ignorant, but curious.  a friend who does high performance computing
is a fan of Julia, and in the past pointed me at

https://www.nextplatform.com/2017/11/28/julia-language-delivers-petascale-hpc-performance/

i'm not a believer in miracles, but the performance here seems fairly
impressive.  does this contradict your pessimistic assessment of Julia
(without saying which view is correct)?  is it maybe because of
specialized features of Julia (i can imagine Julia's support for SIMD
operations could help a lot with this sort of computing)?  or...?

obviously, incompatibility between versions, slow garbage collection,
etc., which you mention below, are not good signs.

cheers, Greg

> While promising on paper, the reality is that the language is
> immature which creates issues with code compability between versions.
> One example is that they flip-flop between variable scope in global
> space, effectively breaking most scripts without warning.  Also, the
> julia+python+blas dependencies of installed packages and computational
> overhead quickly become very significant.  Furthermore, the garbage
> collection is poor and leads to orders-of-magnitude increase in memory
> footprint over days of running an iterative simulation.



Re: [dev] Ada not Rust

2021-04-22 Thread Greg Minshall
fwiw, i think Ada sat (sits) on the "Pascal" side of the "C | Pascal"
divide.

that probably explains a lot of the subsequent history of who used it,
who didn't, etc.



Re: [dev] pids for surf, webkit instances (+ lsw.c bug)

2017-09-07 Thread Greg Minshall
just for completeness, below is a bash script that uses lsw recursively
to walk the tree.  it's a bit overkill (feeling guilty for having missed
the hackathon?).  "once a Fortran programmer..."

#!/usr/bin/env bash

# this script walks the tree of known X windows on the system and
# prints out those that have PIDs (process ids; see ps(1)) associated
# with them.

# usage: "$0", or "$0 windowid ..."; in the former, the windows are
# traversed from the root window; in the latter, from the designated
# window id(s).

# the output is: pid windowid name [secondary]\n...

# program we use to list windowids
LSW=lsw

# recursive part of getwinids
function rgetwinids() {
local windowid=$1 a i
echo ${windowid}
a=$(${LSW} $windowid | awk '{print $1}')
for i in $a; do
rgetwinids $i
done
}

# output the windowids that seem to be on the system.
function getwinids() {
local arg
if [[ $# -eq 0 ]] ; then
echo $(rgetwinids);
else
for arg in $*; do echo $(rgetwinids ${arg}); done
fi
}

# do some processing on grep output
function gnhelper() {
grep -w "$1" |
head -1 |
tr -d '\n' |
awk '{$1=""; $2=""; print; exit}' |
sed 's/^[[:blank:]]*"//' |
sed 's/"$//';
 }

# now, get the name (and maybe surf(1) uri) of the window
function getname() {
local winid=$1 wim su
wim=$(xprop -id ${winid} | gnhelper ${pname});
if [[ ${args} == 0 ]]; then
   echo ${wim}
else
su=$(xprop -id ${winid} | gnhelper ${sname});
if [[ -z $su ]]; then
echo ${wim};
else
echo "${wim} [$su]"
fi
fi
}


# how many digits might be in a PID?  will give one greater (newline
# counted by wc(1))
function pidndigits() {
local i
echo $(
(for i in $(ps haxo pid); do
 echo $i |
 wc |
 awk '{print $3}';
 done) |
sort -nu |
tail -1
)
}

# get the process id of the process that "owns" a window
function getpid() {
xprop -id $1 | grep PID | awk '{print $3}';
}

# make sure ${LSW} is installed
function prereq() {
a=$(${LSW} $windowid);
if [[ $? -ge 126 ]] ; then
printf "required program ${LSW} not found; see 
https://suckless.org\n(or install package suckless-tools)\n" > /dev/stderr
exit 1;
fi
}


function help() {
echo "\

$(basename $0) lists all the windows open on the system, along with
their process IDs (pids), optionally ([--winid|-w]) the window ids, as
well as the name property of each window (\"WM_ICON_NAME\" is the
default property here), optionally ([-s]) a secondary property of the
window (\"_SURF_URI\" is the default) is listed after the primary
(enclosed in square brackets).

the width of the (combined) primary and secondary properties can be
set with [--cmdn|-c]; the width of the PID field set with [--pidn|-p].
"
echo
usage
}

function usage() {
if [[ ! -z $1 ]] ; then echo "invalid argument \"$1\"" > /dev/stderr; fi
echo "usage: $(basename $0) 
[-s]
[--winid|-w]
[--help|-h]
[[--cmdn|-c] NUM (${DEF_argnc})]
[[--pidn|-p] NUM (${DEF_argnp})]
[--pname STRING (\"${DEF_pname}\")]
[--sname STRING (\"${DEF_sname}\")]" > /dev/stderr
exit 1;
}


function parseargs() {
local optlist="-l cmdn:,help,pidn:,pname:,sname:,winid -o c:hp:sw" optresult

# 
http://bahmanm.com/blogs/command-line-options-how-to-parse-in-bash-using-getopt
# of help here
DEF_pname=WM_ICON_NAME
DEF_sname=_SURF_URI
DEF_argnc=200   # digits reserved for name field
DEF_argnp=$(pidndigits) # how many digits should we reserve for pid?
DEF_args=0
DEF_argwinid=0

cn=${DEF_argnc}
pn=${DEF_argnp}
argwinid=${DEF_pwinid}
pname=${DEF_pname}
sname=${DEF_sname}
args=${DEF_args}
optresult=$(getopt ${optlist} -- "$@")
if [[ $? != 0 ]]; then usage; fi
eval set -- ${optresult}
while true ; do
case "$1" in
-c|--cmdn) cn=$2; shift 2 ;;
-h|--help) help; shift ;;
-p|--pidn) pn=$2; shift 2 ;;
-s) args=1; shift ;;
-w|--winid) argwinid=true ; shift ;;
--pname) pname=$2; shift 2 ;;
--sname) sname=$2; shift 2 ;;
--) shift; desired=$*; break ;;
*) usage $1; ;; # NOTREACHED
esac
done
}

function main() {
local winid a b winidpart
parseargs $*
prereq
for winid in $(getwinids ${desired} | tr '[[:blank:]]' '\n' | sort -u | tr 
'\n' " "); do
a=$(getpid ${winid})
if [[ ! -z $a ]]; then
b=$(getname ${winid})  # get name string for this window
if [[ ${argwinid} ]]; then
winidpart=" ${winid} ";
else
winidpart=" ";
fi
printf "%${pn}d%s%-.${cn}s\n" $a "${winidpart}" "$b"
fi
done | sort -n -k1
}

main $*



Re: [dev] pids for surf, webkit instances (+ lsw.c bug)

2017-09-06 Thread Greg Minshall
s...@mailless.org wrote:

> or use lsw for a specific window:
> 
> lsw | grep "some webpage title" | cut -f1 -d' ' | xargs xprop -id | grep PID

ah, thanks.

btw, i ran into a bug in, i assume, lsw.

bash minshall-apollo: {1339} lsw 0x164
Segmentation fault (core dumped)

at the time, xwininfo around this window id was

bash minshall-apollo: {1350} xwininfo -root -children -tree | grep --text 
0x16
0x169 (has no name): ()  1x1+-1+-1  +-1+-1
0x161 "darktable": ("darktable" "Darktable")  10x10+10+10  +10+10
0x163 "darktable": ("darktable" "Darktable")  1918x1061+-3840+17  +-3840+17
   0x164 (has no name): ()  1x1+-1+-1  +-3840+17


anyway, here's a patch for lsw that seems to keep it from crashing.
(but, maybe one would want to report such a window somehow?)

diff --git a/lsw.c b/lsw.c
index fc40fef..b3f473b 100644
--- a/lsw.c
+++ b/lsw.c
@@ -36,7 +36,8 @@ lsw(Window win) {
Window *wins, *w, dw;
XWindowAttributes wa;
 
-   if(!XQueryTree(dpy, win, , , , ))
+   if((!XQueryTree(dpy, win, , , , )) ||
+   (n == 0))
return;
for(w = [n-1]; w >= [0]; w--)
if(XGetWindowAttributes(dpy, *w, )

(please let me know if some other way of contributing patches is more
happiness-inducing.)

cheers, Greg



[dev] pids for surf, webkit instances

2017-09-05 Thread Greg Minshall
hello.

every now and then some browser instance goes resource wild.  top(1) or
ps(1) show the PID consuming all the resources (normally a webkit
instance), but i haven't figured out a way to go from that to knowing
which instance to kill off, given that most often i start surf from
dwm(1), which starts surf on a generic search engine page, and then i go
from there.  is there an obvious method for correlating a PID to an
actual instance?

if not, two questions/suggestions:

1.  would it make sense to have some key combination in surf(1) that
would show *its* PID (in the status bar or somewhere)?  (and, possibly
less palatable, maybe a key for tabbed(1) to list its cilents along with
their PIDs?)

2.  i'm using the new webkit2gtk surf, and i notice that the spawned
webkit processes don't have the surf instance as their parent; e.g., "ps
axo pid,ppid,command" shows:

32676 32672 tabbed -c -r2 surf -e x -z1.3 -a @a duckduckgo.com
32677 32676 surf -e 46137347 -z1.3 -a @a duckduckgo.com
32688 1 /usr/local/libexec/webkit2gtk-4.0/WebKitNetworkProcess 18
32691 1 /usr/local/libexec/webkit2gtk-4.0/WebKitWebProcess 21

rather, they are children of process 1.  does anyone know why that is?

cheers, Greg Minshall



[dev] surf webkit 2 : zooming with C-+

2017-08-08 Thread Greg Minshall
hi.  i had to make the below change to allow C-+ (which, on my
keyboard, at least, requires a shift) to zoom.  (seems like this
*shouldn't* be needed, but...)

cheers, Greg

diff --git a/config.def.h b/config.def.h
index fec6916..d0c6b7c 100644
--- a/config.def.h
+++ b/config.def.h
@@ -133,6 +133,7 @@ static Key keys[] = {
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_q,  zoom,   { .i = 0  } },
{ MODKEY,GDK_KEY_minus,  zoom,   { .i = -1 } },
{ MODKEY,GDK_KEY_plus,   zoom,   { .i = +1 } },
+   { MODKEY|GDK_SHIFT_MASK, GDK_KEY_plus,   zoom,   { .i = +1 } },
 
 { MODKEY,   GDK_KEY_y,   clipboard,  { .i = 0+2 } },
 { MODKEY,   GDK_KEY_p,   clipboard,  { .i = 1+2 } },




[dev] surf -- C-y to clipboard? (patch)

2017-05-01 Thread Greg Minshall
hi.  i tend to live in a clipboard'y world (emacs 25, etc.).  it's nice
for me, but i have the problem that surf's C-y copies to the primary
selection rather than the clipboard and so i always have to stand on my
head to get it in the clipboard.  (i don't use a mouse for pasting.)

here is a patch that makes the argument to the (oddly, presumably
historically, misnamed) clipboard() routine be an integer, rather than a
boolean, so one can specify sources of C-p and sinks of C-y to be the
primary selection or clipboard.  it seems to me to be backwards
compatible, since i guess "{.b = TRUE}" == "{.i = 1}", etc.

note the XXX: one odd thing i realized was that to *me* it felt funny
for C-y to put the URI in the clipboard with*out* also putting it in the
primary selection.  so, in the case where it puts it in the clipboard, i
decided to *also* put it in the primary selection.  (this also means
that for people used to C-y to be in the primary, it still is; but ...)

if it's the greatest thing since sliced bread and someone put it in the
source tree, great!

cheers, Greg

diff --git a/surf.c b/surf.c
index d75e589..64e6789 100644
--- a/surf.c
+++ b/surf.c
@@ -513,20 +513,42 @@ runscript(WebKitWebFrame *frame)
}
 }
 
+/*
+ * arg is copy/paste/primary/clipboard
+ * paste: 0 ==> URI --> primary [copy]
+ * paste: 1 ==> primary --> URI [paste]
+ * paste: 2 ==> URI --> clipboard and primary [copy]
+ * paste: 3 ==> clipboard --> URI [paste]
+ */
 void
 clipboard(Client *c, const Arg *arg)
 {
-   gboolean paste = *(gboolean *)arg;
-
-   if (paste) {
-   gtk_clipboard_request_text(gtk_clipboard_get(
-  GDK_SELECTION_PRIMARY),
+switch (arg->i) {
+case 2:
+/* XXX for paste == 2, it seems weird to have s.th. in
+ * clipboard that was never in the primary.  so, we put in
+ * both.  thus, people expecting it in primary will see it.
+ * not clear this is the right choice.
+ */
+   
gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD),
+   c->linkhover ? c->linkhover : geturi(c), -1);
+/* fall through to set primary */
+case 0:
+   gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY),
+   c->linkhover ? c->linkhover : geturi(c), -1);
+break;
+case 1:
+   
gtk_clipboard_request_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY),
   pasteuri, c);
-   } else {
-   gtk_clipboard_set_text(gtk_clipboard_get(
-  GDK_SELECTION_PRIMARY), c->linkhover
-  ? c->linkhover : geturi(c), -1);
-   }
+break;
+case 3:
+   
gtk_clipboard_request_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD),
+  pasteuri, c);
+break;
+default:
+g_warning("%s:%d: clipboard called with arg outside {0,1,2,3}, i.e., 
%d.  error in config.h?", __FILE__, __LINE__, arg->i);
+break;
+}
 }
 
 char *



[dev] a few questions

2017-04-13 Thread Greg Minshall
hi, all.  thanks again for dwm, surf, both of which i use a lot.

i had a few newbie questions.

1.  when people make changes to their, e.g., config.def.h, how do they
deal with that w.r.t. git (branches, etc.)?  i'd like to be able to use
git to track, but integrate my changes (without the danger of
accidentally trying to push my changes back to the repository).  (as a
former sccs/rcs user, i'm still a bit git-naive, especially
w.r.t. branches.)

2.  why do at least the dwm and surf makefiles *not* list config.def.h
as a dependency for config.h (so that a change in the former causes the
latter to be re-built)?  as it seems to me the obvious thing to do, and
yet hasn't been done, i'm guessing there's some philosophy there.

3.  i recently lost my ability to run X on my laptop, so lived with tmux
(which i heard about here, and very much like -- thanks!).  this
experience emphasized that often i'd rather have a two-key (say)
sequence, ^B-j, rather than the "chord" Alt-j, to effect an action.  of
course, this functionality requires keymaps, etc.  is there any thought
of doing this for dwm?  or, is there some external program that would
somehow handle this for you?

cheers, Greg



Re: [dev] git of patches, etc.?

2017-03-21 Thread Greg Minshall
Alexander Krotov  wrote:

> suckless wiki is a git repository

> Also https://github.com/jceb/dwm-clean-patches

cool -- thanks!



[dev] git of patches, etc.?

2017-03-20 Thread Greg Minshall
hi.  sorry if this is a FAQ.  (though i've been following the list a
while, so, if so, it isn't *that* F of AQ.)

i would find it convenient if all the patches for, e.g., dwm, and/or
files, for surf, say, were in a git repository (either for dwm,
respectively surf, says).

would that make sense?  or, are there good, countervailing arguments?

cheers, Greg



Re: [dev] surf crash

2017-01-17 Thread Greg Minshall
Hadrien,

> Gentoo is indeed your best bet. Portage is pretty complex, though. Then you
> have the old school distros like Crux/Sourcemage, but they're less active.
> Really, USE flags are amazing.

thanks.  i'll give it a try.

cheers, Greg



Re: [dev] surf crash

2017-01-17 Thread Greg Minshall
Cág,

> Okay, try re-installing webkit, both -dev and
> the package. I'm not really sure what's the
> problem.

no change, sigh.  i guess i'll just leave this "open" for the time
being.

> By the way, if you are an ex-BSD user, you may
> want to try Alpine[1]. Stripped; elegant package
> management; no systemd, dbus, GNU etc.; you
> can also pull the ports, but packages are
> usually compiled the way they should be. And
> the documentation is pretty good.

thanks for the pointer.  it would be nice running a system that i've
built from the sources.  though i'm not sure Alpine is really designed
with that in mind; maybe gentoo is reasonable (sort of "digging" for
suggestions here)?

cheers, Greg



Re: [dev] surf crash

2017-01-16 Thread Greg Minshall
hi, Hiro,

sorry for some cluelessness on my part (i'm really an ex-BSD guy, so
part of my problem is not having any clue about linux; also, i'm a
gray-haired guy, so even multi-threading is sort of "after my time").

if you've patience, a few follow up questions:

> reinstall your system (yes, everything)

is this a reinstall from source, or from my original (lubuntu)
distribution?  (but, see the last point below.)

> and disable all this bullshit crap like dbus,

i guess the answer to "how" here depends on whether i'm installing from
source.  but, a pointer to "how" would be appreciated.  (it's all in the
learning.)

> keep the debug symbols enabled

it would be great to have all debug symbols, for all installed
libraries, plus the kernel.  again, the 'how' -- other than installing
"-dbg" every time -- to do this...

> and make sure gdb follows the right thread that actually
> segfaults.

hmm, seems like a postgraduate thing -- maybe i'll leave this till the
time i've fulfilled the (above) requirements?

> if you can't do that and want to keep on using a horrible linux
> distribution that enables all kinds of useless features like dbus by
> default, then use a browser that is supported by your distribution.

so, i'm running lubuntu because it seemed to me the most "mainstream" +
"stripped down" distribution i'd run into.  i'm running an Entroware
"Apollo" laptop, so need things like wifi, suspend/resume.  if you've a
suggestion for an alternate distribution (or two, or three), i'd love to
hear.

cheers, Greg



Re: [dev] surf crash

2017-01-16 Thread Greg Minshall
Cág,

> Try re-installing libjavascriptcoregtk-1.0-0.

okay, did that, also installed the -dbg version to get symbols.

> If that still doesn't work, bewray your
> config.mk to us.

that's next.  below that is a revised stack trace with a few more
filled-in entries.  (apologies for the remaining unknowns.)

cheers, Greg Minshall

# surf version
VERSION = 0.7

# Customize below to fit your system

# paths
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man

X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib

GTKINC = `pkg-config --cflags gtk+-2.0 webkit-1.0`
GTKLIB = `pkg-config --libs gtk+-2.0 webkit-1.0`

# includes and libs
INCS = -I. -I/usr/include -I${X11INC} ${GTKINC}
LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 ${GTKLIB} -lgthread-2.0

# flags
CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE
CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS} -g
LDFLAGS = -g ${LIBS}

# Solaris
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
#LDFLAGS = ${LIBS}

# compiler and linker
CC = cc


(gdb) run bit.ly/MoesE-Books
Starting program: /home/minshall/src/import/suckless/surf/surf-0.7/surf 
bit.ly/MoesE-Books
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe4812700 (LWP 6172)]
[New Thread 0x7fffa400f700 (LWP 6173)]
[New Thread 0x7fffa33b5700 (LWP 6174)]
[New Thread 0x7fffa2bb4700 (LWP 6175)]
[New Thread 0x7fffa1d49700 (LWP 6176)]
[New Thread 0x7fff9218f700 (LWP 6178)]
[New Thread 0x7fff9198e700 (LWP 6179)]
[New Thread 0x7fff9118d700 (LWP 6180)]
[New Thread 0x7fff9098c700 (LWP 6181)]
[New Thread 0x7fff87fff700 (LWP 6182)]
[New Thread 0x7fff877fe700 (LWP 6183)]
[Thread 0x7fff9218f700 (LWP 6178) exited]
[New Thread 0x7fff9218f700 (LWP 6190)]
[New Thread 0x7fff867d4700 (LWP 6191)]
[New Thread 0x7fff85fd3700 (LWP 6192)]
[New Thread 0x7fff857d2700 (LWP 6193)]
[New Thread 0x7fff84fd1700 (LWP 6194)]
[Thread 0x7fff85fd3700 (LWP 6192) exited]

Thread 1 "surf" received signal SIGSEGV, Segmentation fault.
0x73e15c16 in JSC::JSValue::isString (this=0x7fffc9d0) at 
../Source/JavaScriptCore/runtime/JSCJSValueInlines.h:528
528 ../Source/JavaScriptCore/runtime/JSCJSValueInlines.h: No such file or 
directory.
(gdb) where
#0  0x73e15c16 in JSC::JSValue::isString (this=0x7fffc9d0) at 
../Source/JavaScriptCore/runtime/JSCJSValueInlines.h:528
#1  JSC::getByVal (exec=exec@entry=0x7fff86ffd0e8, baseValue=..., 
subscript=..., returnAddress=...) at 
../Source/JavaScriptCore/jit/JITOperations.cpp:1366
#2  0x73e16563 in JSC::operationGetByValDefault (exec=0x7fff86ffd0e8, 
encodedBase=140735610872176, encodedSubscript=140733193388204)
at ../Source/JavaScriptCore/jit/JITOperations.cpp:1441
#3  0x7fffa404aca9 in ?? ()
#4  0x7fffcb60 in ?? ()
#5  0x77e71000 in ?? ()
#6  0x7fff63f2ec88 in ?? ()
#7  0x7fffcbd0 in ?? ()
#8  0x7fff86ffdff8 in ?? ()
#9  0x7fffcbe0 in ?? ()
#10 0x7fffcb60 in ?? ()
#11 0x73dffc03 in JSC::JITCode::execute (this=, 
vm=0x7fff900c33b0, protoCallFrame=0x7fffa4064867, topOfStack=0x1) at 
../Source/JavaScriptCore/jit/JITCode.cpp:48
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) 

Re: [dev] surf crash

2017-01-15 Thread Greg Minshall
Hiro, thanks for the reply.

> try compiling your system without dbus.
> then, add a gdb backtrace.

i'm not sure how to interpret the first line.  if it means compile Linux
without dbus, i'm afraid i don't know how to do that.  (but, with hints
and some time, could possibly figure it out; i'm running lubuntu.)

if the first line means surf(1), i don't (grep(1) doesn't) see any
references to dbus in the sources.

for the second line, i downloaded the current (0.7) release of surf,
compiled with -g.  below is the output (*does* look a bit like someone
stomped on the stack).

cheers, Greg

bash minshall-apollo: {1068} gdb surf
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from surf...done.
(gdb) run bit.ly/MoesE-Books
Starting program: /home/minshall/src/import/suckless/surf/surf-0.7/surf 
bit.ly/MoesE-Books
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe4812700 (LWP 31539)]
[New Thread 0x7fffa400f700 (LWP 31540)]
[New Thread 0x7fffa33b5700 (LWP 31541)]
[New Thread 0x7fffa2bb4700 (LWP 31542)]
[New Thread 0x7fffa1d49700 (LWP 31543)]
[New Thread 0x7fff9218f700 (LWP 31544)]
[New Thread 0x7fff9198e700 (LWP 31545)]
[New Thread 0x7fff9118d700 (LWP 31546)]
[New Thread 0x7fff9098c700 (LWP 31547)]
[New Thread 0x7fff87fff700 (LWP 31548)]
[New Thread 0x7fff877fe700 (LWP 31549)]
[Thread 0x7fff9218f700 (LWP 31544) exited]
[New Thread 0x7fff9218f700 (LWP 31551)]
[New Thread 0x7fff867d4700 (LWP 31552)]
[New Thread 0x7fff85fd3700 (LWP 31553)]
[New Thread 0x7fff857d2700 (LWP 31554)]
[New Thread 0x7fff63fff700 (LWP 31555)]
[New Thread 0x7fff637fe700 (LWP 31556)]
[New Thread 0x7fff62ffd700 (LWP 31557)]
[New Thread 0x7fff627fc700 (LWP 31558)]

Thread 1 "surf" received signal SIGSEGV, Segmentation fault.
0x73e15c16 in ?? () from 
/usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
(gdb) where
#0  0x73e15c16 in ?? () from 
/usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
#1  0x73e16563 in ?? () from 
/usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
#2  0x7fffa404abe9 in ?? ()
#3  0x7fffce70 in ?? ()
#4  0x77e71000 in ?? ()
#5  0x7fff8496a728 in ?? ()
#6  0x7fffcee0 in ?? ()
#7  0x7fff86ffdff8 in ?? ()
#8  0x7fffcef0 in ?? ()
#9  0x7fffce70 in ?? ()
#10 0x73dffc03 in JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*, 
JSC::Register*) () from /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) 



[dev] surf crash

2017-01-15 Thread Greg Minshall
hi.  trying

: surf bit.ly/MoesE-Books

gives surf

: surf-0.7, ©2009-2015 surf engineers, see LICENSE for details

a seg fault on my linux machine

: Linux minshall-apollo.minshall.org 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 
23:50:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

the output is below.

cheers, Greg Minshall

bash minshall-apollo: {998} surf bit.ly/MoesE-Books

** (surf:19102): WARNING **: Error retrieving accessibility bus address: 
org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not 
provided by any .service files

(surf:19102): Gdk-CRITICAL **: gdk_window_set_events: assertion 'GDK_IS_WINDOW 
(window)' failed

(surf:19102): Gdk-CRITICAL **: gdk_window_get_screen: assertion 'GDK_IS_WINDOW 
(window)' failed

(surf:19102): Gdk-CRITICAL **: gdk_screen_get_resolution: assertion 
'GDK_IS_SCREEN (screen)' failed
Segmentation fault (core dumped)
bash minshall-apollo: {999} 



Re: [dev] surf: connection progress

2017-01-06 Thread Greg Minshall
Joshua, Carlos,

thanks very much.

> If you hover your mouse on a link, it sets the window title to the link
> target. If you use dwm it shows right on the top of your screen.

ah.  make sense.  otoh, i use ratpoison, which doesn't typically show
the window title.

> You can look for patches adding functionality on 
> 

yes, i had looked in .../patches.  i didn't notice any that give connection
status.  was there one?

thanks again, cheers, Greg



[dev] surf: connection progress

2017-01-06 Thread Greg Minshall
hi.  i'm new to surf, i like it, but i'm not yet committed.  (i still
bounce back and forth between surf and firefox.)

one thing i miss a lot is connection progress when opening a URL.  it
would be nice to see DNS lookup progress ("looking up foo.com"), and TCP
connection progress ("connecting to foo.com/10.0.0.1"; "connected to
foo.com/10.0.0.1").

it would also be nice to show the URL as a pop-up (whatever) when the
mouse hovers over an active link.  (i like this in general, but it can
be useful for avoiding clicking on phishing links.)

i looked, inexpertly, but some sort of add-on to allow this (these)
didn't pop out at me.  did i miss something?  if not, how hard would it
be to add?

cheers, Greg Minshall

ps -- if it matters, i'm running on Lubuntu.