Re: [dev] Whether a css selector applies to given html surf code

2021-10-25 Thread NRK
On Mon, Oct 25, 2021 at 08:36:31PM +0200, Sagar Acharya wrote:
> I'm making this software called kamitkami. It's a python script which takes 2 
> inputs foo.html and bar.css and outputs a css file named bar_foo.css which 
> contains only the css which applies to the particular html page . This will 
> make css extremely minimal and page loading faster.

Wouldn't it make more sense to just inline the css into the html
instead? I think Dylan was doing that for K1SS.
https://archive.md/dFqxv

- NRK



[dev] Whether a css selector applies to given html surf code

2021-10-25 Thread Sagar Acharya
Hello,

I'm making this software called kamitkami. It's a python script which takes 2 
inputs foo.html and bar.css and outputs a css file named bar_foo.css which 
contains only the css which applies to the particular html page . This will 
make css extremely minimal and page loading faster.

This code is incomplete yet and I need someone help from surf developers. I 
have the css selectors in a python list, corresponding blocks in another list. 
I also have the html as a string. I think surf must detect whether a particular 
css selector applies to an html string or not. If someone can help me on how to 
do it (what code applies?), or contribute to kamitkami on the link below, I'd 
be grateful.

I'm thinking along the lines of submitting list and html as input to some 
subpart of compiled surf code with os module of python and getting back a list 
of only css selector which applies.
Thanking you
Sagar Acharya
https://notabug.org/sagaracharya/kamitka 
mi

P.S. Notabug is facing DoS attacks. You may have to check after some time if it 
doesn't show up.



Re: [dev] surf ephemeral not switching(?)

2021-10-25 Thread Quentin Rameau
> Hey,

Hi Viktor,

> Usually I clean out ~/.surf/cache/localstorage for all but 2 sites. I found 
> out the emphemeral option could acomplish just that, and setting up peruri 
> options with all 3 permutations (each being same priority) turned out to not 
> work. It's either on, or off, as evidenced by the files being created or not, 
> and the userscript not accessing (or not being able to access) the locally 
> stored settings in the above dir. I make'd surf with a new keyboard command 
> to toggle ephemeral, but to no avail. 
> Am I missing something, or is this unexpected behavior?

Indeed, the ephemeral parameter can't be a togglable parameter.

I have in the pipes the project of having per-domain isolation,
regarding cache/cookies etc., and ephemeral would be one of this.

But current $job gets the most of me and I have no time left for this
currently.



Re: [dev] [announce] pista: the ii of status bars

2021-10-25 Thread Siraaj Khandkar
Thanks, Alan. Yeah - using ii was like a chakra opening experience for 
me - I felt the enlightenment flow through my whole body.


On 10/23/21 07:38, Alan Morgan wrote:

That's great. I actually joined this mailing list recently, because of finding
out about "ii". It's nice to see another project doing something similar.

On 22 Oct 2021, at 15:07, dev mail list wrote:

Hello fellow dislikers of sucking!

After a lot of suckfull experiments (archived at
https://github.com/xandkar/khatus/), I've finally settled on what it is
that I would even want from a status bar thingie - I want ii, but for my
status bar. Here's my take on it:

https://github.com/xandkar/pista

I've been dogfooding/beta-testing pista for almost 2 years now, and
while there's certainly improvements that can be made - it reliably does
pretty much what I want.

Any constructive criticism is highly appreciated!

The main design idea is this: asynchronously read lines from N FIFOs and
route to N corresponding slots on the bar:

  b +--+--+- ... ---+-+
  a | slot_1   | slot_2   | | slot_N  |
  r +--+--+- ... ---+-+
  ^  ^^
  |  ||
 +-++-+  +-+
 | || |  | |
 |F||F|  |F|
 |I||I|  |I|
 |F||F|  |F|
 |O||O|  |O|
 | || |  | |
 |1||2|  |N|
 | || |  | |
 +-++-+  +-+
  ^  ^^
  |  ||
  process_1  process_2   ...  process_N


Each slot is given a TTL, after which, if there was no update - the slot
is cleared - helping you spot broken sensors and not fool yourself with
stale data.

What is a sensor? Anything that outputs lines of text.
What goes into a FIFO? Lines of text.

Here're the "sensors" that I currently use (which are still in flux and
not quite suckless yet):

https://github.com/xandkar/pista-sensors

I launch it all via a script such as this:
https://github.com/xandkar/pista-sensors/blob/master/example-via-tmux

which I call from ~/.xinitrc

Running it from tmux has been great - I can do runtime reconfiguration,
stop, restart the whole thing, can attach and stop/restart and or tweak
individual sensor processes, etc. - all without relaunching X.

This also makes it easy to do one-off experiments as well as temporarily
disabling things (like if I want to completely disable the weather
fetcher while I know I'm going to be offline for a long time).