Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

Publicaciones sobre programming (publicaciones antiguas, página 82)

Episodio 22: Color, Color, Color!

Cosas que uso en mi ter­mi­nal. ¿Qué ter­mi­nal? ¿Qué shel­l? ¿Que font? ¿Vale la pe­na reem­plazar her­ramien­tas que tienen 50 años co­mo "cat"? To­do eso y al­gui­to más!

  • Fish shel­l: http­s://­fishshel­l.­com/
  • Alacrit­ty: http­s://github.­com/alacrit­ty/alacrit­ty
  • CP Mono 07: http­s://github.­com/chris­simp­kin­s/­code­face/tree/­mas­ter/­fonts/cp-­mono
  • pow­er­line-rs: http­s://github.­com/jD91mZM2/pow­er­line-rs
  • bat: http­s://github.­com/sharkd­p/­bat
  • delta: http­s://github.­com/­dan­davi­son/delta
  • vir­tu­al­fish: http­s://github.­com/ex­cit­edleigh/vir­tu­al­fish

Episodio 21: Quickie: pre commit hooks

In­ten­tan­do cosas nuevas:

Un video cor­to mostran­do una her­ramien­ta no tan cono­ci­da co­mo de­bier­a: http://pre-­com­mit.­com -- Con­trol de cal­i­dad para tus com­mit­s.

XRandRoll: a new program to configure displays

TL; DR: I wrote a ex­per­i­men­tal tool to sup­port X dis­play con­fig­u­ra­tions which I think is, or at least will be, bet­ter than oth­er­s, and you can check it out at http­s://github.­com/ralsi­na/xran­droll

Now the re­al post:

I have been us­ing a du­al mon­i­tor con­fig­u­ra­tion for a lit­tle while. How­ev­er it's a slight­ly spe­cial one.

  • One mon­i­­tor is a nor­­mal sam­­sung 27" 1080P mon­i­­tor. But it's in a mon­i­­tor stand that al­lows it to ro­­tate. So it's ei­ther hor­i­­zon­­tal or ver­ti­­cal.

  • The oth­­er mon­i­­tor is the lap­­top's. BUT ... it's a 2-in-1 so it can be in "nor­­mal" or "ten­t" or "tablet" po­si­­tion­s. And when it changes po­si­­tion it re­­con­­fig­ures it­­self au­­to­­mat­i­­cal­­ly us­ing KDE's awe­­some sup­­port for it. So it can be in 4 dif­fer­­ent ori­en­­ta­­tion­s.

So, if you are count­ing, that gives me 8 dif­fer­ent pos­si­ble mon­i­tor con­fig­u­ra­tions.

Al­so, an­oth­er thing is that while both screens have the same res­o­lu­tion, they have very dif­fer­ent phys­i­cal di­men­sion­s. Dis­play con­fig­u­ra­tion tools usu­al­ly don't care for that (maybe with good rea­son!)

So, I want­ed to ex­per­i­ment with how a tool would work that:

  • Looked / worked more or less like cur­rent tools

  • Al­lowed a lit­­tle more flex­i­­bil­i­­ty

  • Did some fan­­cy scale things with phys­i­­cal di­­men­­sions

  • Tried to sup­­port xran­­dr fea­­tures that are ig­nored by most tools

  • Got its con­­fig­u­ra­­tion from xran­­dr it­­self.

  • Ap­­plied its con­­fig­u­ra­­tion via xran­­dr

  • Did screen mir­ror­ing bet­ter (say: ex­act mir­ror­ing when mon­i­­tors are not the same mod­­e? It does that)

So, xran­droll starts with sev­er­al "philo­soph­i­cal" opin­ions in place.

In prin­ci­ple, it stores no con­fig­u­ra­tion. It should ob­tain the state from xran­dr. So it starts with a re­al re­flec­tion of your sys­tem as it ex­ist­s.

It al­lows more dis­play scal­ing flex­i­bil­i­ty. In­de­pen­dent scales per ax­is! A wid­get that does all the sil­ly cal­cu­la­tions to make things the same size!

It sort of does what I want now? In a pro­to­type­y-this-­code-need­s-­to-be-rewrit­ten way?

For the fu­ture, I in­tend to add ca­pa­bil­i­ty to mon­i­tor your mon­i­tors (he­h) and re­fresh it­self if, for ex­am­ple, you plug in a mon­i­tor to your com­put­er with xran­droll run­ning. Al­so, some sort of ser­vice that con­fig­ures mon­i­tors au­to­mat­i­cal­ly as they are added / re­moved.

So, it may be worth tak­ing a look at it. If you find bugs (there are bound to be dozen­s) you can file a bug at­tach­ing your xran­dr out­put and I can de­bug them!

In­ter­ac­tion, UX, etc are still a WIP and sub­ject to change. Ex­per­i­ments are be­ing made. But it should be un­able to de­stroy your sys­tem! You can prob­a­bly even go back to what­ev­er work­ing con­fig you had by click­ing "Re­set"!

Have fun and keep me post­ed.

Episodio 19: Small Data (I)

Ju­gan­do con datos de ver­dad! Có­mo pode­mos us­ar es­ta pi­la de datos que sacamos de al­gún la­do para hac­er al­go in­tere­san­te? Em­pece­mos!

Para ver qué hice yo con es­tos mis­mos datos: http://nom­bres.ralsi­

Episodio 18: ¡Python más rápido que C!

Char­la relám­pa­go pre­sen­ta­da en Py­Con Ar­genti­na 2019. Es más o menos lo mis­mo que otro video del canal pero más cor­to y en vivo, y me sal­ió un po­quito mejor porque es la se­gun­da vez que lo ha­go ;-)

Otra man­era de ver­lo es que es un re­boot semi-en-jo­da de una fran­qui­cia de char­las de Lu­cio Torre y Fa­cun­do Batis­ta: http­s://www.y­outube.­com/watch?v=I8vYliX68wU

Slides: http­s://www.­doc­­Fxy/char­la.pdf

Char­la orig­i­nal de Fa­cun­do! http­s://www.y­outube.­com/watch?v=cPV­lY­Wx­cu18

Contents © 2000-2023 Roberto Alsina