profile
viewpoint

xzfc/cached-nix-shell 77

Instant startup time for nix-shell

xzfc/ndb.nim 25

A db_sqlite fork with a proper typing

xzfc/agar-expose 13

Yet another ogar client

xzfc/useless-tg-bot 2

Yet another useless telegram bot

hedlx/taraban 1

Yet another general-purpose chat bot

xzfc/node-irc 1

NodeJS IRC client library

xzfc/ufcs.rs 1

Helper trait to call free functions using method call syntax.

issue commenti3/i3

i3bar: protocol for workspace buttons

@ymolists I see it this way: Both i3ws.sh and ws_command_hide.sh have to be in sync in the implementation sense. That is, i3ws.sh should rely on the behavior of particular ws_command_hide.sh.

But the following much the same as what you describe. They don't have state outside of i3. i3ws.sh would add some particular suffix to workspace names that have to be hidden; and ws_command_hide.sh would hide workspaces with this particular suffix.

xzfc

comment created time in 20 days

issue commentxzfc/ndb.nim

Postgres: How to get value of dvkOther?

Since those are not TEXT, they get returned as dvkOther, so I can't compare the returned row with a reference row.

To work around that, I'm converting the values to strings with $ and comparing seqs of strings instead of rows. It works, but it wasn't obvious why I can't just compare to ?"id".

You may specify the desired type in SQL query, like this: db.rows(sql"select column_name::text from information_schema.columns").


I just worry that most PG data types will become str in Nim

Yeah, I'm too. Another concern is that PostgeSQL has a lot of types, even the user-defined ones.

Maybe, it'd be better to return the data type name in DbOther and let the user work with that?

I mean, suppose DbMacAddress is added to ndb. If an old code assumes that macaaddr will be DbOther, then this code will break.


Another option is to allow the column type to be specified as a generic type argument. Like how it is done for SQLite: https://github.com/xzfc/ndb.nim/blob/v0.19.8/tests/tsqlite.nim#L262

Or like this:

# old
iterator rows*(…): Row = …
for row in db.rows(db, …):
  …

# new
iterator rows*[T](…): T = …
for row in db.rows[:seq[DbValue]](db, …):
  # same semantics as in the old version
  …
for name, prec in db.rows[:(string, int64)](db, "SELECT column_name, numeric_precision from information_schema.columns"):
  # Let the user specify what types they expect.
  # Specifying `string` for every type is fine if you want the string representation.
  …
moigagoo

comment created time in a month

issue commentxzfc/ndb.nim

Postgres: How to get value of dvkOther?

I haven't remembered why I hid it. Probably to make sure clients won't rely on it, so they would not get broken when new kinds are added.

Maybe it's better to add more specific kinds to ndb?

moigagoo

comment created time in a month

push eventxzfc/nixpkgs

Albert Safin

commit sha 7923f0d955bd49e3134a35af77a01013438ff1f9

cached-nix-shell: 0.1.2 -> 0.1.3

view details

push time in a month

PR opened NixOS/nixpkgs

cached-nix-shell: 0.1.2 -> 0.1.3

<!-- To help with the large amounts of pull requests, we would appreciate your reviews of other pull requests, especially simple package updates. Just leave a comment describing what you have tested in the relevant package/service. Reviewing helps to reduce the average time-to-merge for everyone. Thanks a lot if you do! List of open PRs: https://github.com/NixOS/nixpkgs/pulls Reviewing guidelines: https://hydra.nixos.org/job/nixpkgs/trunk/manual/latest/download/1/nixpkgs/manual.html#chap-reviewing-contributions -->

Motivation for this change

New release.

Things done

<!-- Please check what applies. Note that these are not hard requirements but merely serve as information for reviewers. -->

  • [x] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • [x] NixOS
    • [ ] macOS
    • [ ] other Linux distributions
  • [ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • [ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • [x] Tested execution of all binary files (usually in ./result/bin/)
  • [x] Determined the impact on package closure size (by running nix path-info -S before and after)
  • [ ] Ensured that relevant documentation is up to date
  • [x] Fits CONTRIBUTING.md.
+5 -5

0 comment

1 changed file

pr created time in a month

push eventxzfc/nixpkgs

Andrew Childs

commit sha c6791b211767e8f4e4b1e90bc61b42b814f2e920

wafHook: allow overriding phases This makes the wafHook a lot closer to the structure of standard hooks like cmake and ninja.

view details

Andrew Childs

commit sha 032d5e7e837eaa295f2afec87a39a4ced2c1bc97

wafHook: make crossFlags optional The convention of `--cross-compile` and `--cross-execute` is common enough that it seems like a reasonable default. However there are projects like mpv which do not use these flags, and rightfully fails to configure when passed unexpected flags.

view details

Andrew Childs

commit sha 03ffda3d1e5db136543f4d5c1aa196bb8cd93774

wafHoook: fix whitespace

view details

Markus Kowalewski

commit sha ae91282545a1679803d6a646ca1d5c8b1717ed8d

iproute: add libmnl to build rdma utility

view details

Markus Kowalewski

commit sha 505bccfdc7afbd6844b1a65bffadf6208032d5d5

rdma-core: 27.0 -> 28.0 rxe_cfg has been removed, is replaced by 'rdma' from iproute package.

view details

Andrew Childs

commit sha 880ce71f6760e6b112b57c553233deb403f8da47

Revert "git: Fix git-gui to work on Catalina" This reverts commit 1b6ef1268fa87d66125938399a42f2b4d416cd8f.

view details

Andrew Childs

commit sha bc4264a95f632f6a622ee6d69ea72e97cc10fedf

git: use tcl/tk from nixpkgs on darwin

view details

Bignaux Ronan

commit sha b316cec9b66fa79f89a36decf669a8f2978e0af8

standardnotes: 3.0.15 -> 3.3.3

view details

Bignaux Ronan

commit sha e01ce7f91f050c0a0cefc6b5f759b9944f6f9a85

standardnotes: refactoring to use appimageTools instead of appimage-run

view details

Matthew Bauer

commit sha bad6770d277125a7eb2140d16dbe2446c4804e13

elfutils: remove unneeded custom cross build/install phase This is no longer needed. elfutils compiles out of the box!

view details

Matthew Bauer

commit sha d8b92121d4d0e609a81b78e31d8c37f033d11a19

aspell: perl is also a native build input This is needed for some scripts needed at build time.

view details

Matthew Bauer

commit sha 42fe7c7d47603093fd338545f88e81b4e0fd0f37

libevdev: python is a native input

view details

Matthew Bauer

commit sha e0ac0546de23b78c4d7075ca2f0b52e3ab725540

libpsl: add libxslt as a native dependency libxslt is actually both a target and native build input because some libxslt binary is needed to generate files and the built binaries also link against libxslt.

view details

Matthew Bauer

commit sha fdfde0324e967f0c727a8c59ec71b1d81dc9fefb

libsecret: add glib as a native dependency glib is both a native and target dependency. Some binary from glib is used to generate files.

view details

Matthew Bauer

commit sha de14f0c6e1247aa48b0d77c4a3390a61e020bebf

libinput: move test dependencies to checkInputs This avoids pulling them in when tests are disabled.

view details

Matthew Bauer

commit sha 5198179adc19176cbcee4f7d7f68d0490ecaf5d2

gstreamer: needs extra build inputs Cross needs some extra native tools: - glib - wayland - orc - glib is needed in nativeBuildInputs Also: - bash-completion needs to be available for PKG_CONFIG_PATH

view details

Matthew Bauer

commit sha 8c3160b6191b94f9e90cf42aab5810ed042bac89

bubblewrap: use buildInputs instead of nativeBuildInputs these are all libraries.

view details

Matthew Bauer

commit sha 78f9cad38730295d413ab9c031448b72e2c55d31

cage: add wayland as nativeBuildInputs Needed on the build machine

view details

Matthew Bauer

commit sha f187d8c26f2d8d90c7cbcfd46700c3f51f1c52cc

wlroots: add wayland as nativeBuildInputs Needed on the build machine

view details

volth

commit sha ed33a6c327758a63878d98ae183a7fe3b3df229b

firefox: mark as broken on 32-bit buildPlatform

view details

push time in a month

created tagxzfc/cached-nix-shell

tagv0.1.3

Instant startup time for nix-shell

created time in a month

push eventxzfc/cached-nix-shell

Albert Safin

commit sha 4db8af0c653620e192c59d7d8ed227e4ffd8f54c

v0.1.3

view details

push time in a month

push eventxzfc/cached-nix-shell

Albert Safin

commit sha 51b2637619b91e50ffeecc3243a91fa7a42c1c36

man: Document --keep caveat (#15)

view details

Albert Safin

commit sha f5a803e93e5eafa52e6459e059d15ce07d678f73

nix-trace: fix compiler warnings

view details

Albert Safin

commit sha 15bd0f46d65a189916547fde1eb746393d78b9be

Print time spent in nix-shell

view details

Albert Safin

commit sha bb5aa63cf57b54cd69661b3e7c9018497e950d1b

Update dependencies, move BLAKE3 to niv

view details

Albert Safin

commit sha e516c7d97d960dcebc70084efec66abb0de39a4d

tests: Simplify t02-file-dep.sh

view details

Albert Safin

commit sha 745ae9c48046bb75d8f0e42f2ff9f845dd5b8c41

Shellcheck

view details

push time in a month

issue commentxzfc/cached-nix-shell

Regression: v0.1.2+ segfaults

I can reproduce it even on v0.1.1 when nix-shell is installed as an Arch package (in /usr/sbin/, not in /nix/store/…/bin/). It seems that libdl.so.2 from Nixpkgs (which is linked by trace-nix.so) doesn't play well with /usr/lib/libdl.so.2 (which is linked by nix-shell installed as an Arch package).


Could you check the latest master commit 290e3bdd3ff8cf166823536baa261bd494808827?

exFalso

comment created time in a month

push eventxzfc/cached-nix-shell

Albert Safin

commit sha 290e3bdd3ff8cf166823536baa261bd494808827

nix-trace: Drop -ldl (#16)

view details

push time in a month

PR opened spwhitt/nix-zsh-completions

nix run -c: complete command names and arguments
  • Complete command names from programs.sqlite database.

    $ nix run nixpkgs.cowsay -c ⭾
    Package commands
    cowsay                              cowthink
    All commands
    \[                                  mkfs.ext4
    2to3                                mkfs.fat
    ...
    
  • Complete command arguments. E.g. nix run nixpkgs.cowsay -c cowsay -⭾ will show you cowsay-related completions.

  • Small fix: use _command_names -e instead of _command_names. This will filter out shell aliases, shell functions, etc.

+54 -1

0 comment

2 changed files

pr created time in 2 months

push eventxzfc/nix-zsh-completions

Albert Safin

commit sha 9ede4027b033ec02eaae9b1b142a828d945fc9e5

nix run -c: complete command names and arguments

view details

push time in 2 months

create barnchxzfc/node-irc

branch : meow

created branch time in 2 months

issue commentitchyny/vim-cursorword

Priority

Now it works as desired, thank you.

xzfc

comment created time in 2 months

issue commentneovim/neovim

Get terminal background color

So OptionSet handler should get the value.

But it did not. See steps to reproduce in the original message. I'm guessing it's because setting bg re-applies the colorscheme just before OptionSet handler is called.

xzfc

comment created time in 2 months

issue openedneovim/neovim

Get terminal background color

Neovim already detects it since 298608f88c463705cfd6ee47035c049dbb1d9fa0 and sets bg accordingly. However, the colorscheme that I use overrides this value, and I see no way to get the terminal-related value.

Use-case: I want to set hi Normal guibg=NONE in init.vim only if the terminal background is dark.

  • nvim --version: v0.5.0-dev
  • Terminal name/version: gnome-terminal

Steps to reproduce

Set light terminal background and run nvim with the following init.vim:

echom 'default: bg=' . &bg
autocmd VimEnter * echom 'enter: bg=' . &bg
autocmd ColorSchemePre * echom 'pre: bg=' . &bg
autocmd OptionSet background echom 'set: bg=' . &bg

colorscheme darkblue

I expect bg=light message at least somewhere, but I am getting the following:

default: bg=dark
pre: bg=dark
pre: bg=dark
enter: bg=dark

If I comment the last line (colorscheme darkblue), I'll get what I want:

default: bg=dark
enter: bg=dark
set: bg=light

created time in 2 months

issue openeditchyny/vim-cursorword

Priority

Use case

I'm using vim-cursorword together with inkarkat/vim-mark. Underline of vim-cursorword takes precedence over marks placed by vim-mark. This is inconvenient since there is no immediate visual feedback after marking a word by pressing \m. I have to move the cursor to see the marks.

  • vim-cursorword has a priority of -1 (unconfigurable)
  • vim-mark by default has a priority of -10 (configurable via g:mwMaxMatchPriority)
  • both priorities have to be negative, otherwise, they would override hlsearch

Feature request

I would like to configure vim-cursorword match priority.

Or leave it unconfigurable, but at least make it small enough, like -100. In this case it is possible to revert to the old behavior by setting g:mwMaxMatchPriority to e.g. -200.

Or, if it is possible, make both plugins not interfere with each other. I.e. make vim-cursorword underline not to override vim-mark backgrounds.

created time in 2 months

delete branch xzfc/cached-nix-shell

delete branch : tests

delete time in 2 months

push eventxzfc/cached-nix-shell

Albert Safin

commit sha 9bd1649452280c20b4978bc0122208e2c6cd46f0

Handle non-utf8 evaluation result

view details

push time in 2 months

push eventxzfc/cached-nix-shell

Albert Safin

commit sha 194c560e0a7eaa2528f347180322f72c559fa5d9

tests: Test non-utf8 paths/env vars

view details

push time in 2 months

issue openedphw/peek

man peek gzipped twice on NixOS

man peek on NixOS is binary garbage. It seems that some part of the build system doesn't know that peek.1 is already compressed and gzips it for the second time.

One possible fix is to add .gz suffix to generated manpage filename. This is consistent with behavior of data/man/CMakeLists.txt which appends .gz suffix.

diff --git a/data/man/meson.build b/data/man/meson.build
index 71da75c..54e7b73 100644
--- a/data/man/meson.build
+++ b/data/man/meson.build
@@ -17,7 +17,7 @@ else
       join_paths(meson.current_source_dir(), 'peek.1.txt'),
       '@OUTPUT@'
     ],
-    output: 'peek.1',
+    output: 'peek.1.gz',
     install: true,
     install_dir: join_paths(get_option('mandir'), 'man1'))
 endif

created time in 2 months

fork xzfc/peek

Simple animated GIF screen recorder with an easy to use interface

fork in 2 months

push eventxzfc/cached-nix-shell

Albert Safin

commit sha 25704a2b02ea61987551023709590f14aedfd9f3

tests: Test --keep

view details

push time in 2 months

push eventxzfc/cached-nix-shell

Albert Safin

commit sha a09e1119d68b8a677468059ac1fa54219d696c45

Refactor tests Previously test cases were defined in a huge script /tests/run.sh that contained every test case, and a bunch of .nix/.sh/.lua files scattered across the /tests/ directory that are referenced by run.sh. It was hard to maintain and extend. This commit replaces these with a set of homogeneous test scripts. Now, each test script: * is self-contained: all files used in a test script are inlined inside the test file rather than scattered across the /tests/ directory. There are no dependencies across files except `lib.sh` which is inlined by each test script. * is executable: it is possible to run a single test script rather than the full test suite. * has a separate cache: the cache is cleared before each test file execution. Also, it is possible to inspect the contents of the cache directory (./tmp/cache) after running a single test script.

view details

push time in 2 months

push eventxzfc/cached-nix-shell

Albert Safin

commit sha 7750901ddd4ae8ee882521b5f34fd69078d99108

Refactor tests

view details

push time in 2 months

push eventxzfc/cached-nix-shell

Albert Safin

commit sha 0aced2d44fd0251e776fe946fbbdb4eb60b56a3c

Refactor tests

view details

push time in 2 months

create barnchxzfc/cached-nix-shell

branch : tests

created branch time in 2 months

issue commentxzfc/cached-nix-shell

'unbound variable' when variable is set in a shell-hook

Ah, I didn't know about keep!

I added it just now. 😅

expipiplus1

comment created time in 3 months

issue commentxzfc/cached-nix-shell

'unbound variable' when variable is set in a shell-hook

This particular case could be handled by passing --keep explicitly (added in 0e73944dc31132d2aa9a769f4cc677eea6984bec): cached-nix-shell --keep XDG_DATA_DIRS -p vulkan-validation-layers

expipiplus1

comment created time in 3 months

push eventxzfc/cached-nix-shell

Albert Safin

commit sha 0e73944dc31132d2aa9a769f4cc677eea6984bec

Handle --keep

view details

push time in 3 months

issue commentxzfc/cached-nix-shell

'unbound variable' when variable is set in a shell-hook

In this particular case, the error is caused by a setupHook that tries to read an impure variable. It reproducible by nix-shell --pure -p vulkan-validation-layers.

expipiplus1

comment created time in 3 months

PR opened i3/i3

x_draw_decoration: always clear parent pixmap when rendering the first child

See the commit message.

Steps to reproduce:

  1. Enable transparent borders and titlebars, and use a compositor.

  2. Make this layout: H[x V[a b]]

  • a is 32-bit window, has border pixel 50
  • b has border normal 50
  1. Resize a (top right window) and see visual garbage in the background.

2020-04-18_04:18:09

+5 -5

0 comment

1 changed file

pr created time in 3 months

create barnchxzfc/i3

branch : always-clear-parent-pixmap

created branch time in 3 months

issue closedxzfc/agarsk

Complete?

When will you finish the server off?

closed time in 3 months

MistikSenpa

issue commentxzfc/agarsk

Complete?

This project is abandoned. I suggest you to use the Ogar project or an one of its forks.

MistikSenpa

comment created time in 3 months

push eventxzfc/cached-nix-shell

Albert Safin

commit sha 316e4966289f46d2a462342d1576809ae74b20b6

readme.md: Mention that cns is included to Nixpkgs

view details

push time in 3 months

pull request commenti3/i3

bspwm-like resize

Added fixup commit.

xzfc

comment created time in 3 months

Pull request review commenti3/i3

bspwm-like resize

 void render_con(Con *con) {                  child->rect.x, child->rect.y, child->rect.width, child->rect.height);             x_raise_con(child);             render_con(child);++            /* Accumulate minimum size of the con based on child->min_size.+             * We may use child->min_size only after calling render_con(child).+             *+             * TODO: this isn't perfect as it fails to handle some corner cases,

Bad cases that I've found: stacked inside stacked inside vsplit, and stacked inside tabbed inside vsplit. In this cases the calculated minimal height is one deco_height less that it should be (e.g. expected 80px, got 60px).

xzfc

comment created time in 3 months

push eventxzfc/i3

Albert Safin

commit sha 30c256bab0bc288437ababc759ecd5a3286c10db

fixup-01 * enum border_t -> enum resize_direction_t * resize_cursor() -> xcursor_type_for_resize_direction() * resize_get_borders_sides(), resize_get_borders_mod() -> get_resize_direction() * resize_find_tiling_participants_two_axes()

view details

push time in 3 months

push eventxzfc/i3

Albert Safin

commit sha 0a55314a9f06f6f3a532a8ad587ba1f21778aab9

fixup-01 * enum border_t -> enum resize_direction_t * resize_cursor() -> xcursor_type_for_resize_direction() * resize_get_borders_sides(), resize_get_borders_mod() -> get_resize_direction() * resize_find_tiling_participants_two_axes()

view details

push time in 3 months

Pull request review commenti3/i3

bspwm-like resize

  #include <X11/XKBlib.h> -typedef enum { CLICK_BORDER = 0,-               CLICK_DECORATION = 1,-               CLICK_INSIDE = 2 } click_destination_t;- /*  * Finds the correct pair of first/second cons between the resize will take  * place according to the passed border position (top, left, right, bottom),  * then calls resize_graphical_handler().  *  */-static bool tiling_resize_for_border(Con *con, border_t border, xcb_button_press_event_t *event, bool use_threshold) {+static bool tiling_resize_for_border(Con *con, border_t border, xcb_button_press_event_t *event, bool use_threshold, bool both) {

So, make an extended version of resize_find_tiling_participants for two axes?

bool resize_find_tiling_participants(Con **current, Con **other, direction_t direction, bool both_sides); 
resize_direction_t resize_find_tiling_participants_two_axes(Con *con, resize_direction_t dir, Con *result[4]) {
    /* call resize_find_tiling_participants() multiple times */
    /* fill result[0] .. result[3] with first_h, first_v, second_h, second_v */
    /* return RD_NONE (== 0) on a failure */
}
xzfc

comment created time in 3 months

Pull request review commenti3/i3

bspwm-like resize

 bool resize_neighboring_cons(Con *first, Con *second, int px, int ppt);  *  */ double percent_for_1px(Con *con);++enum xcursor_cursor_t resize_cursor(border_t corner, bool both);

I'm thinking of this:

/**
 * Return cursor which should be used during the resize process.
 *
 * `unidirectional` should be true when it is clear from the user perspective
 * which container is the main in the resizing process. In this case, a
 * single-headed arrow cursor is returned. Сontrariwise, e.g. in a case of drag
 * by the border between two windows, a two-headed arrow cursor is returned.
 *
 */
enum xcursor_cursor_t xcursor_type_for_resize_direction(resize_direction_t dir, bool unidirectional);

Probably, still there is a better name for the second argument.

xzfc

comment created time in 3 months

Pull request review commenti3/i3

bspwm-like resize

 void resize_graphical_handler(Con *first, Con *second, orientation_t orientation     xcb_window_t grabwin = create_window(conn, output->rect, XCB_COPY_FROM_PARENT, XCB_COPY_FROM_PARENT,                                          XCB_WINDOW_CLASS_INPUT_ONLY, XCURSOR_CURSOR_POINTER, true, mask, values); -    /* Keep track of the coordinate orthogonal to motion so we can determine the-     * length of the resize afterward. */-    uint32_t initial_position, new_position;--    /* Configure the resizebar and snap the pointer. The resizebar runs along-     * the rect of the second con and follows the motion of the pointer. */-    Rect helprect;-    helprect.x = second->rect.x;-    helprect.y = second->rect.y;-    if (orientation == HORIZ) {-        helprect.width = logical_px(2);-        helprect.height = second->rect.height;-        initial_position = second->rect.x;-    } else {-        helprect.width = second->rect.width;-        helprect.height = logical_px(2);-        initial_position = second->rect.y;-    }--    mask = XCB_CW_BACK_PIXEL;-    values[0] = config.client.focused.border.colorpixel;--    mask |= XCB_CW_OVERRIDE_REDIRECT;-    values[1] = 1;--    xcb_window_t helpwin = create_window(conn, helprect, XCB_COPY_FROM_PARENT, XCB_COPY_FROM_PARENT,-                                         XCB_WINDOW_CLASS_INPUT_OUTPUT, (orientation == HORIZ ? XCURSOR_CURSOR_RESIZE_HORIZONTAL : XCURSOR_CURSOR_RESIZE_VERTICAL), false, mask, values);--    if (!use_threshold) {-        xcb_map_window(conn, helpwin);-        if (orientation == HORIZ) {-            xcb_warp_pointer(conn, XCB_NONE, event->root, 0, 0, 0, 0,-                             second->rect.x, event->root_y);-        } else {-            xcb_warp_pointer(conn, XCB_NONE, event->root, 0, 0, 0, 0,-                             event->root_x, second->rect.y);-        }-    }--    xcb_circulate_window(conn, XCB_CIRCULATE_RAISE_LOWEST, helpwin);-     xcb_flush(conn); -    /* `new_position' will be updated by the `resize_callback'. */-    new_position = initial_position;--    bool threshold_exceeded = !use_threshold;--    const struct callback_params params = {orientation, output, helpwin, &new_position, &threshold_exceeded};+    const struct callback_params params = {+        .horisontal = {+            first_h,+            second_h,+            event->root_x,+            first_h ? first_h->percent / (first_h->percent + second_h->percent) : 0,+        },+        .vertical = {+            first_v,+            second_v,+            event->root_y,+            first_v ? first_v->percent / (first_v->percent + second_v->percent) : 0,+        },+    };      /* Re-render the tree before returning to the event loop (drag_pointer()      * runs its own event-loop) in case if there are unrendered updates. */     tree_render();      /* `drag_pointer' blocks until the drag is completed. */-    drag_result_t drag_result = drag_pointer(NULL, event, grabwin, 0, use_threshold, resize_callback, &params);+    drag_result_t drag_result = drag_pointer(NULL, event, grabwin, cursor, use_threshold, resize_callback, &params); -    xcb_destroy_window(conn, helpwin);     xcb_destroy_window(conn, grabwin);     xcb_flush(conn); -    /* User cancelled the drag so no action should be taken. */+    /* Undo resize if user cancelled the drag. */     if (drag_result == DRAG_REVERT) {-        return;+        if (first_h != NULL) {+            reset_percent(&params.horisontal);+        }+        if (first_v != NULL) {+            reset_percent(&params.vertical);+        }+        tree_render();+    }+}++enum xcursor_cursor_t resize_cursor(border_t corner, bool both) {+    if (both) {+        switch ((int)corner) {

How about this?

typedef enum {
    RD_NONE = 0,

    RD_LEFT = (1 << 0),
    RD_RIGHT = (1 << 1),
    RD_UP = (1 << 2),
    RD_DOWN = (1 << 3),

    RD_UP_LEFT = RD_LEFT | RD_UP,
    RD_DOWN_LEFT = RD_LEFT | RD_DOWN,
    RD_UP_RIGHT = RD_RIGHT | RD_UP,
    RD_DOWN_RIGHT = RD_RIGHT | RD_DOWN,
} resize_direction_t;

It's still a bitmask, but values outside the defined ones aren't used.

xzfc

comment created time in 3 months

Pull request review commenti3/i3

bspwm-like resize

 bool resize_neighboring_cons(Con *first, Con *second, int px, int ppt);  *  */ double percent_for_1px(Con *con);++enum xcursor_cursor_t resize_cursor(border_t corner, bool both);++border_t find_corresponding_resize_borders(int x, int y, int width, int height);++/**+ * Return a bitmask of a corresponding resize borders for title/border drag.+ *+ */+border_t resize_get_borders_sides(Con *con, int x, int y, click_destination_t dest);++/**+ * Return a bitmask of a corresponding resize borders for mod+rightclick resize.+ *+ */+border_t resize_get_borders_mod(int x, int y, int width, int height);

Yes.

xzfc

comment created time in 3 months

Pull request review commenti3/i3

bspwm-like resize

 bool resize_neighboring_cons(Con *first, Con *second, int px, int ppt);  *  */ double percent_for_1px(Con *con);++enum xcursor_cursor_t resize_cursor(border_t corner, bool both);

how about include_corners (opposite effect)

It's not "both axis" but rather "use two-side arrow". I.e. if true (drag by border), horizontal resize would be . Otherwise (mod+drag), or .

xzfc

comment created time in 3 months

Pull request review commenti3/i3

bspwm-like resize

 void resize_graphical_handler(Con *first, Con *second, orientation_t orientation     xcb_window_t grabwin = create_window(conn, output->rect, XCB_COPY_FROM_PARENT, XCB_COPY_FROM_PARENT,                                          XCB_WINDOW_CLASS_INPUT_ONLY, XCURSOR_CURSOR_POINTER, true, mask, values); -    /* Keep track of the coordinate orthogonal to motion so we can determine the-     * length of the resize afterward. */-    uint32_t initial_position, new_position;--    /* Configure the resizebar and snap the pointer. The resizebar runs along-     * the rect of the second con and follows the motion of the pointer. */-    Rect helprect;-    helprect.x = second->rect.x;-    helprect.y = second->rect.y;-    if (orientation == HORIZ) {-        helprect.width = logical_px(2);-        helprect.height = second->rect.height;-        initial_position = second->rect.x;-    } else {-        helprect.width = second->rect.width;-        helprect.height = logical_px(2);-        initial_position = second->rect.y;-    }--    mask = XCB_CW_BACK_PIXEL;-    values[0] = config.client.focused.border.colorpixel;--    mask |= XCB_CW_OVERRIDE_REDIRECT;-    values[1] = 1;--    xcb_window_t helpwin = create_window(conn, helprect, XCB_COPY_FROM_PARENT, XCB_COPY_FROM_PARENT,-                                         XCB_WINDOW_CLASS_INPUT_OUTPUT, (orientation == HORIZ ? XCURSOR_CURSOR_RESIZE_HORIZONTAL : XCURSOR_CURSOR_RESIZE_VERTICAL), false, mask, values);--    if (!use_threshold) {-        xcb_map_window(conn, helpwin);-        if (orientation == HORIZ) {-            xcb_warp_pointer(conn, XCB_NONE, event->root, 0, 0, 0, 0,-                             second->rect.x, event->root_y);-        } else {-            xcb_warp_pointer(conn, XCB_NONE, event->root, 0, 0, 0, 0,-                             event->root_x, second->rect.y);-        }-    }--    xcb_circulate_window(conn, XCB_CIRCULATE_RAISE_LOWEST, helpwin);-     xcb_flush(conn); -    /* `new_position' will be updated by the `resize_callback'. */-    new_position = initial_position;--    bool threshold_exceeded = !use_threshold;--    const struct callback_params params = {orientation, output, helpwin, &new_position, &threshold_exceeded};+    const struct callback_params params = {+        .horisontal = {+            first_h,+            second_h,+            event->root_x,+            first_h ? first_h->percent / (first_h->percent + second_h->percent) : 0,+        },+        .vertical = {+            first_v,+            second_v,+            event->root_y,+            first_v ? first_v->percent / (first_v->percent + second_v->percent) : 0,+        },+    };      /* Re-render the tree before returning to the event loop (drag_pointer()      * runs its own event-loop) in case if there are unrendered updates. */     tree_render();      /* `drag_pointer' blocks until the drag is completed. */-    drag_result_t drag_result = drag_pointer(NULL, event, grabwin, 0, use_threshold, resize_callback, &params);+    drag_result_t drag_result = drag_pointer(NULL, event, grabwin, cursor, use_threshold, resize_callback, &params); -    xcb_destroy_window(conn, helpwin);     xcb_destroy_window(conn, grabwin);     xcb_flush(conn); -    /* User cancelled the drag so no action should be taken. */+    /* Undo resize if user cancelled the drag. */     if (drag_result == DRAG_REVERT) {-        return;+        if (first_h != NULL) {+            reset_percent(&params.horisontal);+        }+        if (first_v != NULL) {+            reset_percent(&params.vertical);+        }+        tree_render();+    }+}++enum xcursor_cursor_t resize_cursor(border_t corner, bool both) {+    if (both) {+        switch ((int)corner) {

I think enum is fine to store bitmasks, and i3 already has bitmask enums Assignment::type and adjacent_t. (however, border_t and adjacent_t look similar, probably should be merged into one)

xzfc

comment created time in 3 months

Pull request review commenti3/i3

bspwm-like resize

 bool resize_neighboring_cons(Con *first, Con *second, int px, int ppt);  *  */ double percent_for_1px(Con *con);++enum xcursor_cursor_t resize_cursor(border_t corner, bool both);++border_t find_corresponding_resize_borders(int x, int y, int width, int height);++/**+ * Return a bitmask of a corresponding resize borders for title/border drag.+ *+ */+border_t resize_get_borders_sides(Con *con, int x, int y, click_destination_t dest);++/**+ * Return a bitmask of a corresponding resize borders for mod+rightclick resize.+ *+ */+border_t resize_get_borders_mod(int x, int y, int width, int height);

Related question: should we update floating resize to match the new tiling resize? I.e. one-axis resize unless dragged by a corner.

If we decide to do so, then this function could be reused in floating_resize_window() in src/floating.c.

xzfc

comment created time in 3 months

Pull request review commenti3/i3

bspwm-like resize

 bool resize_neighboring_cons(Con *first, Con *second, int px, int ppt);  *  */ double percent_for_1px(Con *con);++enum xcursor_cursor_t resize_cursor(border_t corner, bool both);++border_t find_corresponding_resize_borders(int x, int y, int width, int height);++/**+ * Return a bitmask of a corresponding resize borders for title/border drag.+ *+ */+border_t resize_get_borders_sides(Con *con, int x, int y, click_destination_t dest);

This could be reused in handle_motion_notify() in src/handlers.c to implement #3693.

xzfc

comment created time in 3 months

pull request commenti3/i3

bspwm-like resize

@orestisfl Rebased.

xzfc

comment created time in 3 months

push eventxzfc/i3

Martin T. H. Sandsmark

commit sha afab4d67891337527c499c7a5618445bc223b1af

Allow matching on empty properties (class, title, etc.) Fixes #3308

view details

Albert Safin

commit sha d36829d6e29a5b6db56b604e3eff86a35afa02e4

Make floating-tiling resize code consistent with plain tiling resize Now dragging an inner border of a floating split triggers a tiling resize (as expected) instead of a floating resize.

view details

Jason

commit sha a516bdbb92f2eb94c62900e77a5959769ff67e80

Use _PATH_BSHELL Possibly overlooked in f691a55923850a4d315450925fc98733d07b69c9?

view details

Jason

commit sha 5024a13b8b02927a4230668a5d28ba5e52703568

Remove comment referencing old source code Behaviour was changed in f691a55923850a4d315450925fc98733d07b69c9

view details

Ingo Bürk

commit sha daa2ea0d0537781731e6b3938216e9b2076543f2

Merge pull request #3961 from ammgws/patch-1 i3-nagbar: Use _PATH_BSHELL

view details

Ingo Bürk

commit sha d2acdcc69f004afd3be7e8981c10be33451f1a80

Merge pull request #3960 from ammgws/patch-2 Remove comment referencing old source code

view details

Jason Nader

commit sha 191c394db8a9ba743dfde16ca82c82444ff4a71c

Use _PATH_BSHELL in nagbar script as well

view details

Jason Nader

commit sha 9a3318b622ee08a71b1533a66fbe6a564fcb6dc5

Fix error message

view details

Ingo Bürk

commit sha cae3b294ad2f94f709cf0f7f57b7be50e9de4b88

Merge pull request #3964 from ammgws/_PATH_BSHELL Use _PATH_BSHELL in nagbar script as well

view details

Ian Fan

commit sha d02cda4241dc822096bada51ae5fc4c1d28485a3

ipc: always include marks property in TREE reply

view details

Ingo Bürk

commit sha 164336099d731456448fd1150c3993f08c82dcc4

Merge pull request #3970 from ianyfan/ipc ipc: always include marks property in TREE reply

view details

Orestis Floros

commit sha 1a2882d740ecc01312cf26ea5fac608077af7386

Avoid resizing fullscreen container Fixes #3980

view details

Ingo Bürk

commit sha cf505eaea88a512d902aa8aba7136e0e584faf09

Merge pull request #3983 from orestisfl/resize-behind-fullscreen Avoid resizing fullscreen container

view details

Michael Stapelberg

commit sha 72a6ad20139ef2d5dc5a8f3158e3b4660ecf450d

check-spelling: update to new Lintian::Profile API This changed between Lintian 2.62.0 and 2.64.0.

view details

Ingo Bürk

commit sha 47732a4d9b0266f107189210d61deb9119e86e58

Merge pull request #3994 from stapelberg/lintian check-spelling: update to new Lintian::Profile API

view details

Orestis Floros

commit sha f3762cd04113a6c21af747d9e3ba0eaa8b567ca1

userguide: Add button{6,7} Related to #3984

view details

Orestis Floros

commit sha 6e24e2ad6f4b1e32cfa27805a3a948d0de50f3b1

Merge pull request #3985 from orestisfl/userguide-button6-7 userguide: Add button{6,7}

view details

Albert Safin

commit sha 148ff54f180d5bbd4ecae0298668f3f99847883b

handlers.c: remove unused arguments from cb_property_handler_t Also, use `conn` global variable instead of passing it as an argument.

view details

Albert Safin

commit sha 5716ff541ffa8b20c8bd8af8411987dffede9e50

handlers.c: remove redundant property fetching Some property handlers trying to fetch property again if `prop == NULL`. This is redundant since these properties are either fetched by property_notify() just before or deleted.

view details

Albert Safin

commit sha e03fdef3e5f57eefbd18b6a290b6553dc9f277de

handlers.c: property_notify(): DLOG and return in case of an error

view details

push time in 3 months

Pull request review commenti3/i3

Match WM_CLIENT_MACHINE

 static bool handle_class_change(Con *con, xcb_get_property_reply_t *prop) {     return true; } +/*+ * Handles the WM_CLIENT_MACHINE property for assignments and criteria selection.+ *+ */+static bool handle_machine_change(Con *con, xcb_get_property_reply_t *prop) {+    window_update_machine(con->window, prop);+    con = remanage_window(con);+    return true;+}

I'm not sure that i3 should listen to changes in the property WM_CLIENT_MACHINE since it is unlikely to change. However, I make it similar to e.g. WM_CLASS which is should not be changed too (?).

xzfc

comment created time in 3 months

push eventxzfc/i3

Albert Safin

commit sha 702a8508f5452359b3c6c29b957f5df3aab51c0b

Add "machine" criterion to match WM_CLIENT_MACHINE Closes #3981

view details

Albert Safin

commit sha 6271d5fbceea8765bb161eccacc90a05a6b83a77

Add "%machine" title format placeholder

view details

Albert Safin

commit sha 5c922a410475ddab87d5a10d0381b0c98436e3ac

Add "machine" to the IPC and layout saving/restoring

view details

push time in 3 months

PR opened i3/i3

Match WM_CLIENT_MACHINE
  • Add machine criterion to match WM_CLIENT_MACHINE. Closes #3981
  • Add %machine title format placeholder.
  • Add machine to the IPC and layout saving/restoring.

Also, would it make sense to support special values __local__ and __remote__ to match corresponding clients? Use-case is to indicate windows from remote clients, like this: for_window [machine=__remote__] title_format "[%machine] %title" Alternative is to hard-code the machine hostname into the user config.

+85 -10

0 comment

15 changed files

pr created time in 3 months

push eventxzfc/i3

Albert Safin

commit sha 563b8b48b4173535e5b7cd191324d84232f42ada

Add "machine" to the IPC and layout saving/restoring

view details

push time in 3 months

create barnchxzfc/i3

branch : 3981-client-machine

created branch time in 3 months

Pull request review commenti3/i3

Extend tiling/floating criteria with optional auto/user values

 static bool handle_strut_partial_change(Con *con, xcb_get_property_reply_t *prop     return true; } +/*+ * Handles the _I3_FLOATING_WINDOW property to properly run assignments for+ * floating window changes.

Why listen to our own properties instead of just calling remanage_window() from floating_enable()/floating_disable()?

orestisfl

comment created time in 3 months

PR opened i3/i3

Refactor property handlers

Removed unnecessary and repeated code.

+26 -135

0 comment

1 changed file

pr created time in 3 months

create barnchxzfc/i3

branch : refactor-property-handlers

created branch time in 3 months

issue closedxzfc/cached-nix-shell

Include in nixpkgs

It would be nice to have this included in nixpkgs

closed time in 3 months

expipiplus1

issue commentxzfc/cached-nix-shell

Include in nixpkgs

Added in https://github.com/NixOS/nixpkgs/pull/81919

expipiplus1

comment created time in 3 months

pull request commentNixOS/nixpkgs

cached-nix-shell: init at 0.1.2

bump

Rebased, updated to v0.1.2, introduced a new dependency BLAKE3.

xzfc

comment created time in 3 months

Pull request review commentNixOS/nixpkgs

cached-nix-shell: init at 0.1.1

+{ stdenv, fetchFromGitHub, openssl, pkgconfig, ronn, rustPlatform }:++rustPlatform.buildRustPackage rec {+  pname = "cached-nix-shell";+  version = "0.1.1";++  src = fetchFromGitHub {+    owner = "xzfc";+    repo = pname;+    rev = "v" + version;+    sha256 = "0j39mqhvjrqkcx4yfaxlak4832bx9n2w6a5j0gfnq1a8spp5fj8a";+  };++  cargoSha256 = "0cncv037sg1phh4if9zmf6gpnhrh49vkizr7xnrj8d3070xyylpr";++  nativeBuildInputs = [ ronn ];+  buildInputs = [ openssl ];++  postBuild = ''+    ronn -r cached-nix-shell.1.md+  '';++  postInstall = ''+    mkdir -p $out/lib $out/share/cached-nix-shell $out/share/man/man1 $out/var/empty+    cp target/release/build/cached-nix-shell-*/out/trace-nix.so $out/lib+    cp rcfile.sh $out/share/cached-nix-shell/rcfile.sh+    cp cached-nix-shell.1 $out/share/man/man1+  '';++  CNS_IN_NIX_BUILD = "1";

It is used to distinguish between development builds and builds inside nix-build. I've inverted the defaults in v0.1.2, so it no longer needed in default.nix.

xzfc

comment created time in 3 months

push eventxzfc/nixpkgs

aszlig

commit sha e1d63ada025ac61d587bc21009539d4c1a388b74

nginx: Fix ETag patch to ignore realpath(3) error While our ETag patch works pretty fine if it comes to serving data off store paths, it unfortunately broke something that might be a bit more common, namely when using regexes to extract path components of location directives for example. Recently, @devhell has reported a bug with a nginx location directive like this: location ~^/\~([a-z0-9_]+)(/.*)?$" { alias /home/$1/public_html$2; } While this might look harmless at first glance, it does however cause issues with our ETag patch. The alias directive gets broken up by nginx like this: *2 http script copy: "/home/" *2 http script capture: "foo" *2 http script copy: "/public_html/" *2 http script capture: "bar.txt" In our patch however, we use realpath(3) to get the canonicalised path from ngx_http_core_loc_conf_s.root, which returns the *configured* value from the root or alias directive. So in the example above, realpath(3) boils down to the following syscalls: lstat("/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lstat("/home/$1", 0x7ffd08da6f60) = -1 ENOENT (No such file or directory) During my review[1] of the initial patch, I didn't actually notice that what we're doing here is returning NGX_ERROR if the realpath(3) call fails, which in turn causes an HTTP 500 error. Since our patch actually made the canonicalisation (and thus additional syscalls) necessary, we really shouldn't introduce an additional error so let's - at least for now - silently skip return value if realpath(3) has failed. However since we're using the unaltered root from the config we have another issue, consider this root: /nix/store/...-abcde/$1 Calling realpath(3) on this path will fail (except if there's a file called "$1" of course), so even this fix is not enough because it results in the ETag not being set to the store path hash. While this is very ugly and we should fix this very soon, it's not as serious as getting HTTP 500 errors for serving static files. I added a small NixOS VM test, which uses the example above as a regression test. It seems that my memory is failing these days, since apparently I *knew* about this issue since digging for existing issues in nixpkgs, I found this similar pull request which I even reviewed: https://github.com/NixOS/nixpkgs/pull/66532 However, since the comments weren't addressed and the author hasn't responded to the pull request, I decided to keep this very commit and do a follow-up pull request. [1]: https://github.com/NixOS/nixpkgs/pull/48337 Signed-off-by: aszlig <aszlig@nix.build> Reported-by: @devhell Acked-by: @7c6f434c Acked-by: @yorickvP Merges: https://github.com/NixOS/nixpkgs/pull/80671 Fixes: https://github.com/NixOS/nixpkgs/pull/66532

view details

Jörg Thalheim

commit sha 49e252a46c3dd452b5e2ed4565dd11d6e2b2571d

python3.pkgs.ciso8601: init at 2.1.3

view details

Jörg Thalheim

commit sha f146d5fdbe53c2beee24be4a92e8b50eb15e04f7

home-assistant-frontend: 20200220.5 -> 20200318.0

view details

Jörg Thalheim

commit sha 3c85ed263dddee2bab311273a5b8e36be790bfc3

python3.pkgs.zeroconf: 0.24.4 -> 0.24.5

view details

Jörg Thalheim

commit sha 63749d8a18a0a21bfe7f63092ceec1958411087f

python3.pkgs.pyicloud: 0.9.4 -> 0.9.5

view details

Jörg Thalheim

commit sha c646a568024223fca31dc619e1b119ba129bc6c4

python-jose: 3.0.1 -> 3.1.0

view details

Jörg Thalheim

commit sha 0d0a9776a273fa6156b8611169929c9e071e6c71

python3.pkgs.pycognito: init at 0.1.2

view details

Jörg Thalheim

commit sha 808909d0db48b21784ba87ab23ad195c4bdf9d37

hass-nabucasa: 0.31 -> 0.32.2

view details

Jörg Thalheim

commit sha af2e41c4ddc311a21d6325798f77467615f9d4fb

home-assistant: 0.106.6 -> 0.107.0

view details

Benjamin Hipple

commit sha 698ec44e741e5ea5eedea186230f62d174118d1c

treewide: remove torch and related packages See #71888 for details.

view details

Mario Rodas

commit sha 2c76b8f5758fba320e6d088c5a0ea68341073352

Merge pull request #83536 from zowoq/buildah buildah: 1.14.4 -> 1.14.5

view details

Jonathan Ringer

commit sha da41b78db8ed662e6cb5fd33800aa6c8f3a6530f

acme: fix darwin build

view details

Benjamin Hipple

commit sha a65e052e4c913af7ea765b06f5b44c6583299c99

python38Packages.zetup: fix build Currently fails to build on python 3.8 due to an overly restrictive version bound. ZHF: #80379 CC @NixOS/nixos-release-managers

view details

Jonathan Ringer

commit sha d0f556a2ffbcecf0e2059a042947e6911bdd72ee

onnxruntime: 1.1.2 -> 1.2.0

view details

(cdep)illabout

commit sha 9939bd67f02f08383d683f1bc9423040a730ab84

python3Packages.tensorflow-estimator: 1.15.1 -> 2.1.0 (cherry picked from commit c186f5ec4d5148b95ac535ee6affb43bd1de9bc2)

view details

Andreas Rammhold

commit sha 6c7b2ac58e343601d999f82c17ab77dba876fdd7

pythonPackages.tensorflow-estimator_1_15_1: init at 1.15.1 TF 1.15 still needs an older version of the tensorflow-estimator package. (cherry picked from commit c539f937c539b99e8c8b763b2568b52e39d3e9c4)

view details

Jörg Thalheim

commit sha 716aa1abdb1f277223e21679b3d4ef8dcebcf4b9

curaengine-lulzbot: fix build

view details

Benjamin Hipple

commit sha 3b7b98ce1e653db0123b7529a5a78961fa424fb3

pythonPackages.effect: fix build by marking py3 only Upstream only supports python >= 3.6: https://github.com/python-effect/effect/#effect CC @NixOS/nixos-release-managers ZHF: #80379

view details

Mario Rodas

commit sha dccfefe372f5619cfce0402120d8ef26803e42fd

Merge pull request #83463 from r-ryantm/auto-update/keycloak keycloak: 9.0.0 -> 9.0.2

view details

Mario Rodas

commit sha 5dbb356a8d593f352f8a0a5a63d976cf62d7ad91

Merge pull request #83547 from lopsided98/patch-1 proj: use pname instead of name

view details

push time in 3 months

created tagxzfc/cached-nix-shell

tagv0.1.2

Instant startup time for nix-shell

created time in 3 months

push eventxzfc/cached-nix-shell

Albert Safin

commit sha 94e4eb97aa84e1e9c4ecb5ebe2b08b9da22df2a2

v0.1.2

view details

push time in 3 months

push eventxzfc/cached-nix-shell

Albert Safin

commit sha db538fd8e4a28ac2367868e170ae170b6aa4b69f

Rework --version handling

view details

Albert Safin

commit sha dae37dc27c3603f3773d93d174a0362a201fdcb9

Invert defaults, CNS_IN_NIX_BUILD -> CNS_IN_NIX_SHELL

view details

Albert Safin

commit sha c18c335eea54a3aef44901aeab0dd8d6fbee75df

Update dependencies

view details

push time in 3 months

CommitCommentEvent

issue commentyshui/picom

terminals in floating scratchpads lose transparency after restarting i3

It still happens, although it's not every time. It's rare (~1/20) if there is only one window on the workspace, but it's more often if there are multiple windows.

To reproduce, open 4 peek windows and press F1 repeatedly until you'll see artifacts inside any window. Then, if you move the window with artifacts, you'll see the trail.

Screenshots: without-artifacts.png with-artifacts.png

Also, there is a minor issue: after the restart (assuming there is no trail), the border is not transparent until you move the window.

ghost

comment created time in 3 months

more